Skip to content

Commit abeb91a

Browse files
Mamzi Bayatpour  mbayatpour@nvidia.com ()janjustmanjugv
committed
Adding new oshmem APIs for oshmem v1.5
Signed-off-by: Mamzi Bayatpour <mbayatpour@nvidia.com> Co-authored-by: Tomislav Janjusic <tomislavj@nvidia.com> Co-authored-by: Manjunath Gorentla Venkata <manjunath@nvidia.com>
1 parent 81aeea5 commit abeb91a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+8402
-45
lines changed

oshmem/include/oshmem/constants.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,31 @@ enum {
8080
SHMEM_NULL = 0,
8181
SHMEM_CHAR,
8282
SHMEM_UCHAR,
83+
SHMEM_SCHAR,
8384
SHMEM_SHORT,
8485
SHMEM_USHORT,
8586
SHMEM_INT,
8687
SHMEM_UINT,
8788
SHMEM_LONG,
8889
SHMEM_ULONG,
8990
SHMEM_LLONG,
91+
SHMEM_BYTE,
92+
SHMEM_INT8_T,
93+
SHMEM_INT16_T,
9094
SHMEM_INT32_T,
9195
SHMEM_INT64_T,
96+
SHMEM_UINT8_T,
97+
SHMEM_UINT16_T,
98+
SHMEM_UINT32_T,
99+
SHMEM_UINT64_T,
100+
SHMEM_SIZE_T,
101+
SHMEM_PTRDIFF_T,
92102
SHMEM_ULLONG,
93103
SHMEM_FLOAT,
94104
SHMEM_DOUBLE,
95105
SHMEM_LDOUBLE,
106+
SHMEM_COMPLEXD,
107+
SHMEM_COMPLEXF,
96108

97109
SHMEM_FINT,
98110
SHMEM_FINT4,

oshmem/include/pshmem.h

Lines changed: 1580 additions & 5 deletions
Large diffs are not rendered by default.

oshmem/include/pshmemx.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616
extern "C" {
1717
#endif
1818

19-
/*
20-
* Symmetric heap routines
21-
*/
22-
OSHMEM_DECLSPEC void* pshmemx_malloc_with_hint(size_t size, long hint);
23-
2419

2520
/*
2621
* Legacy API

oshmem/include/shmem.h.in

Lines changed: 1583 additions & 2 deletions
Large diffs are not rendered by default.

oshmem/include/shmemx.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ enum {
3636
* file. These extensions shall use the shmemx_ prefix for all routine, variable, and constant names.
3737
*/
3838

39-
/*
40-
* Symmetric heap routines
41-
*/
42-
OSHMEM_DECLSPEC void* shmemx_malloc_with_hint(size_t size, long hint);
43-
4439
/*
4540
* Elemental put routines
4641
*/

oshmem/mca/atomic/atomic.h

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,42 @@ BEGIN_C_DECLS
105105
target, value, pe); \
106106
}
107107

108+
#define DO_OSHMEM_TYPE_FOP_NBI(ctx, type_name, type, op, fetch, target, value, pe) do { \
109+
int rc = OSHMEM_SUCCESS; \
110+
size_t size = 0; \
111+
type out_value; \
112+
\
113+
RUNTIME_CHECK_INIT(); \
114+
RUNTIME_CHECK_PE(pe); \
115+
RUNTIME_CHECK_ADDR(target); \
116+
\
117+
size = sizeof(out_value); \
118+
rc = MCA_ATOMIC_CALL(f##op##_nb( \
119+
ctx, \
120+
fetch, \
121+
(void*)target, \
122+
(void*)&out_value, \
123+
value, \
124+
size, \
125+
pe)); \
126+
RUNTIME_CHECK_RC(rc); \
127+
\
128+
return ; \
129+
} while (0)
130+
131+
#define OSHMEM_TYPE_FOP_NBI(type_name, type, prefix, op) \
132+
void prefix##_##type_name##_atomic_fetch_##op##_nbi(type *fetch, type *target, type value, int pe) \
133+
{ \
134+
DO_OSHMEM_TYPE_FOP_NBI(oshmem_ctx_default, type_name, type, op, \
135+
fetch, target, value, pe); \
136+
}
137+
138+
#define OSHMEM_CTX_TYPE_FOP_NBI(type_name, type, prefix, op) \
139+
void prefix##_ctx_##type_name##_atomic_fetch_##op##_nbi(shmem_ctx_t ctx, type *fetch, type *target, type value, int pe) \
140+
{ \
141+
DO_OSHMEM_TYPE_FOP_NBI(ctx, type_name, type, op, \
142+
fetch, target, value, pe); \
143+
}
108144
/* ******************************************************************** */
109145

