1
1

Merge pull request #5198 from brminich/shmem_fence

OSHMEM/SMPL/UCX: Add real fence support
Этот коммит содержится в:
Yossi Itigin 2018-05-27 11:25:42 +03:00 коммит произвёл GitHub
родитель 66e774d959 8e9d401938
Коммит 705c8a7b9b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 26 добавлений и 22 удалений

Просмотреть файл

@ -72,10 +72,10 @@ int mca_scoll_basic_alltoall(struct oshmem_group_t *group,
return rc;
}
/* fence (which currently acts as quiet) is needed
* because scoll level barrier does not guarantee put completion
/* quiet is needed because scoll level barrier does not
* guarantee put completion
*/
MCA_SPML_CALL(fence());
MCA_SPML_CALL(quiet());
/* Wait for operation completion */
SCOLL_VERBOSE(14, "[#%d] Wait for operation completion", group->my_pe);

Просмотреть файл

@ -167,8 +167,7 @@ static int _algorithm_central_counter(struct oshmem_group_t *group,
The root could leave the first barrier and in the second barrier it could get SHMEM_SYNC_WAIT value on
remote node before the remote node receives its SHMEM_SYNC_RUN value in the first barrier
*/
/* TODO: actually it must be quiet */
MCA_SPML_CALL(fence());
MCA_SPML_CALL(quiet());
}
/* Wait for RUN signal */
else {

Просмотреть файл

@ -146,10 +146,10 @@ static int _algorithm_central_counter(struct oshmem_group_t *group,
rc = MCA_SPML_CALL(put(target, nlong, (void *)source, pe_cur));
}
}
/* fence (which currently acts as quiet) is needed
* because scoll level barrier does not guarantee put completion
/* quiet is needed because scoll level barrier does not
* guarantee put completion
*/
MCA_SPML_CALL(fence());
MCA_SPML_CALL(quiet());
}
if (rc == OSHMEM_SUCCESS) {

Просмотреть файл

@ -153,11 +153,7 @@ int mca_spml_base_wait(void* addr, int cmp, void* value, int datatype)
*/
int mca_spml_base_wait_nb(void* handle)
{
/* TODO fence is a gag for more accurate code
* Use shmem_quiet() (or a function calling shmem_quiet()) or
* shmem_wait_nb() to force completion of transfers for non-blocking operations.
*/
MCA_SPML_CALL(fence());
MCA_SPML_CALL(quiet());
return OSHMEM_SUCCESS;
}

Просмотреть файл

@ -168,6 +168,7 @@ mca_spml_ikrit_t mca_spml_ikrit = {
mca_spml_ikrit_send,
mca_spml_base_wait,
mca_spml_base_wait_nb,
mca_spml_ikrit_fence, /* fence is implemented as quiet */
mca_spml_ikrit_fence,
mca_spml_ikrit_cache_mkeys,
mca_spml_base_rmkey_free,

Просмотреть файл

@ -275,12 +275,19 @@ typedef int (*mca_spml_base_module_send_fn_t)(void *buf,
mca_spml_base_put_mode_t mode);
/**
* Wait for completion of all outstanding put() requests
* Assures ordering of delivery of put() requests
*
* @return - OSHMEM_SUCCESS or failure status.
*/
typedef int (*mca_spml_base_module_fence_fn_t)(void);
/**
* Wait for completion of all outstanding put() requests
*
* @return - OSHMEM_SUCCESS or failure status.
*/
typedef int (*mca_spml_base_module_quiet_fn_t)(void);
/**
* Waits for completion of a non-blocking put or get issued by the calling PE.
*
@ -321,6 +328,7 @@ struct mca_spml_base_module_1_0_0_t {
mca_spml_base_module_wait_fn_t spml_wait;
mca_spml_base_module_wait_nb_fn_t spml_wait_nb;
mca_spml_base_module_fence_fn_t spml_fence;
mca_spml_base_module_quiet_fn_t spml_quiet;
mca_spml_base_module_mkey_unpack_fn_t spml_rmkey_unpack;
mca_spml_base_module_mkey_free_fn_t spml_rmkey_free;

Просмотреть файл

@ -60,8 +60,8 @@ mca_spml_ucx_t mca_spml_ucx = {
mca_spml_ucx_send,
mca_spml_base_wait,
mca_spml_base_wait_nb,
mca_spml_ucx_quiet, /* At the moment fence is the same as quite for
every spml */
mca_spml_ucx_fence,
mca_spml_ucx_quiet,
mca_spml_ucx_rmkey_unpack,
mca_spml_ucx_rmkey_free,
mca_spml_ucx_rmkey_ptr,
@ -520,7 +520,7 @@ int mca_spml_ucx_deregister(sshmem_mkey_t *mkeys)
spml_ucx_mkey_t *ucx_mkey;
map_segment_t *mem_seg;
MCA_SPML_CALL(fence());
MCA_SPML_CALL(quiet());
if (!mkeys)
return OSHMEM_SUCCESS;
@ -598,7 +598,7 @@ int mca_spml_ucx_fence(void)
{
ucs_status_t err;
err = ucp_worker_flush(mca_spml_ucx.ucp_worker);
err = ucp_worker_fence(mca_spml_ucx.ucp_worker);
if (UCS_OK != err) {
SPML_ERROR("fence failed: %s", ucs_status_string(err));
oshmem_shmem_abort(-1);

Просмотреть файл

@ -36,7 +36,7 @@ void shmem_barrier(int PE_start, int logPE_stride, int PE_size, long *pSync)
#if OSHMEM_SPEC_COMPAT == 1
/* all outstanding puts must be completed */
shmem_fence();
shmem_quiet();
#endif
/* Create group basing PE_start, logPE_stride and PE_size */
@ -54,7 +54,7 @@ void shmem_barrier_all(void)
#if OSHMEM_SPEC_COMPAT == 1
/* all outstanding puts must be completed */
shmem_fence();
shmem_quiet();
#endif
if (mca_scoll_sync_array) {

Просмотреть файл

@ -23,5 +23,5 @@
void shmem_quiet(void)
{
MCA_SPML_CALL(fence());
MCA_SPML_CALL(quiet());
}

Просмотреть файл

@ -30,5 +30,5 @@ SHMEM_GENERATE_FORTRAN_BINDINGS_SUB (void,
void shmem_quiet_f(void)
{
MCA_SPML_CALL(fence());
MCA_SPML_CALL(quiet());
}