Commit 2cefdcbf authored by Pavan Balaji's avatar Pavan Balaji
Browse files

[svn-r9104] Warning squash. Reviewed by buntinas.

parent e7664bfe
......@@ -68,11 +68,8 @@ do { \
int err__; \
\
err__ = pthread_mutex_init((mutex_ptr_), NULL); \
if ((err_ptr_) != NULL) \
{ \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
MPIU_DBG_MSG_P(THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_)); \
} while (0)
#else /* MPICH_DEBUG_MUTEX */
......@@ -91,11 +88,8 @@ do { \
if (err__) \
MPIU_Internal_sys_error_printf("pthread_mutex_init", err__, \
" %s:%d\n", __FILE__, __LINE__);\
if ((err_ptr_) != NULL) \
{ \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
MPIU_DBG_MSG_P(THREAD,TYPICAL,"Created MPIU_Thread_mutex %p", (mutex_ptr_)); \
} while (0)
#endif
......@@ -106,11 +100,8 @@ do { \
\
MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to destroy MPIU_Thread_mutex %p", (mutex_ptr_)); \
err__ = pthread_mutex_destroy(mutex_ptr_); \
if ((err_ptr_) != NULL) \
{ \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} while (0)
#ifndef MPICH_DEBUG_MUTEX
......@@ -203,31 +194,25 @@ do { \
* Condition Variables
*/
#define MPIU_Thread_cond_create(cond_ptr_, err_ptr_) \
do { \
int err__; \
\
err__ = pthread_cond_init((cond_ptr_), NULL); \
MPIU_DBG_MSG_P(THREAD,TYPICAL,"Created MPIU_Thread_cond %p", (cond_ptr_)); \
if ((err_ptr_) != NULL) \
{ \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} \
} while (0)
#define MPIU_Thread_cond_create(cond_ptr_, err_ptr_) \
do { \
int err__; \
\
err__ = pthread_cond_init((cond_ptr_), NULL); \
MPIU_DBG_MSG_P(THREAD,TYPICAL,"Created MPIU_Thread_cond %p", (cond_ptr_)); \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} while (0)
#define MPIU_Thread_cond_destroy(cond_ptr_, err_ptr_) \
do { \
int err__; \
\
MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to destroy MPIU_Thread_cond %p", (cond_ptr_)); \
err__ = pthread_cond_destroy(cond_ptr_); \
if ((err_ptr_) != NULL) \
{ \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} \
} while (0)
#define MPIU_Thread_cond_destroy(cond_ptr_, err_ptr_) \
do { \
int err__; \
\
MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to destroy MPIU_Thread_cond %p", (cond_ptr_)); \
err__ = pthread_cond_destroy(cond_ptr_); \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} while (0)
#define MPIU_Thread_cond_wait(cond_ptr_, mutex_ptr_, err_ptr_) \
do { \
......@@ -243,14 +228,11 @@ do { \
} \
while (err__ == EINTR); \
\
if ((err_ptr_) != NULL) \
{ \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
if (err__) { \
MPIU_DBG_MSG_FMT(THREAD,TYPICAL,(MPIU_DBG_FDEST,"error in cond_wait on cond=%p mutex=%p err__=%d",(cond_ptr_),(mutex_ptr_), err__)) \
} \
} \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
if (err__) { \
MPIU_DBG_MSG_FMT(THREAD,TYPICAL,(MPIU_DBG_FDEST,"error in cond_wait on cond=%p mutex=%p err__=%d",(cond_ptr_),(mutex_ptr_), err__)) \
} \
MPIU_DBG_MSG_FMT(THREAD,TYPICAL,(MPIU_DBG_FDEST,"Exit cond_wait on cond=%p mutex=%p",(cond_ptr_),(mutex_ptr_))) \
} while (0)
......@@ -261,11 +243,8 @@ do { \
MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to cond_broadcast on MPIU_Thread_cond %p", (cond_ptr_)); \
err__ = pthread_cond_broadcast(cond_ptr_); \
\
if ((err_ptr_) != NULL) \
{ \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} while (0)
#define MPIU_Thread_cond_signal(cond_ptr_, err_ptr_) \
......@@ -275,11 +254,8 @@ do { \
MPIU_DBG_MSG_P(THREAD,TYPICAL,"About to cond_signal on MPIU_Thread_cond %p", (cond_ptr_)); \
err__ = pthread_cond_signal(cond_ptr_); \
\
if ((err_ptr_) != NULL) \
{ \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} while (0)
......@@ -293,11 +269,8 @@ do { \
\
err__ = pthread_key_create((tls_ptr_), (exit_func_ptr_)); \
\
if ((err_ptr_) != NULL) \
{ \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} while (0)
#define MPIU_Thread_tls_destroy(tls_ptr_, err_ptr_) \
......@@ -306,11 +279,8 @@ do { \
\
err__ = pthread_key_delete(*(tls_ptr_)); \
\
if ((err_ptr_) != NULL) \
{ \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} while (0)
#define MPIU_Thread_tls_set(tls_ptr_, value_, err_ptr_) \
......@@ -319,20 +289,14 @@ do { \
\
err__ = pthread_setspecific(*(tls_ptr_), (value_)); \
\
if ((err_ptr_) != NULL) \
{ \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = err__; \
} while (0)
#define MPIU_Thread_tls_get(tls_ptr_, value_ptr_, err_ptr_) \
do { \
*(value_ptr_) = pthread_getspecific(*(tls_ptr_)); \
\
if ((err_ptr_) != NULL) \
{ \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = MPIU_THREAD_SUCCESS; \
} \
/* FIXME: convert error to an MPIU_THREAD_ERR value */ \
*(int *)(err_ptr_) = MPIU_THREAD_SUCCESS; \
} while (0)
......@@ -33,7 +33,7 @@ int MPIR_Comm_set_attr_impl(MPID_Comm *comm_ptr, int comm_keyval, void *attribut
{
int mpi_errno = MPI_SUCCESS;
MPID_Keyval *keyval_ptr = NULL;
MPID_Attribute *p, **old_p;
MPID_Attribute *p;
MPIU_ERR_CHKANDJUMP(comm_keyval == MPI_KEYVAL_INVALID, mpi_errno, MPI_ERR_KEYVAL, "**keyvalinvalid");
......@@ -46,7 +46,6 @@ int MPIR_Comm_set_attr_impl(MPID_Comm *comm_ptr, int comm_keyval, void *attribut
MPIU_Assert(keyval_ptr != NULL);
/* printf( "Setting attr val to %x\n", attribute_val ); */
old_p = &comm_ptr->attributes;
p = comm_ptr->attributes;
while (p) {
if (p->keyval->handle == keyval_ptr->handle) {
......@@ -62,7 +61,6 @@ int MPIR_Comm_set_attr_impl(MPID_Comm *comm_ptr, int comm_keyval, void *attribut
/* Does not change the reference count on the keyval */
break;
}
old_p = &p->next;
p = p->next;
}
/* CHANGE FOR MPI 2.2: If not found, add at the beginning */
......
......@@ -681,7 +681,6 @@ static int MPIR_Bcast_scatter_ring_allgather(
int *errflag)
{
int rank, comm_size;
int relative_rank;
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
int scatter_size, nbytes;
......@@ -700,7 +699,6 @@ static int MPIR_Bcast_scatter_ring_allgather(
comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
relative_rank = (rank >= root) ? rank - root : rank - root + comm_size;
/* If there is only one process, return */
if (comm_size == 1) goto fn_exit;
......@@ -1100,7 +1098,6 @@ int MPIR_Bcast_intra (
int comm_size;
int nbytes=0;
int type_size, is_homogeneous;
MPI_Comm comm;
MPID_MPI_STATE_DECL(MPID_STATE_MPIR_BCAST);
MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_BCAST);
......@@ -1123,7 +1120,6 @@ int MPIR_Bcast_intra (
}
#endif
comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
is_homogeneous = 1;
......
......@@ -65,7 +65,7 @@ fn_fail:
int MPIR_Iallreduce_redscat_allgather(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
{
int mpi_errno = MPI_SUCCESS;
int comm_size, rank, newrank, pof2, rem, is_commutative, type_size;
int comm_size, rank, newrank, pof2, rem;
int i, send_idx, recv_idx, last_idx, mask, newdst, dst, send_cnt, recv_cnt;
MPI_Aint true_lb, true_extent, extent;
void *tmp_buf = NULL;
......@@ -80,8 +80,6 @@ int MPIR_Iallreduce_redscat_allgather(void *sendbuf, void *recvbuf, int count, M
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
is_commutative = MPIR_Op_is_commutative(op);
/* need to allocate temporary buffer to store incoming data*/
MPIR_Type_get_true_extent_impl(datatype, &true_lb, &true_extent);
MPID_Datatype_get_extent_macro(datatype, extent);
......@@ -100,8 +98,6 @@ int MPIR_Iallreduce_redscat_allgather(void *sendbuf, void *recvbuf, int count, M
MPID_SCHED_BARRIER(s);
}
MPID_Datatype_get_size_macro(datatype, type_size);
/* find nearest power-of-two less than or equal to comm_size */
pof2 = 1;
while (pof2 <= comm_size) pof2 <<= 1;
......@@ -294,7 +290,7 @@ fn_fail:
int MPIR_Iallreduce_rec_dbl(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
{
int mpi_errno = MPI_SUCCESS;
int pof2, rem, comm_size, is_commutative, rank, type_size;
int pof2, rem, comm_size, is_commutative, rank;
int newrank, mask, newdst, dst;
MPI_Aint true_lb, true_extent, extent;
void *tmp_buf = NULL;
......@@ -323,8 +319,6 @@ int MPIR_Iallreduce_rec_dbl(void *sendbuf, void *recvbuf, int count, MPI_Datatyp
MPID_SCHED_BARRIER(s);
}
MPID_Datatype_get_size_macro(datatype, type_size);
/* find nearest power-of-two less than or equal to comm_size */
pof2 = 1;
while (pof2 <= comm_size) pof2 <<= 1;
......@@ -439,7 +433,7 @@ fn_fail:
int MPIR_Iallreduce_intra(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, MPID_Sched_t s)
{
int mpi_errno = MPI_SUCCESS;
int comm_size, is_homogeneous, pof2, rem, type_size;
int comm_size, is_homogeneous, pof2, type_size;
MPIU_Assert(comm_ptr->comm_kind == MPID_INTRACOMM);
......@@ -464,8 +458,6 @@ int MPIR_Iallreduce_intra(void *sendbuf, void *recvbuf, int count, MPI_Datatype
while (pof2 <= comm_size) pof2 <<= 1;
pof2 >>=1;
rem = comm_size - pof2;
/* If op is user-defined or count is less than pof2, use
recursive doubling algorithm. Otherwise do a reduce-scatter
followed by allgather. (If op is user-defined,
......
......@@ -110,7 +110,7 @@ int MPIR_Ialltoall_bruck(void *sendbuf, int sendcount, MPI_Datatype sendtype, vo
{
int mpi_errno = MPI_SUCCESS;
int i;
int nbytes, sendtype_size, recvtype_size, recvbuf_extent, newtype_size;
int nbytes, recvtype_size, recvbuf_extent, newtype_size;
int rank, comm_size;
void *tmp_buf = NULL;
MPI_Aint sendtype_extent, recvtype_extent, recvtype_true_lb, recvtype_true_extent;
......@@ -126,7 +126,6 @@ int MPIR_Ialltoall_bruck(void *sendbuf, int sendcount, MPI_Datatype sendtype, vo
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
MPID_Datatype_get_size_macro(sendtype, sendtype_size);
MPID_Datatype_get_extent_macro(sendtype, sendtype_extent);
MPID_Datatype_get_size_macro(recvtype, recvtype_size);
MPID_Datatype_get_extent_macro(recvtype, recvtype_extent);
......
......@@ -97,13 +97,12 @@ fn_fail:
int MPIR_Ibarrier_inter(MPID_Comm *comm_ptr, MPID_Sched_t s)
{
int mpi_errno = MPI_SUCCESS;
int size, rank, root;
int rank, root;
MPIR_SCHED_CHKPMEM_DECL(1);
char *buf = NULL;
MPIU_Assert(comm_ptr->comm_kind == MPID_INTERCOMM);
size = comm_ptr->local_size;
rank = comm_ptr->rank;
/* Get the local intracommunicator */
......
......@@ -555,7 +555,7 @@ fn_fail:
int MPIR_Ibcast_scatter_ring_allgather(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
{
int mpi_errno = MPI_SUCCESS;
int comm_size, rank, relative_rank;
int comm_size, rank;
int is_contig, is_homogeneous, type_size, nbytes;
int scatter_size;
int i, j, jnext, left, right;
......@@ -566,7 +566,6 @@ int MPIR_Ibcast_scatter_ring_allgather(void *buffer, int count, MPI_Datatype dat
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
relative_rank = (rank >= root) ? rank - root : rank - root + comm_size;
/* If there is only one process, return */
if (comm_size == 1)
......@@ -671,7 +670,6 @@ int MPIR_Ibcast_SMP(void *buffer, int count, MPI_Datatype datatype, int root, MP
{
int mpi_errno = MPI_SUCCESS;
int type_size, is_homogeneous;
int nbytes=0;
#if !defined(USE_SMP_COLLECTIVES)
MPID_Abort(comm_ptr, MPI_ERR_OTHER, 1, "SMP collectives are disabled!");
......@@ -706,8 +704,6 @@ int MPIR_Ibcast_SMP(void *buffer, int count, MPI_Datatype datatype, int root, MP
else
MPIR_Pack_size_impl(1, datatype, &type_size);
nbytes = type_size * count;
/* TODO insert packing here */
/* send to intranode-rank 0 on the root's node */
......
......@@ -40,7 +40,7 @@ int MPIR_Ireduce_scatter_rec_hlv(void *sendbuf, void *recvbuf, int *recvcnts,
MPI_Aint extent, true_extent, true_lb;
int *disps;
void *tmp_recvbuf, *tmp_results;
int type_size, total_count, nbytes, dst;
int type_size, total_count, dst;
int mask;
int *newcnts, *newdisps, rem, newdst, send_idx, recv_idx,
last_idx, send_cnt, recv_cnt;
......@@ -68,7 +68,6 @@ int MPIR_Ireduce_scatter_rec_hlv(void *sendbuf, void *recvbuf, int *recvcnts,
}
MPID_Datatype_get_size_macro(datatype, type_size);
nbytes = total_count * type_size;
/* allocate temp. buffer to receive incoming data */
MPIR_SCHED_CHKPMEM_MALLOC(tmp_recvbuf, void *, total_count*(MPIR_MAX(true_extent,extent)), mpi_errno, "tmp_recvbuf");
......@@ -405,7 +404,7 @@ int MPIR_Ireduce_scatter_rec_dbl(void *sendbuf, void *recvbuf, int *recvcnts,
MPI_Aint extent, true_extent, true_lb;
int *disps;
void *tmp_recvbuf, *tmp_results;
int type_size, dis[2], blklens[2], total_count, nbytes, dst;
int type_size, dis[2], blklens[2], total_count, dst;
int mask, dst_tree_root, my_tree_root, j, k;
int received;
MPI_Datatype sendtype, recvtype;
......@@ -432,7 +431,6 @@ int MPIR_Ireduce_scatter_rec_dbl(void *sendbuf, void *recvbuf, int *recvcnts,
}
MPID_Datatype_get_size_macro(datatype, type_size);
nbytes = total_count * type_size;
/* total_count*extent eventually gets malloced. it isn't added to
* a user-passed in buffer */
......@@ -668,14 +666,13 @@ static int MPIR_Ireduce_scatter_noncomm(void *sendbuf, void *recvbuf, int *recvc
int i, k;
int recv_offset, send_offset;
int block_size, total_count, size;
MPI_Aint extent, true_extent, true_lb;
MPI_Aint true_extent, true_lb;
int buf0_was_inout;
void *tmp_buf0;
void *tmp_buf1;
void *result_ptr;
MPIR_SCHED_CHKPMEM_DECL(3);
MPID_Datatype_get_extent_macro(datatype, extent);
MPIR_Type_get_true_extent_impl(datatype, &true_lb, &true_extent);
pof2 = 1;
......
......@@ -38,7 +38,7 @@ int MPIR_Ireduce_scatter_block_rec_hlv(void *sendbuf, void *recvbuf, int recvcou
MPI_Aint extent, true_extent, true_lb;
int *disps;
void *tmp_recvbuf, *tmp_results;
int type_size, total_count, nbytes, dst;
int type_size, total_count, dst;
int mask;
int *newcnts, *newdisps, rem, newdst, send_idx, recv_idx,
last_idx, send_cnt, recv_cnt;
......@@ -66,7 +66,6 @@ int MPIR_Ireduce_scatter_block_rec_hlv(void *sendbuf, void *recvbuf, int recvcou
}
MPID_Datatype_get_size_macro(datatype, type_size);
nbytes = total_count * type_size;
/* allocate temp. buffer to receive incoming data */
MPIR_SCHED_CHKPMEM_MALLOC(tmp_recvbuf, void *, total_count*(MPIR_MAX(true_extent,extent)), mpi_errno, "tmp_recvbuf");
......@@ -395,7 +394,7 @@ int MPIR_Ireduce_scatter_block_rec_dbl(void *sendbuf, void *recvbuf, int recvcou
MPI_Aint extent, true_extent, true_lb;
int *disps;
void *tmp_recvbuf, *tmp_results;
int type_size, dis[2], blklens[2], total_count, nbytes, dst;
int type_size, dis[2], blklens[2], total_count, dst;
int mask, dst_tree_root, my_tree_root, j, k;
int received;
MPI_Datatype sendtype, recvtype;
......@@ -422,7 +421,6 @@ int MPIR_Ireduce_scatter_block_rec_dbl(void *sendbuf, void *recvbuf, int recvcou
}
MPID_Datatype_get_size_macro(datatype, type_size);
nbytes = total_count * type_size;
/* total_count*extent eventually gets malloced. it isn't added to
* a user-passed in buffer */
......@@ -651,14 +649,13 @@ int MPIR_Ireduce_scatter_block_noncomm(void *sendbuf, void *recvbuf, int recvcou
int i, k;
int recv_offset, send_offset;
int block_size, total_count, size;
MPI_Aint extent, true_extent, true_lb;
MPI_Aint true_extent, true_lb;
int buf0_was_inout;
void *tmp_buf0;
void *tmp_buf1;
void *result_ptr;
MPIR_SCHED_CHKPMEM_DECL(2);
MPID_Datatype_get_extent_macro(datatype, extent);
MPIR_Type_get_true_extent_impl(datatype, &true_lb, &true_extent);
pof2 = 1;
......
......@@ -226,7 +226,7 @@ fn_fail:
int MPIR_Ireduce_redscat_gather(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
{
int mpi_errno = MPI_SUCCESS;
int i, j, comm_size, rank, type_size, pof2, is_commutative;
int i, j, comm_size, rank, pof2, is_commutative;
int rem, dst, newrank, newdst, mask, send_idx, recv_idx, last_idx;
int send_cnt, recv_cnt, newroot, newdst_tree_root, newroot_tree_root;
void *tmp_buf = NULL;
......@@ -243,7 +243,6 @@ int MPIR_Ireduce_redscat_gather(void *sendbuf, void *recvbuf, int count, MPI_Dat
MPIU_Assert(is_commutative);
/* Create a temporary buffer */
MPID_Datatype_get_size_macro(datatype, type_size);
MPIR_Type_get_true_extent_impl(datatype, &true_lb, &true_extent);
MPID_Datatype_get_extent_macro(datatype, extent);
......@@ -533,12 +532,11 @@ fn_fail:
int MPIR_Ireduce_intra(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
{
int mpi_errno = MPI_SUCCESS;
int is_commutative, pof2, type_size, comm_size;
int pof2, type_size, comm_size;
MPIU_Assert(comm_ptr->comm_kind == MPID_INTRACOMM);
comm_size = comm_ptr->local_size;
is_commutative = MPIR_Op_is_commutative(op);
MPID_Datatype_get_size_macro(datatype, type_size);
......
......@@ -51,31 +51,16 @@ static int MPIR_Reduce_scatter_noncomm (
int i, k;
int recv_offset, send_offset;
int block_size, total_count, size;
MPI_Aint extent, true_extent, true_lb;
int is_commutative;
MPI_Aint true_extent, true_lb;
int buf0_was_inout;
void *tmp_buf0;
void *tmp_buf1;
void *result_ptr;
MPI_Comm comm = comm_ptr->handle;
MPID_Op *op_ptr;
MPIU_CHKLMEM_DECL(3);
MPID_Datatype_get_extent_macro(datatype, extent);
MPIR_Type_get_true_extent_impl(datatype, &true_lb, &true_extent);
if (HANDLE_GET_KIND(op) == HANDLE_KIND_BUILTIN) {
is_commutative = 1;
}
else {
MPID_Op_get_ptr(op, op_ptr);
if (op_ptr->kind == MPID_OP_USER_NONCOMMUTE)
is_commutative = 0;
else
is_commutative = 1;
}
pof2 = 1;
log2_comm_size = 0;
while (pof2 < comm_size) {
......
......@@ -60,31 +60,16 @@ static int MPIR_Reduce_scatter_block_noncomm (
int i, k;
int recv_offset, send_offset;
int block_size, total_count, size;
MPI_Aint extent, true_extent, true_lb;
int is_commutative;
MPI_Aint true_extent, true_lb;
int buf0_was_inout;
void *tmp_buf0;
void *tmp_buf1;
void *result_ptr;
MPI_Comm comm = comm_ptr->handle;
MPID_Op *op_ptr;
MPIU_CHKLMEM_DECL(3);
MPID_Datatype_get_extent_macro(datatype, extent);
MPIR_Type_get_true_extent_impl(datatype, &true_lb, &true_extent);
if (HANDLE_GET_KIND(op) == HANDLE_KIND_BUILTIN) {
is_commutative = 1;
}
else {
MPID_Op_get_ptr(op, op_ptr);
if (op_ptr->kind == MPID_OP_USER_NONCOMMUTE)
is_commutative = 0;
else
is_commutative = 1;
}
pof2 = 1;
log2_comm_size = 0;
while (pof2 < comm_size) {
......
......@@ -252,13 +252,12 @@ static int MPIR_Reduce_redscat_gather (
{
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
int comm_size, rank, is_commutative, type_size, pof2, rem, newrank;
int comm_size, rank, type_size, pof2, rem, newrank;
int mask, *cnts, *disps, i, j, send_idx=0;
int recv_idx, last_idx=0, newdst;
int dst, send_cnt, recv_cnt, newroot, newdst_tree_root, newroot_tree_root;
MPI_Aint true_lb, true_extent, extent;
void *tmp_buf;
MPID_Op *op_ptr;
MPI_Comm comm;
MPIU_CHKLMEM_DECL(4);
MPIU_THREADPRIV_DECL;
......@@ -276,17 +275,6 @@ static int MPIR_Reduce_redscat_gather (
MPIR_Type_get_true_extent_impl(datatype, &true_lb, &true_extent);
MPID_Datatype_get_extent_macro(datatype, extent);
if (HANDLE_GET_KIND(op) == HANDLE_KIND_BUILTIN) {
is_commutative = 1;
}
else {
MPID_Op_get_ptr(op, op_ptr);
if (op_ptr->kind == MPID_OP_USER_NONCOMMUTE)
is_commutative = 0;
else
is_commutative = 1;
}
/* I think this is the worse case, so we can avoid an assert()
* inside the for loop */
/* should be buf+{this}? */
......
......@@ -42,7 +42,7 @@ int MPIR_Comm_split_type_impl(MPID_Comm * comm_ptr, int split_type, int key,
}
else {
mpi_errno =
MPID_Comm_fns->split_type(comm_ptr, split_type, info_ptr, key, newcomm_ptr);
MPID_Comm_fns->split_type(comm_ptr, split_type, key, info_ptr, newcomm_ptr);
}
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
......
......@@ -186,9 +186,8 @@ int MPIR_Err_return_comm( MPID_Comm *comm_ptr, const char fcname[],
{
const int error_class = ERROR_GET_CLASS(errcode);
MPID_Errhandler *errhandler = NULL;
int rc;
rc = checkValidErrcode( error_class, fcname, &errcode );
checkValidErrcode( error_class, fcname, &errcode );