Skip to content

Commit c0e0510

Browse files
committed
Merge pull request #698 from rolfv/pr/smcuda-ipc-perf-fix
Force smcuda BTL to use CUDA IPC path for all GPU buffers where possible
2 parents 8eede3c + cdffa47 commit c0e0510

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

opal/mca/btl/smcuda/btl_smcuda.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,13 @@ int mca_btl_smcuda_sendi( struct mca_btl_base_module_t* btl,
885885
if (mca_common_cuda_enabled && (IPC_INIT == endpoint->ipcstate) && mca_btl_smcuda_component.use_cuda_ipc) {
886886
mca_btl_smcuda_send_cuda_ipc_request(btl, endpoint);
887887
}
888+
/* We do not want to use this path when we have CUDA IPC support */
889+
if ((convertor->flags & CONVERTOR_CUDA) && (IPC_ACKED == endpoint->ipcstate)) {
890+
if (NULL != descriptor) {
891+
*descriptor = mca_btl_smcuda_alloc(btl, endpoint, order, payload_size+header_size, flags);
892+
}
893+
return OPAL_ERR_RESOURCE_BUSY;
894+
}
888895
#endif /* OPAL_CUDA_SUPPORT */
889896

890897
/* this check should be unnecessary... turn into an assertion? */

opal/mca/btl/smcuda/btl_smcuda_component.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ static int smcuda_register(void)
190190
if (0 == mca_btl_smcuda.super.btl_cuda_max_send_size) {
191191
mca_btl_smcuda.super.btl_cuda_max_send_size = 128*1024;
192192
}
193+
/* If user has not set the value, then set to magic number which will be converted to the minimum
194+
* size needed to fit the PML header (see pml_ob1.c) */
195+
if (0 == mca_btl_smcuda.super.btl_cuda_eager_limit) {
196+
mca_btl_smcuda.super.btl_cuda_eager_limit = SIZE_MAX; /* magic number */
197+
}
193198
#endif /* OPAL_CUDA_SUPPORT */
194199
return mca_btl_smcuda_component_verify();
195200
}

0 commit comments

Comments
 (0)