Skip to content

Fix/convertor raw #6898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ompi/mca/common/monitoring/common_monitoring.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void mca_common_monitoring_register(void*pml_monitoring_component)
&mca_common_monitoring_enabled);

mca_common_monitoring_current_state = mca_common_monitoring_enabled;

(void)mca_base_var_register("ompi", "pml", "monitoring", "enable_output",
"Enable the PML monitoring textual output at MPI_Finalize "
"(it will be automatically turned off when MPIT is used to "
Expand All @@ -280,7 +280,7 @@ void mca_common_monitoring_register(void*pml_monitoring_component)
MCA_BASE_VAR_FLAG_DWG, OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_common_monitoring_output_enabled);

(void)mca_base_var_register("ompi", "pml", "monitoring", "filename",
/*&mca_common_monitoring_component.pmlm_version, "filename",*/
"The name of the file where the monitoring information "
Expand All @@ -294,7 +294,7 @@ void mca_common_monitoring_register(void*pml_monitoring_component)

/* Now that the MCA variables are automatically unregistered when
* their component close, we need to keep a safe copy of the
* filename.
* filename.
* Keep the copy completely separated in order to let the initial
* filename to be handled by the framework. It's easier to deal
* with the string lifetime.
Expand Down
5 changes: 0 additions & 5 deletions opal/datatype/opal_convertor_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ opal_convertor_master_t* opal_convertor_find_or_create_master( uint32_t remote_a
void opal_convertor_destroy_masters( void );


#if OPAL_ENABLE_DEBUG
extern bool opal_pack_debug;
extern bool opal_unpack_debug;
#endif /* OPAL_ENABLE_DEBUG */

END_C_DECLS

#endif /* OPAL_CONVERTOR_INTERNAL_HAS_BEEN_INCLUDED */
14 changes: 7 additions & 7 deletions opal/datatype/opal_convertor_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#if OPAL_ENABLE_DEBUG
#include "opal/util/output.h"

#define DO_DEBUG(INST) if( opal_pack_debug ) { INST }
#define DO_DEBUG(INST) if( opal_ddt_raw_debug ) { INST }
#else
#define DO_DEBUG(INST)
#endif /* OPAL_ENABLE_DEBUG */
Expand Down Expand Up @@ -126,8 +126,8 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
const ddt_elem_desc_t* current = &(pElem->elem);

if( count_desc != (current->count * current->blocklen) ) { /* Not the full element description */
do_now = current->blocklen - (count_desc % current->blocklen); /* how much left in the block */
if( do_now ) {
if( (do_now = count_desc % current->blocklen) ) {
do_now = current->blocklen - do_now; /* how much left in the block */
source_base += current->disp;
blength = do_now * opal_datatype_basicDatatypes[current->common.type]->size;
OPAL_DATATYPE_SAFEGUARD_POINTER( source_base, blength, pConvertor->pBaseBuf,
Expand All @@ -136,12 +136,12 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
index, (void*)source_base, blength ); );
opal_convertor_merge_iov( iov, iov_count,
(IOVBASE_TYPE *) source_base, blength, &index );
/* not check the return value, we know there was at least one element in the iovec */
/* ignore the return value, we know there was at least one element in the iovec */
sum_iov_len += blength;
count_desc -= do_now;

source_base += (current->extent - current->disp +
(current->blocklen - do_now) * opal_datatype_basicDatatypes[current->common.type]->size);
source_base += (blength - current->blocklen * opal_datatype_basicDatatypes[current->common.type]->size +
current->extent - current->disp);
}
}
}
Expand Down Expand Up @@ -258,7 +258,7 @@ opal_convertor_raw( opal_convertor_t* pConvertor,
}
/* I complete an element, next step I should go to the next one */
PUSH_STACK( pStack, pConvertor->stack_pos, pos_desc, OPAL_DATATYPE_UINT1, count_desc,
source_base - pStack->disp - pConvertor->pBaseBuf );
source_base - pConvertor->pBaseBuf );
DO_DEBUG( opal_output( 0, "raw save stack stack_pos %d pos_desc %d count_desc %" PRIsize_t " disp %ld\n",
pConvertor->stack_pos, pStack->index, pStack->count, (long)pStack->disp ); );
return 0;
Expand Down
2 changes: 1 addition & 1 deletion opal/datatype/opal_datatype_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@


