Skip to content

Commit 17b723b

Browse files
authored
Merge pull request #8906 from hppritcha/topic/swat_issue_8905
pml/cm: fix a problem introduced with cuda support
2 parents e8857f0 + 9e99182 commit 17b723b

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

ompi/mca/pml/cm/pml_cm_sendreq.h

+13-8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Copyright (c) 2015 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
1717
* Copyright (c) 2017 Intel, Inc. All rights reserved
18+
* Copyright (c) 2021 Triad National Security, LLC. All rights
19+
* reserved.
1820
* $COPYRIGHT$
1921
*
2022
* Additional copyrights may follow
@@ -31,6 +33,7 @@
3133
#include "ompi/mca/pml/pml.h"
3234
#include "ompi/mca/mtl/mtl.h"
3335
#include "opal/prefetch.h"
36+
#include "opal/runtime/opal_params.h"
3437

3538
struct mca_pml_cm_send_request_t {
3639
mca_pml_cm_request_t req_base;
@@ -242,14 +245,16 @@ do { \
242245
(unsigned char*)buf + datatype->super.true_lb; \
243246
(req_send)->req_base.req_convertor.count = count; \
244247
(req_send)->req_base.req_convertor.pDesc = &datatype->super; \
245-
/* Switches off CUDA detection if \
246-
MTL set MCA_MTL_BASE_FLAG_CUDA_INIT_DISABLE during init */ \
247-
MCA_PML_CM_SWITCH_CUDA_CONVERTOR_OFF(flags, datatype, count); \
248-
(req_send)->req_base.req_convertor.flags |= flags; \
249-
/* Sets CONVERTOR_CUDA flag if CUDA buffer */ \
250-
opal_convertor_prepare_for_send( \
251-
&req_send->req_base.req_convertor, \
252-
&datatype->super, count, buf ); \
248+
if (opal_built_with_cuda_support) { \
249+
/* Switches off CUDA detection if \
250+
MTL set MCA_MTL_BASE_FLAG_CUDA_INIT_DISABLE during init */ \
251+
MCA_PML_CM_SWITCH_CUDA_CONVERTOR_OFF(flags, datatype, count); \
252+
(req_send)->req_base.req_convertor.flags |= flags; \
253+
/* Sets CONVERTOR_CUDA flag if CUDA buffer */ \
254+
opal_convertor_prepare_for_send( \
255+
&req_send->req_base.req_convertor, \
256+
&datatype->super, count, buf ); \
257+
} \
253258
} else { \
254259
MCA_PML_CM_SWITCH_CUDA_CONVERTOR_OFF(flags, datatype, count); \
255260
opal_convertor_copy_and_prepare_for_send( \

0 commit comments

Comments
 (0)