photon  1.1
photon_coll.h
Go to the documentation of this file.
1 // =============================================================================
2 // Photon RDMA Library (libphoton)
3 //
4 // Copyright (c) 2016, Trustees of Indiana University,
5 // All rights reserved.
6 //
7 // This software may be modified and distributed under the terms of the BSD
8 // license. See the COPYING file for details.
9 //
10 // This software was created at the Indiana University Center for Research in
11 // Extreme Scale Technologies (CREST).
12 // =============================================================================
13 
14 #ifndef PHOTON_COLL_H
15 #define PHOTON_COLL_H
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #include "libphoton.h"
22 
23 typedef struct photon_coll_interface_t {
24  int (*init)(photonConfig cfg);
25  int (*comm_create)(void *c, void *active, int num_active, int total);
26  void *(*comm_get)();
27  int (*probe)(int proc, int *flag, photon_cid *c);
28  int (*cid_handler)(int proc, pwc_command cmd, photon_cid cid, void *data,
29  int size);
30 
31  int (*barrier)(photonComm comm);
32  int (*ibarrier)(photonComm comm, photonRequest req);
33 
34  int (*reduce)(const void *in, void *out, int count, photonDatatype datatype,
35  void *op, int root, photonComm comm);
36  int (*ireduce)(const void *in, void *out, int count, photonDatatype datatype,
37  void *op, int root, photonComm comm, photonRequest req);
38 
39  int (*gather)(const void *in, void *out, int scount, int rcount,
40  photonDatatype stype, photonDatatype rtype,
41  int root, photonComm comm);
42  int (*igather)(const void *in, void *out, int scount, int rcount,
43  photonDatatype stype, photonDatatype rtype,
44  int root, photonComm comm, photonRequest req);
45 
46  int (*allreduce)(const void *in, void *out, int count, photonDatatype datatype,
47  void *op, photonComm comm);
48  int (*iallreduce)(const void *in, void *out, int count, photonDatatype datatype,
49  void *op, photonComm comm, photonRequest req);
50 
51  int (*scan)(const void *in, void *out, int count, photonDatatype datatype,
52  void *op, photonComm comm);
53  int (*iscan)(const void *in, void *out, int count, photonDatatype datatype,
54  void *op, photonComm comm, photonRequest req);
55  // ...
57 
58 typedef struct photon_coll_ctx_t { void *comm; } photon_coll_ctx;
59 
60 // internal initializtion of the collective interface
61 PHOTON_INTERNAL int photon_coll_init(photonConfig cfg);
62 
64  photon_coll ctype, photon_cid local,
65  photon_rid *request, int flags);
66 
68  void *out, int scount, int rcount,
69  photonDatatype stype, photonDatatype rtype,
70  int root, void *op);
71 
73 _photon_collective_init_new_comm(void *active, int num_active, int total,
74  photon_coll ctype, photon_cid local,
75  photon_rid *request, int flags, photonComm *c);
76 
77 
78 // collective communicator setup method
79 PHOTON_INTERNAL int _photon_collective_comm_create(void *active, int num_active,
80  int total, photonComm *c);
81 
82 // internal probe method not exposed via API
83 PHOTON_INTERNAL int photon_coll_probe(int proc, int *flag, photon_cid *comp);
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif
PHOTON_INTERNAL int _photon_collective_comm_create(void *active, int num_active, int total, photonComm *c)
Definition: photon_coll.c:86
photon_datatype_t photonDatatype
The Photon completion ID used by the PWC API.
Definition: photon.h:78
uint64_t photon_rid
The Photon request ID.
Definition: photon.h:75
pwc_command
Definition: photon_pwc.h:37
struct photon_req_t * photonRequest
#define PHOTON_INTERNAL
PHOTON_INTERNAL int photon_coll_init(photonConfig cfg)
Definition: photon_coll.c:41
PHOTON_INTERNAL int photon_coll_probe(int proc, int *flag, photon_cid *comp)
Definition: photon_coll.c:73
PHOTON_INTERNAL int _photon_collective_join(photon_rid request, void *in, void *out, int scount, int rcount, photonDatatype stype, photonDatatype rtype, int root, void *op)
Definition: photon_coll.c:191
void * photonComm
PHOTON_INTERNAL int _photon_collective_init_new_comm(void *active, int num_active, int total, photon_coll ctype, photon_cid local, photon_rid *request, int flags, photonComm *c)
Definition: photon_coll.c:143
PHOTON_INTERNAL int _photon_collective_init(photonComm c, photon_coll ctype, photon_cid local, photon_rid *request, int flags)
Definition: photon_coll.c:97