#if OPAL_ENABLE_DEBUG
#define DO_DEBUG(INST) if( opal_copy_debug ) { INST }
#define DO_DEBUG(INST) if( opal_ddt_copy_debug ) { INST }
#else
#define DO_DEBUG(INST)
#endif /* OPAL_ENABLE_DEBUG */
Expand Down
9 changes: 5 additions & 4 deletions opal/datatype/opal_datatype_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,11 @@ OPAL_DECLSPEC int opal_datatype_contain_basic_datatypes( const struct opal_datat
OPAL_DECLSPEC int opal_datatype_dump_data_flags( unsigned short usflags, char* ptr, size_t length );
OPAL_DECLSPEC int opal_datatype_dump_data_desc( union dt_elem_desc* pDesc, int nbElems, char* ptr, size_t length );

extern bool opal_position_debug;
extern bool opal_copy_debug;
extern bool opal_unpack_debug;
extern bool opal_pack_debug;
extern bool opal_ddt_position_debug;
extern bool opal_ddt_copy_debug;
extern bool opal_ddt_unpack_debug;
extern bool opal_ddt_pack_debug;
extern bool opal_ddt_raw_debug;

END_C_DECLS
#endif /* OPAL_DATATYPE_INTERNAL_H_HAS_BEEN_INCLUDED */
51 changes: 30 additions & 21 deletions opal/datatype/opal_datatype_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@

/* by default the debuging is turned off */
int opal_datatype_dfd = -1;
bool opal_unpack_debug = false;
bool opal_pack_debug = false;
bool opal_position_debug = false;
bool opal_copy_debug = false;
bool opal_ddt_unpack_debug = false;
bool opal_ddt_pack_debug = false;
bool opal_ddt_position_debug = false;
bool opal_ddt_copy_debug = false;
bool opal_ddt_raw_debug = false;
int opal_ddt_verbose = -1; /* Has the datatype verbose it's own output stream */

extern int opal_cuda_verbose;
Expand Down Expand Up @@ -161,35 +162,43 @@ int opal_datatype_register_params(void)
int ret;

ret = mca_base_var_register ("opal", "mpi", NULL, "ddt_unpack_debug",
"Whether to output debugging information in the ddt unpack functions (nonzero = enabled)",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_LOCAL, &opal_unpack_debug);
"Whether to output debugging information in the ddt unpack functions (nonzero = enabled)",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_LOCAL, &opal_ddt_unpack_debug);
if (0 > ret) {
return ret;
return ret;
}

ret = mca_base_var_register ("opal", "mpi", NULL, "ddt_pack_debug",
"Whether to output debugging information in the ddt pack functions (nonzero = enabled)",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_LOCAL, &opal_pack_debug);
"Whether to output debugging information in the ddt pack functions (nonzero = enabled)",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_LOCAL, &opal_ddt_pack_debug);
if (0 > ret) {
return ret;
return ret;
}

ret = mca_base_var_register ("opal", "mpi", NULL, "ddt_raw_debug",
"Whether to output debugging information in the ddt raw functions (nonzero = enabled)",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_LOCAL, &opal_ddt_raw_debug);
if (0 > ret) {
return ret;
}

ret = mca_base_var_register ("opal", "mpi", NULL, "ddt_position_debug",
"Non zero lead to output generated by the datatype position functions",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_LOCAL, &opal_position_debug);
"Non zero lead to output generated by the datatype position functions",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_LOCAL, &opal_ddt_position_debug);
if (0 > ret) {
return ret;
return ret;
}

ret = mca_base_var_register ("opal", "mpi", NULL, "ddt_copy_debug",
"Whether to output debugging information in the ddt copy functions (nonzero = enabled)",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_LOCAL, &opal_copy_debug);
"Whether to output debugging information in the ddt copy functions (nonzero = enabled)",
MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_LOCAL, &opal_ddt_copy_debug);
if (0 > ret) {
return ret;
return ret;
}

ret = mca_base_var_register ("opal", "opal", NULL, "ddt_verbose",
Expand All @@ -208,7 +217,7 @@ int opal_datatype_register_params(void)
OPAL_INFO_LVL_8, MCA_BASE_VAR_SCOPE_LOCAL,
&opal_cuda_verbose);
if (0 > ret) {
return ret;
return ret;
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions opal/datatype/opal_datatype_pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#if OPAL_ENABLE_DEBUG
#include "opal/util/output.h"

#define DO_DEBUG(INST) if( opal_pack_debug ) { INST }
#define DO_DEBUG(INST) if( opal_ddt_pack_debug ) { INST }
#else
#define DO_DEBUG(INST)
#endif /* OPAL_ENABLE_DEBUG */
Expand Down Expand Up @@ -272,7 +272,7 @@ opal_generic_simple_pack_function( opal_convertor_t* pConvertor,
for( iov_count = 0; iov_count < (*out_size); iov_count++ ) {
iov_ptr = (unsigned char *) iov[iov_count].iov_base;
iov_len_local = iov[iov_count].iov_len;

if( pElem->elem.common.flags & OPAL_DATATYPE_FLAG_DATA ) {
if( (pElem->elem.count * pElem->elem.blocklen) != count_desc ) {
/* we have a partial (less than blocklen) basic datatype */
Expand Down
2 changes: 1 addition & 1 deletion opal/datatype/opal_datatype_position.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#if OPAL_ENABLE_DEBUG
#include "opal/util/output.h"

#define DO_DEBUG(INST) if( opal_position_debug ) { INST }
#define DO_DEBUG(INST) if( opal_ddt_position_debug ) { INST }
#else
#define DO_DEBUG(INST)
#endif /* OPAL_ENABLE_DEBUG */
Expand Down
2 changes: 1 addition & 1 deletion opal/datatype/opal_datatype_unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#if OPAL_ENABLE_DEBUG
#include "opal/util/output.h"

#define DO_DEBUG(INST) if( opal_unpack_debug ) { INST }
#define DO_DEBUG(INST) if( opal_ddt_unpack_debug ) { INST }
#else
#define DO_DEBUG(INST)
#endif /* OPAL_ENABLE_DEBUG */
Expand Down