24 #include "photon_pwc_nbc.h" 29 void *data,
int size);
48 coll_iface = photon_coll_map[cfg->coll];
51 log_err(
"Requested collective interface is not enabled: %s",
52 PHOTON_COLL_IFACE_TO_STRING[cfg->coll]);
56 one_debug(
"Initializing the \"%s\" collective interface",
57 PHOTON_COLL_IFACE_TO_STRING[cfg->coll]);
60 if (coll_iface->
init) {
61 rc = coll_iface->
init(cfg);
79 if (coll_iface->
probe) {
80 return coll_iface->
probe(proc, flag, comp);
89 rc = coll_iface->
comm_create(c, active, num_active, total);
91 log_err(
"Could not create communicator");
106 log_err(
"Could not allocate new request");
110 nctx = malloc(
sizeof(*nctx));
112 log_err(
"Could not allocate new collective context");
113 goto error_exit_free;
124 req->local_info.id = local;
125 req->remote_info.id.
u64 = 0x0;
155 log_err(
"Could not allocate new request");
159 nctx = malloc(
sizeof(*nctx));
161 log_err(
"Could not allocate new collective context");
162 goto error_exit_free;
167 log_err(
"Could not create communicator");
175 req->local_info.id = local;
176 req->remote_info.id.
u64 = 0x0;
199 log_err(
"No request found with rid: 0x%016lx\n", request);
222 assert(coll_iface->
reduce);
223 coll_iface->
reduce(in, out, scount, stype, op, root, ctx->
comm);
229 return coll_iface->
ireduce(in, out, scount, stype, op, root, ctx->
comm, req);
233 assert(coll_iface->
gather);
234 coll_iface->
gather(in, out, scount, rcount, stype, rtype, root, ctx->
comm);
240 return coll_iface->
igather(in, out, scount, rcount, stype, rtype, root, ctx->
comm, req);
245 coll_iface->
allreduce(in, out, scount, stype, op, ctx->
comm);
252 return coll_iface->
iallreduce(in, out, scount, stype, op,
259 log_err(
"unsupported collective type: %d", req->type);
275 void *data,
int size) {
277 coll_iface->
cid_handler(proc, cmd, cid, data, size);
int _photon_collective_join(photon_rid request, void *in, void *out, int scount, int rcount, photonDatatype stype, photonDatatype rtype, int root, void *op)
int(* allreduce)(const void *in, void *out, int count, photonDatatype datatype, void *op, photonComm comm)
photon_datatype_t photonDatatype
photonRequest photon_lookup_request(photon_rid rid)
photon_coll_interface pwc_collectives
The Photon completion ID used by the PWC API.
int photon_pwc_register_ctype_handler(pwc_cid_type type, void *handler)
int photon_coll_probe(int proc, int *flag, photon_cid *comp)
int(* probe)(int proc, int *flag, photon_cid *c)
uint64_t photon_rid
The Photon request ID.
int(* igather)(const void *in, void *out, int scount, int rcount, photonDatatype stype, photonDatatype rtype, int root, photonComm comm, photonRequest req)
int(* ireduce)(const void *in, void *out, int count, photonDatatype datatype, void *op, int root, photonComm comm, photonRequest req)
int(* iallreduce)(const void *in, void *out, int count, photonDatatype datatype, void *op, photonComm comm, photonRequest req)
photonRequest photon_get_request(int proc)
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)
struct photon_req_t * photonRequest
#define PHOTON_ERROR
Error code, general error.
int photon_free_request(photonRequest req)
int(* comm_create)(void *c, void *active, int num_active, int total)
int(* cid_handler)(int proc, pwc_command cmd, photon_cid cid, void *data, int size)
#define PHOTON_REQ_PWC_NO_LCE
PWC flag: probe will not return a local completion ID.
#define PHOTON_OK
Photon success code.
int(* barrier)(photonComm comm)
int(* ibarrier)(photonComm comm, photonRequest req)
int _photon_collective_init(photonComm c, photon_coll ctype, photon_cid local, photon_rid *request, int flags)
#define REQUEST_FLAG_NO_LCE
uint64_t u64
Unsigned 64b representation of the ID.
int photon_coll_init(photonConfig cfg)
int(* gather)(const void *in, void *out, int scount, int rcount, photonDatatype stype, photonDatatype rtype, int root, photonComm comm)
int(* init)(photonConfig cfg)
int(* reduce)(const void *in, void *out, int count, photonDatatype datatype, void *op, int root, photonComm comm)
int photon_pwc_add_req(photonRequest req)
int _photon_collective_comm_create(void *active, int num_active, int total, photonComm *c)