Various cleanups.
Этот коммит содержится в:
родитель
a4aa74d4b9
Коммит
a7a4d6335e
@ -79,7 +79,7 @@ int ompi_osc_base_process_op (void *outbuf, void *inbuf, size_t inbuflen,
|
|||||||
struct ompi_datatype_t *primitive_datatype = NULL;
|
struct ompi_datatype_t *primitive_datatype = NULL;
|
||||||
struct iovec iov[OMPI_OSC_BASE_DECODE_MAX];
|
struct iovec iov[OMPI_OSC_BASE_DECODE_MAX];
|
||||||
uint32_t iov_count;
|
uint32_t iov_count;
|
||||||
size_t max_data, size, primitive_size;
|
size_t size, primitive_size;
|
||||||
OPAL_PTRDIFF_TYPE lb, extent;
|
OPAL_PTRDIFF_TYPE lb, extent;
|
||||||
bool done;
|
bool done;
|
||||||
|
|
||||||
|
@ -1006,7 +1006,6 @@ mca_btl_base_registration_handle_t *mca_btl_sm_register_mem (struct mca_btl_base
|
|||||||
void *base, size_t size, uint32_t flags)
|
void *base, size_t size, uint32_t flags)
|
||||||
{
|
{
|
||||||
mca_btl_sm_registration_handle_t *handle;
|
mca_btl_sm_registration_handle_t *handle;
|
||||||
mca_btl_sm_t *sm_btl = (mca_btl_sm_t *) btl;
|
|
||||||
ompi_free_list_item_t *item = NULL;
|
ompi_free_list_item_t *item = NULL;
|
||||||
|
|
||||||
OMPI_FREE_LIST_GET_MT(&mca_btl_sm_component.registration_handles, item);
|
OMPI_FREE_LIST_GET_MT(&mca_btl_sm_component.registration_handles, item);
|
||||||
@ -1035,7 +1034,7 @@ mca_btl_base_registration_handle_t *mca_btl_sm_register_mem (struct mca_btl_base
|
|||||||
knem_cr.protection |= PROT_WRITE;
|
knem_cr.protection |= PROT_WRITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OPAL_UNLIKELY(ioctl(sm_btl->knem_fd, KNEM_CMD_CREATE_REGION, &knem_cr) < 0)) {
|
if (OPAL_UNLIKELY(ioctl(((mca_btl_sm_t*)btl)->knem_fd, KNEM_CMD_CREATE_REGION, &knem_cr) < 0)) {
|
||||||
OMPI_FREE_LIST_RETURN_MT(&mca_btl_sm_component.registration_handles, item);
|
OMPI_FREE_LIST_RETURN_MT(&mca_btl_sm_component.registration_handles, item);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -1058,11 +1057,10 @@ int mca_btl_sm_deregister_mem (struct mca_btl_base_module_t* btl, mca_btl_base_r
|
|||||||
{
|
{
|
||||||
mca_btl_sm_registration_handle_t *sm_handle =
|
mca_btl_sm_registration_handle_t *sm_handle =
|
||||||
(mca_btl_sm_registration_handle_t *)((intptr_t) handle - offsetof (mca_btl_sm_registration_handle_t, btl_handle));
|
(mca_btl_sm_registration_handle_t *)((intptr_t) handle - offsetof (mca_btl_sm_registration_handle_t, btl_handle));
|
||||||
mca_btl_sm_t* sm_btl = (mca_btl_sm_t*) btl;
|
|
||||||
|
|
||||||
#if OPAL_BTL_SM_HAVE_KNEM
|
#if OPAL_BTL_SM_HAVE_KNEM
|
||||||
if (OPAL_LIKELY(mca_btl_sm_component.use_knem)) {
|
if (OPAL_LIKELY(mca_btl_sm_component.use_knem)) {
|
||||||
(void) ioctl(sm_btl->knem_fd, KNEM_CMD_DESTROY_REGION, &handle->data.knem.cookie);
|
(void) ioctl(((mca_btl_sm_t*)btl)->knem_fd, KNEM_CMD_DESTROY_REGION, &handle->data.knem.cookie);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1123,7 +1121,7 @@ int mca_btl_sm_get_sync (mca_btl_base_module_t *btl, struct mca_btl_base_endpoin
|
|||||||
if (OPAL_LIKELY(mca_btl_sm_component.use_cma)) {
|
if (OPAL_LIKELY(mca_btl_sm_component.use_cma)) {
|
||||||
struct iovec local, remote;
|
struct iovec local, remote;
|
||||||
pid_t remote_pid;
|
pid_t remote_pid;
|
||||||
int val;
|
ssize_t val;
|
||||||
|
|
||||||
remote_pid = remote_handle->data.pid;
|
remote_pid = remote_handle->data.pid;
|
||||||
remote.iov_base = (void *) (intptr_t) remote_address;
|
remote.iov_base = (void *) (intptr_t) remote_address;
|
||||||
@ -1133,14 +1131,14 @@ int mca_btl_sm_get_sync (mca_btl_base_module_t *btl, struct mca_btl_base_endpoin
|
|||||||
|
|
||||||
val = process_vm_readv(remote_pid, &local, 1, &remote, 1, 0);
|
val = process_vm_readv(remote_pid, &local, 1, &remote, 1, 0);
|
||||||
|
|
||||||
if (val != size) {
|
if (val != (ssize_t)size) {
|
||||||
if (val<0) {
|
if (val < 0) {
|
||||||
opal_output(0, "mca_btl_sm_get_sync: process_vm_readv failed: %i",
|
opal_output(0, "mca_btl_sm_get_sync: process_vm_readv failed: %i",
|
||||||
errno);
|
errno);
|
||||||
} else {
|
} else {
|
||||||
/* Should never get a short read from process_vm_readv */
|
/* Should never get a short read from process_vm_readv */
|
||||||
opal_output(0, "mca_btl_sm_get_sync: process_vm_readv short read: %i",
|
opal_output(0, "mca_btl_sm_get_sync: process_vm_readv short read: %i",
|
||||||
val);
|
(int)val);
|
||||||
}
|
}
|
||||||
return OPAL_ERROR;
|
return OPAL_ERROR;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user