Skip to content

Commit a55eb5e

Browse files
committed
Merge pull request #602 from jithinjosepkl/pr/pml-cm-opt
Optimizations to PML-CM
2 parents 8bb0082 + 5ba5a9a commit a55eb5e

File tree

12 files changed

+664
-589
lines changed

12 files changed

+664
-589
lines changed

ompi/mca/mtl/base/mtl_base_datatype.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ ompi_mtl_datatype_pack(struct opal_convertor_t *convertor,
3838
struct iovec iov;
3939
uint32_t iov_count = 1;
4040

41+
#if !(OPAL_ENABLE_HETEROGENEOUS_SUPPORT)
42+
if (convertor->pDesc &&
43+
opal_datatype_is_contiguous_memory_layout(convertor->pDesc,
44+
convertor->count)) {
45+
*freeAfter = false;
46+
*buffer = convertor->pBaseBuf;
47+
*buffer_len = convertor->local_size;
48+
return OPAL_SUCCESS;
49+
}
50+
#endif
51+
4152
opal_convertor_get_packed_size(convertor, buffer_len);
4253
*freeAfter = false;
4354
if( 0 == *buffer_len ) {

ompi/mca/mtl/mtl.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "ompi_config.h"
4040
#include "mpi.h" /* needed for MPI_ANY_TAG */
4141
#include "ompi/mca/mca.h"
42-
#include "ompi/mca/pml/pml.h" /* for send_mode enum */
42+
#include "ompi/mca/pml/pml_constants.h" /* for send_mode enum */
4343
#include "ompi/request/request.h"
4444

4545
BEGIN_C_DECLS
@@ -425,22 +425,24 @@ typedef struct mca_mtl_base_module_t mca_mtl_base_module_t;
425425
#define MCA_MTL_BASE_VERSION_2_0_0 \
426426
OMPI_MCA_BASE_VERSION_2_1_0("mtl", 2, 0, 0)
427427

428+
OMPI_DECLSPEC extern mca_mtl_base_module_t *ompi_mtl;
429+
428430
/*
429431
* macro for doing direct call / call through struct
430432
*/
431433
#if MCA_ompi_mtl_DIRECT_CALL
432434

433-
#include MCA_ompi_mtl_DIRECT_CALL_HEADER
434435

435436
#define OMPI_MTL_CALL_STAMP(a, b) ompi_mtl_ ## a ## _ ## b
436437
#define OMPI_MTL_CALL_EXPANDER(a, b) OMPI_MTL_CALL_STAMP(a,b)
437438
#define OMPI_MTL_CALL(a) OMPI_MTL_CALL_EXPANDER(MCA_ompi_mtl_DIRECT_CALL_COMPONENT, a)
438439

440+
#include MCA_ompi_mtl_DIRECT_CALL_HEADER
441+
439442
#else
440443
#define OMPI_MTL_CALL(a) ompi_mtl->mtl_ ## a
441444
#endif
442445

443-
OMPI_DECLSPEC extern mca_mtl_base_module_t *ompi_mtl;
444446

445447
END_C_DECLS
446448
#endif

ompi/mca/mtl/mxm/mtl_mxm_send.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ static inline __opal_attribute_always_inline__ int
5757

5858
size_t *buffer_len = &mxm_send_req->base.data.buffer.length;
5959

60+
#if !(OPAL_ENABLE_HETEROGENEOUS_SUPPORT)
61+
if (convertor->pDesc &&
62+
opal_datatype_is_contiguous_memory_layout(convertor->pDesc,
63+
convertor->count)) {
64+
mxm_send_req->base.data.buffer.ptr = convertor->pBaseBuf;
65+
mxm_send_req->base.data.buffer.length = convertor->local_size;
66+
mxm_send_req->base.data_type = MXM_REQ_DATA_BUFFER;
67+
return OMPI_SUCCESS;
68+
}
69+
#endif
70+
6071
opal_convertor_get_packed_size(convertor, buffer_len);
6172
if (0 == *buffer_len) {
6273
mxm_send_req->base.data.buffer.ptr = NULL;

ompi/mca/pml/cm/Makefile.am

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,10 @@ local_sources = \
3131
pml_cm_cancel.c \
3232
pml_cm_component.c \
3333
pml_cm_component.h \
34-
pml_cm_probe.c \
35-
pml_cm_recv.c \
3634
pml_cm_recvreq.h \
3735
pml_cm_recvreq.c \
3836
pml_cm_request.h \
3937
pml_cm_request.c \
40-
pml_cm_send.c \
4138
pml_cm_sendreq.h \
4239
pml_cm_sendreq.c \
4340
pml_cm_start.c

0 commit comments

Comments
 (0)