Merge branch 'master' of github.com:open-mpi/ompi
Этот коммит содержится в:
Коммит
43901fa15a
@ -584,6 +584,9 @@ static int connect_accept(ompi_communicator_t *comm, int root,
|
||||
if ( NULL != proc_list ) {
|
||||
free ( proc_list );
|
||||
}
|
||||
if ( NULL != new_proc_list ) {
|
||||
free ( new_proc_list );
|
||||
}
|
||||
if ( OMPI_SUCCESS != rc ) {
|
||||
if ( MPI_COMM_NULL != newcomp && NULL != newcomp ) {
|
||||
OBJ_RETAIN(newcomp);
|
||||
|
@ -54,7 +54,7 @@ int mca_topo_base_dist_graph_distribute(mca_topo_base_module_t* module,
|
||||
* In addition we compute 3 arrays (that are allocated in one go):
|
||||
* - cnt: the number of elements for a peer
|
||||
* - pos: the position of the first element for a peer
|
||||
* - idx: temporaru indexes and message count after the reduce.
|
||||
* - idx: temporary indexes and message count after the reduce.
|
||||
*/
|
||||
cnt = (mca_topo_base_dist_graph_elem_t*)calloc(3 * csize, sizeof(mca_topo_base_dist_graph_elem_t));
|
||||
if( NULL == cnt ) {
|
||||
@ -118,8 +118,8 @@ int mca_topo_base_dist_graph_distribute(mca_topo_base_module_t* module,
|
||||
comm->c_coll.coll_allreduce_module);
|
||||
/**
|
||||
* At this point in the indexes array we have:
|
||||
* - indexes[0] total number of in edges
|
||||
* - indexes[1] total number of out edges
|
||||
* - idx[0].in total number of IN edges
|
||||
* - idx[0].out total number of OUT edges
|
||||
*/
|
||||
topo = OBJ_NEW(mca_topo_base_comm_dist_graph_2_2_0_t);
|
||||
if( NULL == topo ) {
|
||||
@ -134,7 +134,7 @@ int mca_topo_base_dist_graph_distribute(mca_topo_base_module_t* module,
|
||||
if (NULL == topo->in) {
|
||||
err = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto bail_out;
|
||||
}
|
||||
}
|
||||
if (MPI_UNWEIGHTED != weights) {
|
||||
topo->inw = (int*)malloc(sizeof(int) * topo->indegree);
|
||||
if (NULL == topo->inw) {
|
||||
@ -148,7 +148,7 @@ int mca_topo_base_dist_graph_distribute(mca_topo_base_module_t* module,
|
||||
if (NULL == topo->out) {
|
||||
err = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto bail_out;
|
||||
}
|
||||
}
|
||||
if (MPI_UNWEIGHTED != weights) {
|
||||
topo->outw = (int*)malloc(sizeof(int) * topo->outdegree);
|
||||
if (NULL == topo->outw) {
|
||||
|
@ -312,13 +312,14 @@ static void xcast_recv(int status, orte_process_name_t* sender,
|
||||
rly = OBJ_NEW(opal_buffer_t);
|
||||
opal_dss.copy_payload(rly, buffer);
|
||||
|
||||
/* get the signature */
|
||||
/* get the signature that we do not need */
|
||||
cnt=1;
|
||||
if (ORTE_SUCCESS != (ret = opal_dss.unpack(buffer, &sig, &cnt, ORTE_SIGNATURE))) {
|
||||
ORTE_ERROR_LOG(ret);
|
||||
ORTE_FORCED_TERMINATE(ret);
|
||||
return;
|
||||
}
|
||||
OBJ_RELEASE(sig);
|
||||
|
||||
/* get the target tag */
|
||||
cnt=1;
|
||||
|
@ -15,6 +15,8 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -393,7 +395,16 @@ static int odls_base_default_setup_fork(orte_job_t *jdata,
|
||||
/* setup base environment: copy the current environ and merge
|
||||
in the app context environ */
|
||||
if (NULL != context->env) {
|
||||
*environ_copy = opal_environ_merge(orte_launch_environ, context->env);
|
||||
if (*environ_copy == context->env) {
|
||||
/* manually free original context->env to avoid a memory leak */
|
||||
char ** tmp = context->env;
|
||||
*environ_copy = opal_environ_merge(orte_launch_environ, context->env);
|
||||
if (NULL != tmp) {
|
||||
opal_argv_free(tmp);
|
||||
}
|
||||
} else {
|
||||
*environ_copy = opal_environ_merge(orte_launch_environ, context->env);
|
||||
}
|
||||
} else {
|
||||
*environ_copy = opal_argv_copy(orte_launch_environ);
|
||||
}
|
||||
@ -891,8 +902,8 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata)
|
||||
orte_jobid_t job = caddy->job;
|
||||
orte_odls_base_fork_local_proc_fn_t fork_local = caddy->fork_local;
|
||||
char *num_app_ctx = NULL;
|
||||
char **nps, *npstring;
|
||||
char **firstranks, *firstrankstring;
|
||||
char **nps, *npstring = NULL;
|
||||
char **firstranks, *firstrankstring = NULL;
|
||||
bool index_argv;
|
||||
|
||||
/* establish our baseline working directory - we will be potentially
|
||||
@ -1385,6 +1396,16 @@ void orte_odls_base_default_launch_local(int fd, short sd, void *cbdata)
|
||||
ERROR_OUT:
|
||||
/* ensure we reset our working directory back to our default location */
|
||||
chdir(basedir);
|
||||
/* release allocated memory */
|
||||
if (NULL != num_app_ctx) {
|
||||
free(num_app_ctx);
|
||||
}
|
||||
if (NULL != npstring) {
|
||||
free(npstring);
|
||||
}
|
||||
if (NULL != firstrankstring) {
|
||||
free(firstrankstring);
|
||||
}
|
||||
/* release the event */
|
||||
OBJ_RELEASE(caddy);
|
||||
}
|
||||
|
@ -14,6 +14,8 @@
|
||||
* et Automatique. All rights reserved.
|
||||
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
|
||||
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -521,6 +523,7 @@ void orte_plm_base_launch_apps(int fd, short args, void *cbdata)
|
||||
OBJ_RELEASE(caddy);
|
||||
return;
|
||||
}
|
||||
OBJ_RELEASE(buffer);
|
||||
/* maintain accounting */
|
||||
OBJ_RELEASE(sig);
|
||||
|
||||
|
@ -12,6 +12,8 @@
|
||||
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2008-2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -140,6 +142,7 @@ int orte_util_check_context_app(orte_app_context_t *context, char **env)
|
||||
if (NULL != context->app) free(context->app);
|
||||
context->app = tmp;
|
||||
} else {
|
||||
free(tmp);
|
||||
if (0 != access(context->app, X_OK)) {
|
||||
return ORTE_ERR_EXE_NOT_ACCESSIBLE;
|
||||
}
|
||||
|
@ -56,9 +56,9 @@ static int test_upper( unsigned int length )
|
||||
TIMER_DATA_TYPE start, end;
|
||||
long total_time;
|
||||
|
||||
printf( "test upper matrix\n" );
|
||||
/*printf( "test upper matrix\n" );*/
|
||||
pdt = upper_matrix( length );
|
||||
opal_datatype_dump( pdt );
|
||||
/*opal_datatype_dump( pdt );*/
|
||||
|
||||
mat1 = malloc( length * length * sizeof(double) );
|
||||
init_random_upper_matrix( length, mat1 );
|
||||
@ -346,15 +346,15 @@ int main( int argc, char* argv[] )
|
||||
* By default simulate homogeneous architectures.
|
||||
*/
|
||||
remote_arch = opal_local_arch;
|
||||
printf( "\n\n#\n * TEST CREATE CONTIGUOUS\n #\n\n" );
|
||||
printf( "\n\n#\n * TEST CREATE CONTIGUOUS\n#\n\n" );
|
||||
pdt = create_contiguous_type( &opal_datatype_int1, 10 );
|
||||
if( outputFlags & CHECK_PACK_UNPACK ) {
|
||||
local_copy_ddt_count(pdt, 100);
|
||||
local_copy_with_convertor(pdt, 100, 956);
|
||||
}
|
||||
|
||||
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
||||
printf( "\n\n#\n * TEST STRANGE DATATYPE\n #\n\n" );
|
||||
|
||||
printf( "\n\n#\n * TEST STRANGE DATATYPE\n#\n\n" );
|
||||
pdt = create_strange_dt();
|
||||
if( outputFlags & CHECK_PACK_UNPACK ) {
|
||||
local_copy_ddt_count(pdt, 1);
|
||||
@ -362,27 +362,34 @@ int main( int argc, char* argv[] )
|
||||
}
|
||||
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
||||
|
||||
|
||||
printf( "\n\n#\n * TEST UPPER TRIANGULAR MATRIX (size 100)\n #\n\n" );
|
||||
printf( "\n\n#\n * TEST UPPER TRIANGULAR MATRIX (size 100)\n#\n\n" );
|
||||
pdt = upper_matrix(100);
|
||||
if( outputFlags & CHECK_PACK_UNPACK ) {
|
||||
local_copy_ddt_count(pdt, 1);
|
||||
local_copy_with_convertor(pdt, 1, 48);
|
||||
}
|
||||
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
||||
|
||||
|
||||
printf( "\n\n#\n * TEST CREATE STRUCT CONSTANT GAP RESIZED\n#\n\n" );
|
||||
pdt = create_struct_constant_gap_resized_ddt();
|
||||
if( outputFlags & CHECK_PACK_UNPACK ) {
|
||||
local_copy_ddt_count(pdt, 10000);
|
||||
local_copy_with_convertor(pdt, 10000, 956);
|
||||
}
|
||||
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
||||
|
||||
mpich_typeub();
|
||||
mpich_typeub2();
|
||||
mpich_typeub3();
|
||||
|
||||
printf( "\n\n#\n * TEST UPPER MATRIX\n #\n\n" );
|
||||
printf( "\n\n#\n * TEST UPPER MATRIX\n#\n\n" );
|
||||
rc = test_upper( length );
|
||||
if( rc == 0 )
|
||||
printf( "decode [PASSED]\n" );
|
||||
else
|
||||
printf( "decode [NOT PASSED]\n" );
|
||||
|
||||
printf( "\n\n#\n * TEST MATRIX BORDERS\n #\n\n" );
|
||||
printf( "\n\n#\n * TEST MATRIX BORDERS\n#\n\n" );
|
||||
pdt = test_matrix_borders( length, 100 );
|
||||
if( outputFlags & DUMP_DATA_AFTER_COMMIT ) {
|
||||
opal_datatype_dump( pdt );
|
||||
@ -390,10 +397,10 @@ int main( int argc, char* argv[] )
|
||||
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
||||
|
||||
|
||||
printf( "\n\n#\n * TEST CONTIGUOUS\n #\n\n" );
|
||||
printf( "\n\n#\n * TEST CONTIGUOUS\n#\n\n" );
|
||||
pdt = test_contiguous();
|
||||
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
||||
printf( "\n\n#\n * TEST STRUCT\n #\n\n" );
|
||||
printf( "\n\n#\n * TEST STRUCT\n#\n\n" );
|
||||
pdt = test_struct();
|
||||
OBJ_RELEASE( pdt ); assert( pdt == NULL );
|
||||
|
||||
|
@ -253,6 +253,27 @@ opal_datatype_t* create_contiguous_type( const opal_datatype_t* type, int length
|
||||
return newtype;
|
||||
}
|
||||
|
||||
/* Create a non-contiguous resized datatype */
|
||||
struct structure {
|
||||
double not_transfered;
|
||||
double transfered_1;
|
||||
double transfered_2;
|
||||
};
|
||||
|
||||
opal_datatype_t* create_struct_constant_gap_resized_ddt( void )
|
||||
{
|
||||
opal_datatype_t *struct_type;
|
||||
|
||||
opal_datatype_create_contiguous(0, &opal_datatype_empty, &struct_type);
|
||||
opal_datatype_add( struct_type, &opal_datatype_float8, 1, 8, -1 );
|
||||
opal_datatype_add( struct_type, &opal_datatype_float8, 1, 16, -1 );
|
||||
|
||||
opal_datatype_resize(struct_type, 0, sizeof(struct structure));
|
||||
opal_datatype_commit(struct_type);
|
||||
|
||||
return struct_type;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Copied Function to get test to work */
|
||||
|
@ -49,4 +49,6 @@ extern int mpich_typeub( void );
|
||||
extern int mpich_typeub2( void );
|
||||
extern int mpich_typeub3( void );
|
||||
|
||||
extern opal_datatype_t* create_struct_constant_gap_resized_ddt( void );
|
||||
|
||||
#endif /* TEST_OPAL_DDT_LIB_H */
|
||||
|
@ -23,6 +23,37 @@ extern void ompi_datatype_dump( MPI_Datatype ddt );
|
||||
#define MPI_DDT_DUMP(ddt)
|
||||
#endif /* OPEN_MPI */
|
||||
|
||||
/* Create a non-contiguous resized datatype */
|
||||
struct structure {
|
||||
double not_transfered;
|
||||
double transfered_1;
|
||||
double transfered_2;
|
||||
};
|
||||
|
||||
static MPI_Datatype
|
||||
create_struct_constant_gap_resized_ddt( int number, /* number of repetitions */
|
||||
int contig_size, /* IGNORED: number of elements in a contiguous chunk */
|
||||
int gap_size ) /* IGNORED: number of elements in a gap */
|
||||
{
|
||||
struct structure *data;
|
||||
MPI_Datatype struct_type, temp_type;
|
||||
MPI_Datatype types[2] = {MPI_DOUBLE, MPI_DOUBLE};
|
||||
int blocklens[2] = {1, 1};
|
||||
MPI_Aint disps[3];
|
||||
|
||||
MPI_Get_address(&data[0].transfered_1, &disps[0]);
|
||||
MPI_Get_address(&data[0].transfered_2, &disps[1]);
|
||||
MPI_Get_address(&data[0], &disps[2]);
|
||||
disps[1] -= disps[2]; /* 8 */
|
||||
disps[0] -= disps[2]; /* 16 */
|
||||
|
||||
MPI_Type_create_struct(2, blocklens, disps, types, &temp_type);
|
||||
MPI_Type_create_resized(temp_type, 0, sizeof(data[0]), &struct_type);
|
||||
MPI_Type_commit(&struct_type);
|
||||
|
||||
return struct_type;
|
||||
}
|
||||
|
||||
/* Create a datatype similar to the one use by HPL */
|
||||
static MPI_Datatype
|
||||
create_indexed_constant_gap_ddt( int number, /* number of repetitions */
|
||||
@ -328,17 +359,18 @@ static int do_test_for_ddt( MPI_Datatype sddt, MPI_Datatype rddt, int length )
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define DO_CONTIG 0x01
|
||||
#define DO_CONSTANT_GAP 0x02
|
||||
#define DO_INDEXED_GAP 0x04
|
||||
#define DO_OPTIMIZED_INDEXED_GAP 0x08
|
||||
#define DO_CONTIG 0x01
|
||||
#define DO_CONSTANT_GAP 0x02
|
||||
#define DO_INDEXED_GAP 0x04
|
||||
#define DO_OPTIMIZED_INDEXED_GAP 0x08
|
||||
#define DO_STRUCT_CONSTANT_GAP_RESIZED 0x10
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
int length = 1024 * 1024;
|
||||
int length = 111;
|
||||
int rank, size;
|
||||
MPI_Datatype ddt;
|
||||
int run_tests = DO_CONTIG | DO_CONSTANT_GAP | DO_INDEXED_GAP | DO_OPTIMIZED_INDEXED_GAP;
|
||||
int run_tests = 0xffffffff; /* do all tests by default */
|
||||
/*int run_tests = DO_CONSTANT_GAP;*/
|
||||
|
||||
MPI_Init (&argc, &argv);
|
||||
@ -388,6 +420,14 @@ int main( int argc, char* argv[] )
|
||||
MPI_Type_free( &ddt );
|
||||
}
|
||||
|
||||
if( run_tests & DO_STRUCT_CONSTANT_GAP_RESIZED ) {
|
||||
printf( "\nstruct constant gap resized\n\n" );
|
||||
ddt = create_struct_constant_gap_resized_ddt( 80, 0 /* unused */, 0 /* unused */ );
|
||||
MPI_DDT_DUMP( ddt );
|
||||
do_test_for_ddt( ddt, ddt, length );
|
||||
MPI_Type_free( &ddt );
|
||||
}
|
||||
|
||||
MPI_Finalize ();
|
||||
exit(0);
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user