photon  1.1
photon_collectives.h
Go to the documentation of this file.
1 // =============================================================================
2 // Photon RDMA Library (libphoton)
3 //
4 // Copyright (c) 2017, 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_COLLECTIVES_H
15 #define PHOTON_COLLECTIVES_H
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 typedef enum {
27 
28 static const char* const PHOTON_COLL_IFACE_TO_STRING[] = {
29  "default",
30  "pwc",
31  "nbc",
32  "INVALID_COLLECTIVE_INTERACE"
33 };
34 
37 typedef void* photon_datatype_t;
38 typedef photon_datatype_t photonDatatype;
39 
40 extern photon_datatype_t photon_datatype_null;
41 extern photon_datatype_t photon_char;
42 extern photon_datatype_t photon_signed_char;
43 extern photon_datatype_t photon_unsigned_char;
44 extern photon_datatype_t photon_byte;
45 extern photon_datatype_t photon_short;
46 extern photon_datatype_t photon_unsigned_short;
47 extern photon_datatype_t photon_int;
48 extern photon_datatype_t photon_unsigned;
49 extern photon_datatype_t photon_long;
50 extern photon_datatype_t photon_unsigned_long;
51 extern photon_datatype_t photon_long_long_int;
52 extern photon_datatype_t photon_unsigned_long_long;
53 extern photon_datatype_t photon_float;
54 extern photon_datatype_t photon_double;
55 extern photon_datatype_t photon_long_double;
56 extern photon_datatype_t photon_wchar;
57 extern photon_datatype_t photon_packed;
58 
60 #define PHOTON_DT_NULL ((photonDatatype) (photon_datatype_null))
61 #define PHOTON_DT_BYTE ((photonDatatype) (photon_byte))
62 #define PHOTON_DT_PACKED ((photonDatatype) (photon_packed))
63 #define PHOTON_DT_CHAR ((photonDatatype) (photon_char))
64 #define PHOTON_DT_SHORT ((photonDatatype) (photon_short))
65 #define PHOTON_DT_INT ((photonDatatype) (photon_int))
66 #define PHOTON_DT_LONG ((photonDatatype) (photon_long))
67 #define PHOTON_DT_FLOAT ((photonDatatype) (photon_float))
68 #define PHOTON_DT_DOUBLE ((photonDatatype) (photon_double))
69 #define PHOTON_DT_LONG_DOUBLE ((photonDatatype) (photon_long_double))
70 #define PHOTON_DT_UNSIGNED_CHAR ((photonDatatype) (photon_unsigned_char))
71 #define PHOTON_DT_SIGNED_CHAR ((photonDatatype) (photon_signed_char))
72 #define PHOTON_DT_UNSIGNED_SHORT ((photonDatatype) (photon_unsigned_short))
73 #define PHOTON_DT_UNSIGNED_LONG ((photonDatatype) (photon_unsigned_long))
74 #define PHOTON_DT_UNSIGNED ((photonDatatype) (photon_unsigned))
75 #define PHOTON_DT_LONG_LONG_INT ((photonDatatype) (photon_long_long_int))
76 #define PHOTON_DT_LONG_LONG ((photonDatatype) (photon_long_long))
77 #define PHOTON_DT_UNSIGNED_LONG_LONG ((photonDatatype) (photon_unsigned_long_long))
78 
81 typedef void* photon_op_t;
82 typedef photon_op_t photonOp;
83 
84 extern photon_op_t photon_op_null;
85 extern photon_op_t photon_op_min;
86 extern photon_op_t photon_op_max;
87 extern photon_op_t photon_op_sum;
88 extern photon_op_t photon_op_prod;
89 extern photon_op_t photon_op_land;
90 extern photon_op_t photon_op_band;
91 extern photon_op_t photon_op_lor;
92 extern photon_op_t photon_op_bor;
93 extern photon_op_t photon_op_lxor;
94 extern photon_op_t photon_op_bxor;
95 extern photon_op_t photon_op_maxloc;
96 extern photon_op_t photon_op_minloc;
97 extern photon_op_t photon_op_replace;
98 extern photon_op_t photon_op_no_op;
99 
100 #define PHOTON_OP_NULL ((photonOp) (photon_op_null))
101 #define PHOTON_OP_MAX ((photonOp) (photon_op_max))
102 #define PHOTON_OP_MIN ((photonOp) (photon_op_min))
103 #define PHOTON_OP_SUM ((photonOp) (photon_op_sum))
104 #define PHOTON_OP_PROD ((photonOp) (photon_op_prod))
105 #define PHOTON_OP_LAND ((photonOp) (photon_op_land))
106 #define PHOTON_OP_BAND ((photonOp) (photon_op_band))
107 #define PHOTON_OP_LOR ((photonOp) (photon_op_lor))
108 #define PHOTON_OP_BOR ((photonOp) (photon_op_bor))
109 #define PHOTON_OP_LXOR ((photonOp) (photon_op_lxor))
110 #define PHOTON_OP_BXOR ((photonOp) (photon_op_bxor))
111 #define PHOTON_OP_MAXLOC ((photonOp) (photon_op_maxloc))
112 #define PHOTON_OP_MINLOC ((photonOp) (photon_op_minloc))
113 #define PHOTON_OP_REPLACE ((photonOp) (photon_op_replace))
114 #define PHOTON_OP_NO_OP ((photonOp) (photon_op_no_op))
115 
116 typedef enum {
128 } photon_coll;
129 
130 typedef enum {
135 
136 typedef enum {
144 
145 #define PHOTON_COLL_MSG_RING_AT_BR 65
146 #define PHOTON_COLL_MSG_RING_RELEASE_BR 67
147 #define PHOTON_COLL_MSG_TREE_CHILD_AT_BR 68
148 #define PHOTON_COLL_MSG_REC_DOUBLING_TAG 1
149 
150 // Collectives with completion
151 typedef void* photonComm;
152 extern photonComm PHOTON_COMM_WORLD;
153 
160 
162 
179 int photon_collective_init(photonComm comm, photon_coll ctype, photon_cid local,
180  photon_rid *request, int flags);
181 
199 int photon_collective_join(photon_rid request, void *in, void *out, int scount, int rcount,
200  photonDatatype stype, photonDatatype rtype, int root, photonOp op);
201 
203 int photon_collective_comm_create(void *active, int num_active, int total, photonComm *c);
205 int photon_collective_init_new_comm(void *active, int num_active, int total, photon_coll ctype,
206  photon_cid local, photon_rid *request, int flags, photonComm *c);
207 
209 
210 #ifdef __cplusplus
211 }
212 #endif
213 
214 #endif
void * photon_op_t
photon_datatype_t photonDatatype
photon_datatype_t photon_byte
The Photon completion ID used by the PWC API.
Definition: photon.h:78
photon_datatype_t photon_signed_char
photon_op_t photon_op_prod
photon_datatype_t photon_packed
photon_datatype_t photon_unsigned_char
photon_op_t photon_op_land
photon_datatype_t photon_char
photon_coll_algo
photon_datatype_t photon_long_long_int
uint64_t photon_rid
The Photon request ID.
Definition: photon.h:75
photonComm PHOTON_COMM_WORLD
photon_op_t photonOp
photon_datatype_t photon_long
photon_op_t photon_op_band
photon_datatype_t photon_float
photon_op_t photon_op_no_op
photon_op_t photon_op_sum
photon_datatype_t photon_datatype_null
photon_cfg_coll_iface_t
photon_datatype_t photon_int
void * photon_datatype_t
photon_datatype_t photon_unsigned_long
photon_op_t photon_op_lor
photon_op_t photon_op_null
photon_op_t photon_op_maxloc
photon_coll_node
photon_datatype_t photon_unsigned_short
int photon_collective_comm_create(void *active, int num_active, int total, photonComm *c)
In-progress communicator handling.
Definition: libphoton.c:552
photon_op_t photon_op_replace
photon_datatype_t photon_wchar
photon_datatype_t photon_short
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)
In-progress communicator handling.
Definition: libphoton.c:557
photon_datatype_t photon_unsigned_long_long
photon_datatype_t photon_unsigned
photon_op_t photon_op_min
photon_op_t photon_op_max
int photon_collective_join(photon_rid request, void *in, void *out, int scount, int rcount, photonDatatype stype, photonDatatype rtype, int root, photonOp op)
Definition: libphoton.c:546
photon_datatype_t photon_double
photon_op_t photon_op_lxor
photon_datatype_t photon_long_double
photon_op_t photon_op_bor
int photon_collective_init(photonComm comm, photon_coll ctype, photon_cid local, photon_rid *request, int flags)
Definition: libphoton.c:540
photon_op_t photon_op_minloc
void * photonComm
photon_op_t photon_op_bxor