1
1

bug fix: set comm->c_topo to NULL in the allocator as well, for debug

purposes (although it did not cause any problems) we memset the
    c_coll structure to zero as well.
enabling comm_create for inter-communicators

This commit was SVN r1919.
Этот коммит содержится в:
Edgar Gabriel 2004-08-05 22:48:47 +00:00
родитель 3b7ed9136f
Коммит 6a8bebacd4
2 изменённых файлов: 25 добавлений и 22 удалений

Просмотреть файл

@ -174,17 +174,16 @@ int ompi_comm_create ( ompi_communicator_t *comm, ompi_group_t *group,
int rc = OMPI_SUCCESS;
if ( OMPI_COMM_IS_INTER(comm) ) {
#ifdef HAVE_COMM_CREATE_FOR_INTERCOMMS
int tsize, i, j;
tsize = comm->c_remote_group->grp_proc_count;
tsize = ompi_comm_remote_size(comm);
allranks = (int *) malloc ( tsize * sizeof(int));
if ( NULL == allranks ) {
rc = OMPI_ERR_OUT_OF_RESOURCE;
goto exit;
}
rc = comm->c_coll.coll_allgather_inter ( &group->grp_my_rank,
rc = comm->c_coll.coll_allgather ( &(group->grp_my_rank),
1, MPI_INT, allranks,
1, MPI_INT, comm );
if ( OMPI_SUCCESS != rc ) {
@ -193,7 +192,7 @@ int ompi_comm_create ( ompi_communicator_t *comm, ompi_group_t *group,
/* Count number of procs in future remote group */
for (rsize=0, i = 0; i < tsize; i++) {
if ( MPI_PROC_NULL != allranks[i] ) {
if ( MPI_UNDEFINED != allranks[i] ) {
rsize++;
}
}
@ -201,27 +200,26 @@ int ompi_comm_create ( ompi_communicator_t *comm, ompi_group_t *group,
/* If any of those groups is empty, we have to return
MPI_COMM_NULL */
if ( 0 == rsize || 0 == group->grp_proc_count ) {
*newcomm = MPI_COMM_NULL;
newcomp = MPI_COMM_NULL;
rc = OMPI_SUCCESS;
goto exit;
}
/* Set proc-pointers for remote group */
rprocs = (ompi_proc_t **) malloc ( sizeof(ompi_proc_t *) * rsize);
rprocs = (ompi_proc_t **) calloc ( rsize, sizeof(ompi_proc_t *));
if ( NULL == rprocs ) {
rc = OMPI_ERR_OUT_OF_RESOURCE;
goto exit;
}
for ( j = 0, i = 0; i < rsize; i++ ) {
if ( MPI_PROC_NULL != allranks[i] ) {
for ( j = 0, i = 0; i < tsize; i++ ) {
if ( MPI_UNDEFINED != allranks[i] ) {
rprocs[j] = comm->c_remote_group->grp_proc_pointers[i];
j++;
}
}
mode = OMPI_COMM_CID_INTER;
#else
return ( MPI_ERR_COMM );
#endif
}
else {
rsize = 0;

Просмотреть файл

@ -203,9 +203,14 @@ static void ompi_comm_construct(ompi_communicator_t* comm)
comm->c_remote_group = NULL;
comm->error_handler = NULL;
comm->c_pml_comm = NULL;
comm->c_topo = NULL;
comm->c_topo_comm = NULL;
comm->c_topo_module = NULL;
#if OMPI_ENABLE_DEBUG
memset (&(comm->c_coll), 0, sizeof(mca_coll_base_module_1_0_0_t));
#endif
comm->c_coll_selected_module = NULL;
comm->c_coll_selected_data = NULL;
comm->c_coll_basic_module = NULL;