Skip to content

Commit 8464b61

Browse files
committed
oshmem: Align OSHMEM API with spec v1.3 (Add spml/get_nb interface)
1 parent 6d7ada9 commit 8464b61

File tree

6 files changed

+51
-7
lines changed

6 files changed

+51
-7
lines changed

oshmem/mca/spml/base/base.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ OSHMEM_DECLSPEC int mca_spml_base_oob_get_mkeys(int pe,
7171

7272
OSHMEM_DECLSPEC void mca_spml_base_rmkey_unpack(sshmem_mkey_t *mkey, int pe);
7373
OSHMEM_DECLSPEC void mca_spml_base_rmkey_free(sshmem_mkey_t *mkey);
74+
OSHMEM_DECLSPEC int mca_spml_base_put_nb(void *dst_addr,
75+
size_t size,
76+
void *src_addr,
77+
int dst,
78+
void **handle);
79+
OSHMEM_DECLSPEC int mca_spml_base_get_nb(void *dst_addr,
80+
size_t size,
81+
void *src_addr,
82+
int src,
83+
void **handle);
7484

7585
/*
7686
* MCA framework

oshmem/mca/spml/base/spml_base.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,15 @@ void mca_spml_base_rmkey_unpack(sshmem_mkey_t *mkey, int pe)
165165
void mca_spml_base_rmkey_free(sshmem_mkey_t *mkey)
166166
{
167167
}
168+
169+
int mca_spml_base_put_nb(void *dst_addr, size_t size,
170+
void *src_addr, int dst, void **handle)
171+
{
172+
return OSHMEM_ERROR;
173+
}
174+
175+
int mca_spml_base_get_nb(void *dst_addr, size_t size,
176+
void *src_addr, int src, void **handle)
177+
{
178+
return OSHMEM_ERROR;
179+
}

oshmem/mca/spml/ikrit/spml_ikrit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ mca_spml_ikrit_t mca_spml_ikrit = {
221221
mca_spml_ikrit_put,
222222
mca_spml_ikrit_put_nb,
223223
mca_spml_ikrit_get,
224+
mca_spml_base_get_nb, /* todo: mca_spml_ikrit_get_nb, */
224225
mca_spml_ikrit_recv,
225226
mca_spml_ikrit_send,
226227
mca_spml_base_wait,

oshmem/mca/spml/spml.h

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,17 +208,35 @@ typedef int (*mca_spml_base_module_put_nb_fn_t)(void *dst_addr,
208208
* Blocking data transfer from remote PE.
209209
* Read data from remote PE.
210210
*
211-
* @param dst_addr - The address on the local PE, to write the result of the get operation to.
212-
* @param size - The number of bytes to be read.
213-
* @param src_addr - The address on the remote PE, to read from.
214-
* @param src - The ID of the remote PE.
215-
* @return - OSHMEM_SUCCESS or failure status.
211+
* @param dst_addr The address on the local PE, to write the result of the get operation to.
212+
* @param size The number of bytes to be read.
213+
* @param src_addr The address on the remote PE, to read from.
214+
* @param src The ID of the remote PE.
215+
* @return OSHMEM_SUCCESS or failure status.
216216
*/
217217
typedef int (*mca_spml_base_module_get_fn_t)(void *dst_addr,
218218
size_t size,
219219
void *src_addr,
220220
int src);
221221

222+
/**
223+
* Non-blocking data transfer from remote PE.
224+
* Read data from remote PE.
225+
*
226+
* @param dst_addr The address on the local PE, to write the result of the get operation to.
227+
* @param size The number of bytes to be read.
228+
* @param src_addr The address on the remote PE, to read from.
229+
* @param src The ID of the remote PE.
230+
* @param handle The address of a handle to be passed to shmem_wait_nb() or
231+
* shmem_test_nb() to wait or poll for the completion of the transfer.
232+
* @return - OSHMEM_SUCCESS or failure status.
233+
*/
234+
typedef int (*mca_spml_base_module_get_nb_fn_t)(void *dst_addr,
235+
size_t size,
236+
void *src_addr,
237+
int src,
238+
void **handle);
239+
222240
/**
223241
* Post a receive and wait for completion.
224242
*
@@ -255,7 +273,7 @@ typedef int (*mca_spml_base_module_fence_fn_t)(void);
255273
*
256274
* @return - OSHMEM_SUCCESS or failure status.
257275
*/
258-
typedef int (*mca_spml_base_module_wait_nb_fn_t)(void*);
276+
typedef int (*mca_spml_base_module_wait_nb_fn_t)(void *);
259277

260278
/**
261279
* SPML instance.
@@ -273,6 +291,7 @@ struct mca_spml_base_module_1_0_0_t {
273291
mca_spml_base_module_put_fn_t spml_put;
274292
mca_spml_base_module_put_nb_fn_t spml_put_nb;
275293
mca_spml_base_module_get_fn_t spml_get;
294+
mca_spml_base_module_get_nb_fn_t spml_get_nb;
276295

277296
mca_spml_base_module_recv_fn_t spml_recv;
278297
mca_spml_base_module_send_fn_t spml_send;

oshmem/mca/spml/ucx/spml_ucx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ mca_spml_ucx_t mca_spml_ucx = {
5353
mca_spml_ucx_deregister,
5454
mca_spml_base_oob_get_mkeys,
5555
mca_spml_ucx_put,
56-
NULL, /* todo: mca_spml_ucx_put_nb, */
56+
mca_spml_base_put_nb, /* todo: mca_spml_ucx_put_nb, */
5757
mca_spml_ucx_get,
58+
mca_spml_base_get_nb, /* todo: mca_spml_ucx_get_nb, */
5859
mca_spml_ucx_recv,
5960
mca_spml_ucx_send,
6061
mca_spml_base_wait,

oshmem/mca/spml/yoda/spml_yoda.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ mca_spml_yoda_module_t mca_spml_yoda = {
5757
mca_spml_yoda_put,
5858
mca_spml_yoda_put_nb,
5959
mca_spml_yoda_get,
60+
mca_spml_base_get_nb, /* todo: mca_spml_yoda_get_nb, */
6061
mca_spml_yoda_recv,
6162
mca_spml_yoda_send,
6263
mca_spml_base_wait,

0 commit comments

Comments
 (0)