Merge pull request #4883 from bosilca/topic/get_element_fix
Topic/get element fix
Этот коммит содержится в:
Коммит
70c59f78b9
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2017 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2018 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
||||
@ -60,9 +60,8 @@ ssize_t opal_datatype_get_element_count( const opal_datatype_t* datatype, size_t
|
||||
continue;
|
||||
}
|
||||
if( OPAL_DATATYPE_LOOP == pElems[pos_desc].elem.common.type ) {
|
||||
ddt_loop_desc_t* loop = &(pElems[pos_desc].loop);
|
||||
do {
|
||||
PUSH_STACK( pStack, stack_pos, pos_desc, OPAL_DATATYPE_LOOP, loop->loops, 0 );
|
||||
PUSH_STACK( pStack, stack_pos, pos_desc, OPAL_DATATYPE_LOOP, pElems[pos_desc].loop.loops, 0 );
|
||||
pos_desc++;
|
||||
} while( OPAL_DATATYPE_LOOP == pElems[pos_desc].elem.common.type ); /* let's start another loop */
|
||||
DDT_DUMP_STACK( pStack, stack_pos, pElems, "advance loops" );
|
||||
@ -123,9 +122,8 @@ int32_t opal_datatype_set_element_count( const opal_datatype_t* datatype, size_t
|
||||
continue;
|
||||
}
|
||||
if( OPAL_DATATYPE_LOOP == pElems[pos_desc].elem.common.type ) {
|
||||
ddt_loop_desc_t* loop = &(pElems[pos_desc].loop);
|
||||
do {
|
||||
PUSH_STACK( pStack, stack_pos, pos_desc, OPAL_DATATYPE_LOOP, loop->loops, 0 );
|
||||
PUSH_STACK( pStack, stack_pos, pos_desc, OPAL_DATATYPE_LOOP, pElems[pos_desc].loop.loops, 0 );
|
||||
pos_desc++;
|
||||
} while( OPAL_DATATYPE_LOOP == pElems[pos_desc].elem.common.type ); /* let's start another loop */
|
||||
DDT_DUMP_STACK( pStack, stack_pos, pElems, "advance loops" );
|
||||
@ -182,9 +180,8 @@ int opal_datatype_compute_ptypes( opal_datatype_t* datatype )
|
||||
continue;
|
||||
}
|
||||
if( OPAL_DATATYPE_LOOP == pElems[pos_desc].elem.common.type ) {
|
||||
ddt_loop_desc_t* loop = &(pElems[pos_desc].loop);
|
||||
do {
|
||||
PUSH_STACK( pStack, stack_pos, pos_desc, OPAL_DATATYPE_LOOP, loop->loops, 0 );
|
||||
PUSH_STACK( pStack, stack_pos, pos_desc, OPAL_DATATYPE_LOOP, pElems[pos_desc].loop.loops, 0 );
|
||||
pos_desc++;
|
||||
} while( OPAL_DATATYPE_LOOP == pElems[pos_desc].elem.common.type ); /* let's start another loop */
|
||||
DDT_DUMP_STACK( pStack, stack_pos, pElems, "advance loops" );
|
||||
@ -194,6 +191,9 @@ int opal_datatype_compute_ptypes( opal_datatype_t* datatype )
|
||||
datatype->ptypes[pElems[pos_desc].elem.common.type] += pElems[pos_desc].elem.count;
|
||||
nbElems += pElems[pos_desc].elem.count;
|
||||
|
||||
DUMP( " compute_ptypes-add: type %d count %"PRIsize_t" (total type %"PRIsize_t" total %lld)\n",
|
||||
pElems[pos_desc].elem.common.type, datatype->ptypes[pElems[pos_desc].elem.common.type],
|
||||
pElems[pos_desc].elem.count, nbElems );
|
||||
pos_desc++; /* advance to the next data */
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2017 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2018 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
|
||||
@ -49,10 +49,9 @@ static inline void DUMP( char* fmt, ... )
|
||||
va_list list;
|
||||
|
||||
va_start( list, fmt );
|
||||
opal_output( opal_datatype_dfd, fmt, list );
|
||||
opal_output_vverbose( 0, opal_datatype_dfd, fmt, list );
|
||||
va_end( list );
|
||||
}
|
||||
# define DUMP printf
|
||||
# endif /* __GNUC__ && !__STDC__ */
|
||||
# endif /* ACCEPT_C99 */
|
||||
#else
|
||||
@ -329,8 +328,8 @@ struct opal_datatype_t;
|
||||
.ptypes = OPAL_DATATYPE_INIT_PTYPES_ARRAY_UNAVAILABLE \
|
||||
}
|
||||
|
||||
#define OPAL_DATATYPE_INITIALIZER_LOOP(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_LOOP, LOOP, FLAGS )
|
||||
#define OPAL_DATATYPE_INITIALIZER_END_LOOP(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_END_LOOP, END_LOOP, FLAGS )
|
||||
#define OPAL_DATATYPE_INITIALIZER_LOOP(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_LOOP, LOOP_S, FLAGS )
|
||||
#define OPAL_DATATYPE_INITIALIZER_END_LOOP(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_END_LOOP, LOOP_E, FLAGS )
|
||||
#define OPAL_DATATYPE_INITIALIZER_LB(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_LB, LB, FLAGS )
|
||||
#define OPAL_DATATYPE_INITIALIZER_UB(FLAGS) OPAL_DATATYPE_INIT_BASIC_TYPE( OPAL_DATATYPE_UB, UB, FLAGS )
|
||||
#define OPAL_DATATYPE_INITIALIZER_INT1(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( int8_t, OPAL_ALIGNMENT_INT8, INT1, FLAGS )
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2013 The University of Tennessee and The University
|
||||
* Copyright (c) 2004-2018 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2006 High Performance Computing Center Stuttgart,
|
||||
@ -29,6 +29,7 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include "opal/util/arch.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/datatype/opal_datatype_internal.h"
|
||||
#include "opal/datatype/opal_datatype.h"
|
||||
#include "opal/datatype/opal_convertor_internal.h"
|
||||
@ -40,6 +41,7 @@ bool opal_unpack_debug = false;
|
||||
bool opal_pack_debug = false;
|
||||
bool opal_position_debug = false;
|
||||
bool opal_copy_debug = false;
|
||||
int opal_ddt_verbose = -1; /* Has the datatype verbose it's own output stream */
|
||||
|
||||
extern int opal_cuda_verbose;
|
||||
|
||||
@ -177,11 +179,19 @@ int opal_datatype_register_params(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = mca_base_var_register ("opal", "opal", NULL, "ddt_verbose",
|
||||
"Set level of opal datatype verbosity",
|
||||
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
|
||||
OPAL_INFO_LVL_8, MCA_BASE_VAR_SCOPE_LOCAL,
|
||||
&opal_ddt_verbose);
|
||||
if (0 > ret) {
|
||||
return ret;
|
||||
}
|
||||
#if OPAL_CUDA_SUPPORT
|
||||
/* Set different levels of verbosity in the cuda related code. */
|
||||
ret = mca_base_var_register ("opal", "opal", NULL, "cuda_verbose",
|
||||
"Set level of opal cuda verbosity",
|
||||
MCA_BASE_VAR_TYPE_INT, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
|
||||
MCA_BASE_VAR_TYPE_INT, NULL, -1, MCA_BASE_VAR_FLAG_SETTABLE,
|
||||
OPAL_INFO_LVL_8, MCA_BASE_VAR_SCOPE_LOCAL,
|
||||
&opal_cuda_verbose);
|
||||
if (0 > ret) {
|
||||
@ -226,6 +236,12 @@ int32_t opal_datatype_init( void )
|
||||
datatype->desc.desc[1].end_loop.size = datatype->size;
|
||||
}
|
||||
|
||||
/* Enable a private output stream for datatype */
|
||||
if( opal_ddt_verbose > 0 ) {
|
||||
opal_datatype_dfd = opal_output_open(NULL);
|
||||
opal_output_set_verbosity(opal_datatype_dfd, opal_ddt_verbose);
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user