Skip to content

Commit 9118777

Browse files
committed
opal/ddt: use optimized description when packing contiguous datatypes
Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 32606ad commit 9118777

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

opal/datatype/opal_convertor.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,9 @@ size_t opal_convertor_compute_remote_size( opal_convertor_t* pConvertor )
481481
pConvertor->remote_size = pConvertor->local_size;
482482
if( OPAL_UNLIKELY(datatype->bdt_used & pConvertor->master->hetero_mask) ) {
483483
pConvertor->flags &= (~CONVERTOR_HOMOGENEOUS);
484-
pConvertor->use_desc = &(datatype->desc);
484+
if (!(pConvertor->flags & CONVERTOR_SEND && pConvertor->flags & OPAL_DATATYPE_FLAG_CONTIGUOUS)) {
485+
pConvertor->use_desc = &(datatype->desc);
486+
}
485487
if( 0 == (pConvertor->flags & CONVERTOR_HAS_REMOTE_SIZE) ) {
486488
/* This is for a single datatype, we must update it with the count */
487489
pConvertor->remote_size = opal_datatype_compute_remote_size(datatype,
@@ -570,6 +572,7 @@ int32_t opal_convertor_prepare_for_recv( opal_convertor_t* convertor,
570572
mca_cuda_convertor_init(convertor, pUserBuf);
571573
#endif
572574

575+
assert(! (convertor->flags & CONVERTOR_SEND));
573576
OPAL_CONVERTOR_PREPARE( convertor, datatype, count, pUserBuf );
574577

575578
if( convertor->flags & CONVERTOR_WITH_CHECKSUM ) {

opal/datatype/opal_convertor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ static inline void opal_convertor_get_unpacked_size( const opal_convertor_t* pCo
218218
return;
219219
}
220220
if( 0 == (CONVERTOR_HAS_REMOTE_SIZE & pConv->flags) ) {
221+
assert(! (pConv->flags & CONVERTOR_SEND));
221222
opal_convertor_compute_remote_size( (opal_convertor_t*)pConv);
222223
}
223224
*pSize = pConv->remote_size;

opal/datatype/opal_datatype_fake_stack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ int opal_convertor_create_stack_with_pos_general( opal_convertor_t* pConvertor,
9191
}
9292

9393
/* remove from the main loop all the complete datatypes */
94+
assert (! (pConvertor->flags & CONVERTOR_SEND));
9495
remote_size = opal_convertor_compute_remote_size( pConvertor );
9596
count = (int32_t)(starting_point / remote_size);
9697
resting_place -= (remote_size * count);

0 commit comments

Comments
 (0)