110146
struct oshmem_op_t;
@@ -216,6 +252,50 @@ struct mca_atomic_base_module_1_0_0_t {
216252
uint64_t value,
217253
size_t size,
218254
int pe);
255+
int (*atomic_fadd_nb)(shmem_ctx_t ctx,
256+
void *fetch,
257+
void *target,
258+
void *prev,
259+
uint64_t value,
260+
size_t size,
261+
int pe);
262+
int (*atomic_cswap_nb)(shmem_ctx_t ctx,
263+
void *fetch,
264+
void *target,
265+
uint64_t *prev, /* prev is used internally by wrapper, we may
266+
always use 64-bit value */
267+
uint64_t cond,
268+
uint64_t value,
269+
size_t size,
270+
int pe);
271+
int (*atomic_swap_nb)(shmem_ctx_t ctx,
272+
void *fetch,
273+
void *target,
274+
void *prev,
275+
uint64_t value,
276+
size_t size,
277+
int pe);
278+
int (*atomic_fand_nb)(shmem_ctx_t ctx,
279+
void *fetch,
280+
void *target,
281+
void *prev,
282+
uint64_t value,
283+
size_t size,
284+
int pe);
285+
int (*atomic_for_nb)(shmem_ctx_t ctx,
286+
void *fetch,
287+
void *target,
288+
void *prev,
289+
uint64_t value,
290+
size_t size,
291+
int pe);
292+
int (*atomic_fxor_nb)(shmem_ctx_t ctx,
293+
void *fetch,
294+
void *target,
295+
void *prev,
296+
uint64_t value,
297+
size_t size,
298+
int pe);
219299
};
220300
typedef struct mca_atomic_base_module_1_0_0_t mca_atomic_base_module_1_0_0_t;
221301

oshmem/mca/atomic/ucx/atomic_ucx_cswap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ int mca_atomic_ucx_cswap(shmem_ctx_t ctx,
7272
"ucp_atomic_fetch_nb");
7373
#endif
7474
}
75+

oshmem/mca/atomic/ucx/atomic_ucx_module.c

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,77 @@ static int mca_atomic_ucx_swap(shmem_ctx_t ctx,
268268
#endif
269269
}
270270

271+
static int mca_atomic_ucx_fadd_nb(shmem_ctx_t ctx,
272+
void *fetch,
273+
void *target,
274+
void *prev,
275+
uint64_t value,
276+
size_t size,
277+
int pe)
278+
{
279+
return OSHMEM_ERR_NOT_IMPLEMENTED;
280+
}
281+
282+
static int mca_atomic_ucx_fand_nb(shmem_ctx_t ctx,
283+
void *fetch,
284+
void *target,
285+
void *prev,
286+
uint64_t value,
287+
size_t size,
288+
int pe)
289+
{
290+
return OSHMEM_ERR_NOT_IMPLEMENTED;
291+
}
292+
293+
static int mca_atomic_ucx_for_nb(shmem_ctx_t ctx,
294+
void *fetch,
295+
void *target,
296+
void *prev,
297+
uint64_t value,
298+
size_t size,
299+
int pe)
300+
{
301+
return OSHMEM_ERR_NOT_IMPLEMENTED;
302+
}
303+
304+
static int mca_atomic_ucx_fxor_nb(shmem_ctx_t ctx,
305+
void *fetch,
306+
void *target,
307+
void *prev,
308+
uint64_t value,
309+
size_t size,
310+
int pe)
311+
{
312+
return OSHMEM_ERR_NOT_IMPLEMENTED;
313+
}
314+
315+
static int mca_atomic_ucx_swap_nb(shmem_ctx_t ctx,
316+
void *fetch,
317+
void *target,
318+
void *prev,
319+
uint64_t value,
320+
size_t size,
321+
int pe)
322+
{
323+
return OSHMEM_ERR_NOT_IMPLEMENTED;
324+
}
325+
326+
327+
int mca_atomic_ucx_cswap_nb(shmem_ctx_t ctx,
328+
void *fetch,
329+
void *target,
330+
uint64_t *prev,
331+
uint64_t cond,
332+
uint64_t value,
333+
size_t size,
334+
int pe)
335+
{
336+
return OSHMEM_ERR_NOT_IMPLEMENTED;
337+
}
338+
339+
340+
341+
271342

272343
mca_atomic_base_module_t *
273344
mca_atomic_ucx_query(int *priority)
@@ -288,6 +359,12 @@ mca_atomic_ucx_query(int *priority)
288359
module->super.atomic_fxor = mca_atomic_ucx_fxor;
289360
module->super.atomic_swap = mca_atomic_ucx_swap;
290361
module->super.atomic_cswap = mca_atomic_ucx_cswap;
362+
module->super.atomic_fadd_nb = mca_atomic_ucx_fadd_nb;
363+
module->super.atomic_fand_nb = mca_atomic_ucx_fand_nb;
364+
module->super.atomic_for_nb = mca_atomic_ucx_for_nb;
365+
module->super.atomic_fxor_nb = mca_atomic_ucx_fxor_nb;
366+
module->super.atomic_swap_nb = mca_atomic_ucx_swap_nb;
367+
module->super.atomic_cswap_nb = mca_atomic_ucx_cswap_nb;
291368
return &(module->super);
292369
}
293370

0 commit comments

Comments
 (0)