1
1

fix some instances, where we might have allocated 0 bytes. Also, for allgather

make sure that we do not call coll_gather and coll_bcast in the very same
instances, since some collective (intra) modules do not seem to like the fact
if they are called for scount or rcount being zero (for regular
intra-communicator operations, this is handled on the MPI API layer).

Fixes trac:2405

This commit was SVN r23188.

The following Trac tickets were found above:
  Ticket 2405 --> https://svn.open-mpi.org/trac/ompi/ticket/2405
Этот коммит содержится в:
Edgar Gabriel 2010-05-20 22:23:44 +00:00
родитель 5881719d84
Коммит f6598138ba
4 изменённых файлов: 39 добавлений и 29 удалений

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

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006-2007 University of Houston. All rights reserved.
* Copyright (c) 2006-2010 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -61,18 +61,20 @@ mca_coll_inter_allgather_inter(void *sbuf, int scount,
return OMPI_ERROR;
}
incr = sextent * scount;
ptmp = (char*)malloc(size * incr);
if (NULL == ptmp) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
if ( scount > 0 ) {
incr = sextent * scount;
ptmp = (char*)malloc(size * incr);
if (NULL == ptmp) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
err = comm->c_local_comm->c_coll.coll_gather(sbuf, scount, sdtype,
ptmp, scount, sdtype,
0, comm->c_local_comm,
comm->c_local_comm->c_coll.coll_gather_module);
if (OMPI_SUCCESS != err) {
goto exit;
err = comm->c_local_comm->c_coll.coll_gather(sbuf, scount, sdtype,
ptmp, scount, sdtype,
0, comm->c_local_comm,
comm->c_local_comm->c_coll.coll_gather_module);
if (OMPI_SUCCESS != err) {
goto exit;
}
}
if (rank == root) {
@ -98,11 +100,13 @@ mca_coll_inter_allgather_inter(void *sbuf, int scount,
}
}
/* bcast the message to all the local processes */
err = comm->c_local_comm->c_coll.coll_bcast(rbuf, rcount*rsize, rdtype,
root, comm->c_local_comm,
comm->c_local_comm->c_coll.coll_bcast_module);
if (OMPI_SUCCESS != err) {
goto exit;
if ( rcount > 0 ) {
err = comm->c_local_comm->c_coll.coll_bcast(rbuf, rcount*rsize, rdtype,
root, comm->c_local_comm,
comm->c_local_comm->c_coll.coll_bcast_module);
if (OMPI_SUCCESS != err) {
goto exit;
}
}
exit:

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

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006-2007 University of Houston. All rights reserved.
* Copyright (c) 2006-2010 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -90,9 +90,11 @@ mca_coll_inter_allgatherv_inter(void *sbuf, int scount,
for (i = 0; i < size_local; i++) {
incr = incr + extent*count[i];
}
ptmp = (char*)malloc(incr);
if (NULL == ptmp) {
return OMPI_ERR_OUT_OF_RESOURCE;
if ( incr > 0 ) {
ptmp = (char*)malloc(incr);
if (NULL == ptmp) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
}
}
err = comm->c_local_comm->c_coll.coll_gatherv(sbuf, scount, sdtype,

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

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006-2007 University of Houston. All rights reserved.
* Copyright (c) 2006-2010 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -91,9 +91,11 @@ mca_coll_inter_gatherv_inter(void *sbuf, int scount,
for (i = 0; i < size_local; i++) {
incr = incr + extent*count[i];
}
ptmp = (char*)malloc(incr);
if (NULL == ptmp) {
return OMPI_ERR_OUT_OF_RESOURCE;
if ( incr > 0 ) {
ptmp = (char*)malloc(incr);
if (NULL == ptmp) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
}
}
err = comm->c_local_comm->c_coll.coll_gatherv(sbuf, scount, sdtype,

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

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2006-2007 University of Houston. All rights reserved.
* Copyright (c) 2006-2010 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -79,9 +79,11 @@ mca_coll_inter_scatterv_inter(void *sbuf, int *scounts,
for (i = 0; i < size_local; i++) {
incr = incr + extent*counts[i];
}
ptmp = (char*)malloc(incr);
if (NULL == ptmp) {
return OMPI_ERR_OUT_OF_RESOURCE;
if ( incr > 0 ) {
ptmp = (char*)malloc(incr);
if (NULL == ptmp) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
}
total = 0;
for (i = 0; i < size_local; i++) {