ATOMICS/UCX: redefine atomic module API
- now it accepts integer values directily instead of pointers Signed-off-by: Sergey Oblomov <sergeyo@mellanox.com>
Этот коммит содержится в:
родитель
a0ea368464
Коммит
f574c14e3a
@ -19,6 +19,7 @@
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/runtime/opal_progress.h"
|
||||
#include "opal/include/opal/constants.h"
|
||||
#include "opal/class/opal_list.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
@ -30,7 +31,7 @@ OPAL_DECLSPEC void opal_common_ucx_empty_complete_cb(void *request, ucs_status_t
|
||||
OPAL_DECLSPEC void opal_common_ucx_mca_pmix_fence(ucp_worker_h worker);
|
||||
|
||||
static inline
|
||||
ucs_status_t opal_common_ucx_wait_request(ucs_status_ptr_t request, ucp_worker_h worker)
|
||||
ucs_status_t opal_common_ucx_wait_request_internal(ucs_status_ptr_t request, ucp_worker_h worker)
|
||||
{
|
||||
ucs_status_t status;
|
||||
int i;
|
||||
@ -38,13 +39,6 @@ ucs_status_t opal_common_ucx_wait_request(ucs_status_ptr_t request, ucp_worker_h
|
||||
ucp_tag_recv_info_t info;
|
||||
#endif
|
||||
|
||||
/* check for request completed or failed */
|
||||
if (OPAL_LIKELY(UCS_OK == request)) {
|
||||
return UCS_OK;
|
||||
} else if (OPAL_UNLIKELY(UCS_PTR_IS_ERR(request))) {
|
||||
return UCS_PTR_STATUS(request);
|
||||
}
|
||||
|
||||
while (1) {
|
||||
/* call UCX progress */
|
||||
for (i = 0; i < opal_common_ucx_progress_iterations; i++) {
|
||||
@ -66,6 +60,33 @@ ucs_status_t opal_common_ucx_wait_request(ucs_status_ptr_t request, ucp_worker_h
|
||||
}
|
||||
}
|
||||
|
||||
static inline
|
||||
int opal_common_ucx_wait_request_opal_status(ucs_status_ptr_t request, ucp_worker_h worker)
|
||||
{
|
||||
/* check for request completed or failed */
|
||||
if (OPAL_LIKELY(UCS_OK == request)) {
|
||||
return OPAL_SUCCESS;
|
||||
} else if (OPAL_UNLIKELY(UCS_PTR_IS_ERR(request))) {
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
|
||||
return opal_common_ucx_wait_request_internal(request, worker) == UCS_OK ?
|
||||
OPAL_SUCCESS : OPAL_ERROR;
|
||||
}
|
||||
|
||||
static inline
|
||||
ucs_status_t opal_common_ucx_wait_request(ucs_status_ptr_t request, ucp_worker_h worker)
|
||||
{
|
||||
/* check for request completed or failed */
|
||||
if (OPAL_LIKELY(UCS_OK == request)) {
|
||||
return UCS_OK;
|
||||
} else if (OPAL_UNLIKELY(UCS_PTR_IS_ERR(request))) {
|
||||
return UCS_PTR_STATUS(request);
|
||||
}
|
||||
|
||||
return opal_common_ucx_wait_request_internal(request, worker);
|
||||
}
|
||||
|
||||
static inline
|
||||
ucs_status_t opal_common_ucx_ep_flush(ucp_ep_h ep, ucp_worker_h worker)
|
||||
{
|
||||
|
@ -87,23 +87,23 @@ struct mca_atomic_base_module_1_0_0_t {
|
||||
|
||||
/* Collective function pointers */
|
||||
int (*atomic_add)(void *target,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe);
|
||||
int (*atomic_fadd)(void *target,
|
||||
void *prev,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe);
|
||||
int (*atomic_swap)(void *target,
|
||||
void *prev,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe);
|
||||
int (*atomic_cswap)(void *target,
|
||||
void *prev,
|
||||
const void *cond,
|
||||
const void *value,
|
||||
uint64_t cond,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe);
|
||||
};
|
||||
|
@ -38,8 +38,8 @@ mca_atomic_basic_query(int *priority);
|
||||
|
||||
int mca_atomic_basic_cswap(void *target,
|
||||
void *prev,
|
||||
const void *cond,
|
||||
const void *value,
|
||||
uint64_t cond,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe);
|
||||
|
||||
|
@ -20,8 +20,8 @@
|
||||
|
||||
int mca_atomic_basic_cswap(void *target,
|
||||
void *prev,
|
||||
const void *cond,
|
||||
const void *value,
|
||||
uint64_t cond,
|
||||
uint64_t value,
|
||||
size_t nlong,
|
||||
int pe)
|
||||
{
|
||||
@ -36,8 +36,8 @@ int mca_atomic_basic_cswap(void *target,
|
||||
|
||||
rc = MCA_SPML_CALL(get(target, nlong, prev, pe));
|
||||
|
||||
if ((rc == OSHMEM_SUCCESS) && (!cond || !memcmp(prev, cond, nlong))) {
|
||||
rc = MCA_SPML_CALL(put(target, nlong, (void*)value, pe));
|
||||
if ((rc == OSHMEM_SUCCESS) && (!cond || !memcmp(prev, &cond, nlong))) {
|
||||
rc = MCA_SPML_CALL(put(target, nlong, (void*)&value, pe));
|
||||
shmem_quiet();
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ int mca_atomic_basic_finalize(void)
|
||||
static inline
|
||||
int mca_atomic_basic_fop(void *target,
|
||||
void *prev,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe,
|
||||
struct oshmem_op_t *op)
|
||||
@ -110,8 +110,8 @@ int mca_atomic_basic_fop(void *target,
|
||||
memcpy(prev, (void*) &temp_value, size);
|
||||
|
||||
op->o_func.c_fn((void*) value,
|
||||
(void*) &temp_value,
|
||||
size / op->dt_size);
|
||||
(void*) &temp_value,
|
||||
size / op->dt_size);
|
||||
|
||||
if (rc == OSHMEM_SUCCESS) {
|
||||
rc = MCA_SPML_CALL(put(target, size, (void*)&temp_value, pe));
|
||||
@ -125,7 +125,7 @@ int mca_atomic_basic_fop(void *target,
|
||||
|
||||
static inline
|
||||
int mca_atomic_basic_op(void *target,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe,
|
||||
struct oshmem_op_t *op)
|
||||
@ -135,21 +135,21 @@ int mca_atomic_basic_op(void *target,
|
||||
return mca_atomic_basic_fop(target, &prev, value, size, pe, op);
|
||||
}
|
||||
|
||||
static int mca_atomic_basic_add(void *target, const void *value,
|
||||
static int mca_atomic_basic_add(void *target, uint64_t value,
|
||||
size_t size, int pe)
|
||||
{
|
||||
return mca_atomic_basic_op(target, value, size, pe,
|
||||
MCA_BASIC_OP(size, oshmem_op_sum_int32, oshmem_op_sum_int64));
|
||||
}
|
||||
|
||||
static int mca_atomic_basic_fadd(void *target, void *prev, const void *value,
|
||||
static int mca_atomic_basic_fadd(void *target, void *prev, uint64_t value,
|
||||
size_t size, int pe)
|
||||
{
|
||||
return mca_atomic_basic_fop(target, prev, value, size, pe,
|
||||
MCA_BASIC_OP(size, oshmem_op_sum_int32, oshmem_op_sum_int64));
|
||||
}
|
||||
|
||||
static int mca_atomic_basic_swap(void *target, void *prev, const void *value,
|
||||
static int mca_atomic_basic_swap(void *target, void *prev, uint64_t value,
|
||||
size_t size, int pe)
|
||||
{
|
||||
return mca_atomic_basic_fop(target, prev, value, size, pe,
|
||||
|
@ -43,23 +43,23 @@ mca_atomic_base_module_t*
|
||||
mca_atomic_mxm_query(int *priority);
|
||||
|
||||
int mca_atomic_mxm_add(void *target,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t nlong,
|
||||
int pe);
|
||||
int mca_atomic_mxm_fadd(void *target,
|
||||
void *prev,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t nlong,
|
||||
int pe);
|
||||
int mca_atomic_mxm_swap(void *target,
|
||||
void *prev,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t nlong,
|
||||
int pe);
|
||||
int mca_atomic_mxm_cswap(void *target,
|
||||
void *prev,
|
||||
const void *cond,
|
||||
const void *value,
|
||||
uint64_t cond,
|
||||
uint64_t value,
|
||||
size_t nlong,
|
||||
int pe);
|
||||
|
||||
|
@ -26,14 +26,14 @@
|
||||
|
||||
int mca_atomic_mxm_swap(void *target,
|
||||
void *prev,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t nlong,
|
||||
int pe)
|
||||
{
|
||||
mxm_send_req_t sreq;
|
||||
|
||||
mca_atomic_mxm_req_init(&sreq, pe, target, nlong);
|
||||
memcpy(prev, value, nlong);
|
||||
memcpy(prev, &value, nlong);
|
||||
|
||||
sreq.base.data.buffer.ptr = prev;
|
||||
sreq.opcode = MXM_REQ_OP_ATOMIC_SWAP;
|
||||
@ -45,18 +45,17 @@ int mca_atomic_mxm_swap(void *target,
|
||||
|
||||
int mca_atomic_mxm_cswap(void *target,
|
||||
void *prev,
|
||||
const void *cond,
|
||||
const void *value,
|
||||
uint64_t cond,
|
||||
uint64_t value,
|
||||
size_t nlong,
|
||||
int pe)
|
||||
{
|
||||
mxm_send_req_t sreq;
|
||||
|
||||
mca_atomic_mxm_req_init(&sreq, pe, target, nlong);
|
||||
memcpy(prev, value, nlong);
|
||||
|
||||
memcpy(&sreq.op.atomic.value, cond, nlong);
|
||||
memcpy(prev, &value, nlong);
|
||||
|
||||
sreq.op.atomic.value = value;
|
||||
sreq.base.data.buffer.ptr = prev;
|
||||
sreq.opcode = MXM_REQ_OP_ATOMIC_CSWAP;
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "atomic_mxm.h"
|
||||
|
||||
int mca_atomic_mxm_add(void *target,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe)
|
||||
{
|
||||
@ -35,8 +35,7 @@ int mca_atomic_mxm_add(void *target,
|
||||
|
||||
mca_atomic_mxm_req_init(&sreq, pe, target, size);
|
||||
|
||||
memcpy(&sreq.op.atomic.value, value, size);
|
||||
|
||||
sreq.op.atomic.value = value;
|
||||
sreq.opcode = MXM_REQ_OP_ATOMIC_FADD;
|
||||
sreq.base.data.buffer.ptr = dummy_buf;
|
||||
|
||||
@ -47,7 +46,7 @@ int mca_atomic_mxm_add(void *target,
|
||||
|
||||
int mca_atomic_mxm_fadd(void *target,
|
||||
void *prev,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe)
|
||||
{
|
||||
@ -55,8 +54,7 @@ int mca_atomic_mxm_fadd(void *target,
|
||||
|
||||
mca_atomic_mxm_req_init(&sreq, pe, target, size);
|
||||
|
||||
memcpy(&sreq.op.atomic.value, value, size);
|
||||
|
||||
sreq.op.atomic.value = value;
|
||||
sreq.opcode = MXM_REQ_OP_ATOMIC_FADD;
|
||||
sreq.base.data.buffer.ptr = prev;
|
||||
|
||||
|
@ -44,8 +44,8 @@ mca_atomic_ucx_query(int *priority);
|
||||
|
||||
int mca_atomic_ucx_cswap(void *target,
|
||||
void *prev,
|
||||
const void *cond,
|
||||
const void *value,
|
||||
uint64_t cond,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe);
|
||||
|
||||
|
@ -24,42 +24,39 @@
|
||||
static inline
|
||||
int mca_atomic_ucx_cswap_inner(void *target,
|
||||
void *prev,
|
||||
const void *cond,
|
||||
const void *value,
|
||||
uint64_t cond,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe)
|
||||
{
|
||||
ucs_status_t status;
|
||||
int status;
|
||||
ucs_status_ptr_t status_ptr;
|
||||
spml_ucx_mkey_t *ucx_mkey;
|
||||
uint64_t rva;
|
||||
uint64_t val;
|
||||
uint64_t cmp;
|
||||
|
||||
val = (sizeof(uint32_t) == size) ? *(uint32_t*)value : *(uint64_t*)value;
|
||||
cmp = (sizeof(uint32_t) == size) ? *(uint32_t*)cond : *(uint64_t*)cond;
|
||||
val = value;
|
||||
ucx_mkey = mca_spml_ucx_get_mkey(pe, target, (void *)&rva);
|
||||
status_ptr = ucp_atomic_fetch_nb(mca_spml_self->ucp_peers[pe].ucp_conn,
|
||||
UCP_ATOMIC_FETCH_OP_CSWAP, cmp, &val, size,
|
||||
UCP_ATOMIC_FETCH_OP_CSWAP, cond, &val, size,
|
||||
rva, ucx_mkey->rkey,
|
||||
opal_common_ucx_empty_complete_cb);
|
||||
status = opal_common_ucx_wait_request(status_ptr, mca_spml_self->ucp_worker);
|
||||
if (UCS_OK == status) {
|
||||
status = opal_common_ucx_wait_request_opal_status(status_ptr, mca_spml_self->ucp_worker);
|
||||
if (OPAL_SUCCESS == status) {
|
||||
assert(NULL != prev);
|
||||
memcpy(prev, &val, size);
|
||||
if (sizeof(uint32_t) == size) {
|
||||
*(uint32_t*)prev = val;
|
||||
} else {
|
||||
*(uint64_t*)prev = val;
|
||||
}
|
||||
}
|
||||
return ucx_status_to_oshmem(status);
|
||||
return status;
|
||||
}
|
||||
|
||||
int mca_atomic_ucx_cswap(void *target,
|
||||
void *prev,
|
||||
const void *cond,
|
||||
const void *value,
|
||||
uint64_t cond,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe)
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ int mca_atomic_ucx_finalize(void)
|
||||
|
||||
static inline
|
||||
int mca_atomic_ucx_op(void *target,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe,
|
||||
ucp_atomic_post_op_t op)
|
||||
@ -45,18 +45,14 @@ int mca_atomic_ucx_op(void *target,
|
||||
uint64_t rva;
|
||||
uint64_t val;
|
||||
|
||||
if (8 == size) {
|
||||
val = *(uint64_t*)value;
|
||||
} else if (4 == size) {
|
||||
val = *(uint32_t*)value;
|
||||
} else {
|
||||
if ((8 != size) && (4 != size)) {
|
||||
ATOMIC_ERROR("[#%d] Type size must be 4 or 8 bytes.", my_pe);
|
||||
return OSHMEM_ERROR;
|
||||
}
|
||||
|
||||
ucx_mkey = mca_spml_ucx_get_mkey(pe, target, (void *)&rva);
|
||||
status = ucp_atomic_post(mca_spml_self->ucp_peers[pe].ucp_conn,
|
||||
op, val, size, rva,
|
||||
op, value, size, rva,
|
||||
ucx_mkey->rkey);
|
||||
return ucx_status_to_oshmem(status);
|
||||
}
|
||||
@ -64,7 +60,7 @@ int mca_atomic_ucx_op(void *target,
|
||||
static inline
|
||||
int mca_atomic_ucx_fop(void *target,
|
||||
void *prev,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe,
|
||||
ucp_atomic_fetch_op_t op)
|
||||
@ -73,29 +69,22 @@ int mca_atomic_ucx_fop(void *target,
|
||||
ucs_status_ptr_t status_ptr;
|
||||
spml_ucx_mkey_t *ucx_mkey;
|
||||
uint64_t rva;
|
||||
uint64_t val;
|
||||
|
||||
if (8 == size) {
|
||||
val = *(uint64_t*)value;
|
||||
} else if (4 == size) {
|
||||
val = *(uint32_t*)value;
|
||||
} else {
|
||||
if ((8 != size) && (4 != size)) {
|
||||
ATOMIC_ERROR("[#%d] Type size must be 4 or 8 bytes.", my_pe);
|
||||
return OSHMEM_ERROR;
|
||||
}
|
||||
|
||||
ucx_mkey = mca_spml_ucx_get_mkey(pe, target, (void *)&rva);
|
||||
status_ptr = ucp_atomic_fetch_nb(mca_spml_self->ucp_peers[pe].ucp_conn,
|
||||
op, val, prev, size,
|
||||
op, value, prev, size,
|
||||
rva, ucx_mkey->rkey,
|
||||
opal_common_ucx_empty_complete_cb);
|
||||
status = opal_common_ucx_wait_request(status_ptr, mca_spml_self->ucp_worker);
|
||||
|
||||
return ucx_status_to_oshmem(status);
|
||||
return opal_common_ucx_wait_request_opal_status(status_ptr, mca_spml_self->ucp_worker);
|
||||
}
|
||||
|
||||
static int mca_atomic_ucx_add(void *target,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe)
|
||||
{
|
||||
@ -104,7 +93,7 @@ static int mca_atomic_ucx_add(void *target,
|
||||
|
||||
static int mca_atomic_ucx_fadd(void *target,
|
||||
void *prev,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe)
|
||||
{
|
||||
@ -113,7 +102,7 @@ static int mca_atomic_ucx_fadd(void *target,
|
||||
|
||||
static int mca_atomic_ucx_swap(void *target,
|
||||
void *prev,
|
||||
const void *value,
|
||||
uint64_t value,
|
||||
size_t size,
|
||||
int pe)
|
||||
{
|
||||
|
@ -35,7 +35,7 @@
|
||||
size = sizeof(value); \
|
||||
rc = MCA_ATOMIC_CALL(add( \
|
||||
(void*)target, \
|
||||
(const void*)&value, \
|
||||
value, \
|
||||
size, \
|
||||
pe)); \
|
||||
RUNTIME_CHECK_RC(rc); \
|
||||
|
@ -39,8 +39,8 @@
|
||||
rc = MCA_ATOMIC_CALL(cswap( \
|
||||
(void*)target, \
|
||||
(void*)&out_value, \
|
||||
(const void*)&cond, \
|
||||
(const void*)&value, \
|
||||
cond, \
|
||||
value, \
|
||||
size, \
|
||||
pe)); \
|
||||
RUNTIME_CHECK_RC(rc); \
|
||||
|
@ -39,7 +39,7 @@
|
||||
rc = MCA_ATOMIC_CALL(fadd( \
|
||||
(void*)target, \
|
||||
(void*)&out_value, \
|
||||
(const void*)&value, \
|
||||
value, \
|
||||
size, \
|
||||
pe)); \
|
||||
RUNTIME_CHECK_RC(rc); \
|
||||
|
@ -39,7 +39,7 @@
|
||||
rc = MCA_ATOMIC_CALL(fadd( \
|
||||
(void*)target, \
|
||||
(void*)&out_value, \
|
||||
(const void*)&value, \
|
||||
value, \
|
||||
size, \
|
||||
pe)); \
|
||||
RUNTIME_CHECK_RC(rc); \
|
||||
|
@ -40,7 +40,7 @@
|
||||
rc = MCA_ATOMIC_CALL(fadd( \
|
||||
(void*)target, \
|
||||
(void*)&out_value, \
|
||||
(const void*)&value, \
|
||||
value, \
|
||||
size, \
|
||||
pe)); \
|
||||
RUNTIME_CHECK_RC(rc); \
|
||||
|
@ -37,7 +37,7 @@
|
||||
size = sizeof(value); \
|
||||
rc = MCA_ATOMIC_CALL(add( \
|
||||
(void*)target, \
|
||||
(const void*)&value, \
|
||||
value, \
|
||||
size, \
|
||||
pe)); \
|
||||
RUNTIME_CHECK_RC(rc); \
|
||||
|
@ -269,13 +269,13 @@ static uint64_t shmem_lock_cswap(void *target,
|
||||
uint64_t prev_value = 0;
|
||||
|
||||
if (target_size == 8) {
|
||||
MCA_ATOMIC_CALL(cswap( target, (void*)&prev_value, (const void*)&cond, (const void*)&value, target_size, pe));
|
||||
MCA_ATOMIC_CALL(cswap( target, (void*)&prev_value, cond, value, target_size, pe));
|
||||
} else if (target_size == 4) {
|
||||
uint32_t prev_value_32 = 0;
|
||||
uint32_t cond32 = (uint32_t) cond;
|
||||
uint32_t value32 = (uint32_t) value;
|
||||
|
||||
MCA_ATOMIC_CALL(cswap( target, (void*)&prev_value_32, (const void*)&cond32, (const void*)&value32, target_size, pe));
|
||||
MCA_ATOMIC_CALL(cswap( target, (void*)&prev_value_32, cond32, value32, target_size, pe));
|
||||
|
||||
prev_value = prev_value_32;
|
||||
}
|
||||
|
@ -34,11 +34,10 @@
|
||||
RUNTIME_CHECK_ADDR(target); \
|
||||
\
|
||||
size = sizeof(out_value); \
|
||||
rc = MCA_ATOMIC_CALL(cswap( \
|
||||
rc = MCA_ATOMIC_CALL(swap( \
|
||||
(void*)target, \
|
||||
(void*)&out_value, \
|
||||
NULL, \
|
||||
(const void*)&value, \
|
||||
value, \
|
||||
size, \
|
||||
pe)); \
|
||||
RUNTIME_CHECK_RC(rc); \
|
||||
|
@ -37,7 +37,7 @@
|
||||
rc = MCA_ATOMIC_CALL(swap( \
|
||||
(void*)target, \
|
||||
(void*)&out_value, \
|
||||
(const void*)&value, \
|
||||
value, \
|
||||
size, \
|
||||
pe)); \
|
||||
RUNTIME_CHECK_RC(rc); \
|
||||
|
@ -37,4 +37,6 @@ ret upper_case signature {wrapper_function params; } \
|
||||
ret single_underscore signature {wrapper_function params; } \
|
||||
ret double_underscore signature {wrapper_function params; }
|
||||
|
||||
#define FPTR_2_INT(ptr, size) ((size) == sizeof(uint64_t) ? *(uint64_t*)(ptr) : *(uint32_t*)(ptr))
|
||||
|
||||
#endif /*SHMEM_FORTRAN_BINDINGS_H*/
|
||||
|
@ -36,7 +36,7 @@ SHMEM_GENERATE_FORTRAN_BINDINGS_SUB (void,
|
||||
void shmem_int4_add_f(FORTRAN_POINTER_T target, FORTRAN_POINTER_T value, MPI_Fint *pe)
|
||||
{
|
||||
MCA_ATOMIC_CALL(add(FPTR_2_VOID_PTR(target),
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(value, sizeof(ompi_fortran_integer4_t)),
|
||||
sizeof(ompi_fortran_integer4_t),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ ompi_fortran_integer4_t shmem_int4_cswap_f(FORTRAN_POINTER_T target, MPI_Fint *c
|
||||
|
||||
MCA_ATOMIC_CALL(cswap(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
(const void*)(OMPI_PFINT_2_PINT(cond)),
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(cond, sizeof(out_value)),
|
||||
FPTR_2_INT(value, sizeof(out_value)),
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -39,7 +39,7 @@ ompi_fortran_integer4_t shmem_int4_fadd_f(FORTRAN_POINTER_T target, FORTRAN_POIN
|
||||
|
||||
MCA_ATOMIC_CALL(fadd(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(value, sizeof(out_value)),
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -39,7 +39,7 @@ ompi_fortran_integer4_t shmem_int4_fetch_f(FORTRAN_POINTER_T target, MPI_Fint *p
|
||||
|
||||
MCA_ATOMIC_CALL(fadd(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
(const void *)&value,
|
||||
value,
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -40,7 +40,7 @@ ompi_fortran_integer4_t shmem_int4_finc_f(FORTRAN_POINTER_T target, MPI_Fint *pe
|
||||
|
||||
MCA_ATOMIC_CALL(fadd(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
(const void*)&value,
|
||||
value,
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -38,7 +38,7 @@ void shmem_int4_inc_f(FORTRAN_POINTER_T target, MPI_Fint *pe)
|
||||
ompi_fortran_integer4_t value = 1;
|
||||
|
||||
MCA_ATOMIC_CALL(add(FPTR_2_VOID_PTR(target),
|
||||
(const void*)&value,
|
||||
value,
|
||||
sizeof(value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
}
|
||||
|
@ -35,10 +35,9 @@ void shmem_int4_set_f(FORTRAN_POINTER_T target, FORTRAN_POINTER_T value, MPI_Fi
|
||||
{
|
||||
ompi_fortran_integer4_t out_value = 0;
|
||||
|
||||
MCA_ATOMIC_CALL(cswap(FPTR_2_VOID_PTR(target),
|
||||
MCA_ATOMIC_CALL(swap(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
NULL,
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(value, sizeof(out_value)),
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
}
|
||||
|
@ -36,10 +36,9 @@ ompi_fortran_integer4_t shmem_int4_swap_f(FORTRAN_POINTER_T target, FORTRAN_POIN
|
||||
{
|
||||
ompi_fortran_integer4_t out_value = 0;
|
||||
|
||||
MCA_ATOMIC_CALL(cswap(FPTR_2_VOID_PTR(target),
|
||||
MCA_ATOMIC_CALL(swap(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
NULL,
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(value, sizeof(out_value)),
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -36,7 +36,7 @@ SHMEM_GENERATE_FORTRAN_BINDINGS_SUB (void,
|
||||
void shmem_int8_add_f(FORTRAN_POINTER_T target, FORTRAN_POINTER_T value, MPI_Fint *pe)
|
||||
{
|
||||
MCA_ATOMIC_CALL(add(FPTR_2_VOID_PTR(target),
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(value, sizeof(ompi_fortran_integer8_t)),
|
||||
sizeof(value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ ompi_fortran_integer8_t shmem_int8_cswap_f(FORTRAN_POINTER_T target, MPI_Fint *c
|
||||
|
||||
MCA_ATOMIC_CALL(cswap(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
(const void*)(OMPI_PFINT_2_PINT(cond)),
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(cond, sizeof(out_value)),
|
||||
FPTR_2_INT(value, sizeof(out_value)),
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -39,7 +39,7 @@ ompi_fortran_integer8_t shmem_int8_fadd_f(FORTRAN_POINTER_T target, FORTRAN_POIN
|
||||
|
||||
MCA_ATOMIC_CALL(fadd(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(value, sizeof(out_value)),
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -39,7 +39,7 @@ ompi_fortran_integer8_t shmem_int8_fetch_f(FORTRAN_POINTER_T target, MPI_Fint *p
|
||||
|
||||
MCA_ATOMIC_CALL(fadd(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
(const void *)&value,
|
||||
value,
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -40,7 +40,7 @@ ompi_fortran_integer8_t shmem_int8_finc_f(FORTRAN_POINTER_T target, MPI_Fint *pe
|
||||
|
||||
MCA_ATOMIC_CALL(fadd(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
(const void*)&value,
|
||||
value,
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -38,7 +38,7 @@ void shmem_int8_inc_f(FORTRAN_POINTER_T target, MPI_Fint *pe)
|
||||
ompi_fortran_integer8_t value = 1;
|
||||
|
||||
MCA_ATOMIC_CALL(add(FPTR_2_VOID_PTR(target),
|
||||
(const void*)&value,
|
||||
value,
|
||||
sizeof(value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
}
|
||||
|
@ -35,10 +35,9 @@ void shmem_int8_set_f(FORTRAN_POINTER_T target, FORTRAN_POINTER_T value, MPI_Fin
|
||||
{
|
||||
ompi_fortran_integer8_t out_value = 0;
|
||||
|
||||
MCA_ATOMIC_CALL(cswap(FPTR_2_VOID_PTR(target),
|
||||
MCA_ATOMIC_CALL(swap(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
NULL,
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(value, sizeof(out_value)),
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
}
|
||||
|
@ -36,10 +36,9 @@ ompi_fortran_integer8_t shmem_int8_swap_f(FORTRAN_POINTER_T target, FORTRAN_POIN
|
||||
{
|
||||
ompi_fortran_integer8_t out_value = 0;
|
||||
|
||||
MCA_ATOMIC_CALL(cswap(FPTR_2_VOID_PTR(target),
|
||||
MCA_ATOMIC_CALL(swap(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
NULL,
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(value, sizeof(out_value)),
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -38,7 +38,7 @@ ompi_fortran_real4_t shmem_real4_fetch_f(FORTRAN_POINTER_T target, MPI_Fint *pe)
|
||||
|
||||
MCA_ATOMIC_CALL(fadd(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
(const void *)&value,
|
||||
value,
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -35,10 +35,9 @@ void shmem_real4_set_f(FORTRAN_POINTER_T target, FORTRAN_POINTER_T value, MPI_Fi
|
||||
{
|
||||
ompi_fortran_real4_t out_value = 0;
|
||||
|
||||
MCA_ATOMIC_CALL(cswap(FPTR_2_VOID_PTR(target),
|
||||
MCA_ATOMIC_CALL(swap(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
NULL,
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(value, sizeof(out_value)),
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -36,10 +36,9 @@ ompi_fortran_real4_t shmem_real4_swap_f(FORTRAN_POINTER_T target, FORTRAN_POINTE
|
||||
{
|
||||
ompi_fortran_real4_t out_value = 0;
|
||||
|
||||
MCA_ATOMIC_CALL(cswap(FPTR_2_VOID_PTR(target),
|
||||
MCA_ATOMIC_CALL(swap(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
NULL,
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(value, sizeof(out_value)),
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -39,7 +39,7 @@ ompi_fortran_real8_t shmem_real8_fetch_f(FORTRAN_POINTER_T target, MPI_Fint *pe)
|
||||
|
||||
MCA_ATOMIC_CALL(fadd(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
(const void *)&value,
|
||||
value,
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -35,10 +35,9 @@ void shmem_real8_set_f(FORTRAN_POINTER_T target, FORTRAN_POINTER_T value, MPI_Fi
|
||||
{
|
||||
ompi_fortran_real8_t out_value = 0;
|
||||
|
||||
MCA_ATOMIC_CALL(cswap(FPTR_2_VOID_PTR(target),
|
||||
MCA_ATOMIC_CALL(swap(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
NULL,
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(value, sizeof(out_value)),
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
}
|
||||
|
@ -36,10 +36,9 @@ ompi_fortran_real8_t shmem_real8_swap_f(FORTRAN_POINTER_T target, FORTRAN_POINTE
|
||||
{
|
||||
ompi_fortran_real8_t out_value = 0;
|
||||
|
||||
MCA_ATOMIC_CALL(cswap(FPTR_2_VOID_PTR(target),
|
||||
MCA_ATOMIC_CALL(swap(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
NULL,
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(value, sizeof(out_value)),
|
||||
sizeof(out_value),
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
@ -38,10 +38,9 @@ MPI_Fint shmem_swap_f(FORTRAN_POINTER_T target, FORTRAN_POINTER_T value, MPI_Fin
|
||||
MPI_Fint out_value = 0;
|
||||
ompi_datatype_type_size(&ompi_mpi_integer.dt, &integer_type_size);
|
||||
|
||||
MCA_ATOMIC_CALL(cswap(FPTR_2_VOID_PTR(target),
|
||||
MCA_ATOMIC_CALL(swap(FPTR_2_VOID_PTR(target),
|
||||
(void *)&out_value,
|
||||
NULL,
|
||||
FPTR_2_VOID_PTR(value),
|
||||
FPTR_2_INT(value, integer_type_size),
|
||||
integer_type_size,
|
||||
OMPI_FINT_2_INT(*pe)));
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user