commits
Threads by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
October 2013
- 1 participants
- 29 discussions
[mpich] MPICH primary repository branch, master, updated. v3.1b1-167-g0746bdd
by noreply@mpich.org 31 Oct '13
by noreply@mpich.org 31 Oct '13
31 Oct '13
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 0746bdd3f136cf132f8598a67e7ea444f6aab178 (commit)
from b232ae18c131d09d6727393d8b274f32cd9404e4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/0746bdd3f136cf132f8598a67e7ea444f…
commit 0746bdd3f136cf132f8598a67e7ea444f6aab178
Author: Wesley Bland <wbland(a)mcs.anl.gov>
Date: Thu Oct 31 16:07:18 2013 -0500
Fix bad quote character in the last commit.
Apparently my copy/paste was insufficient and I missed this. Sorry about the
multi-commit.
diff --git a/src/pm/hydra/ui/mpich/utils.c b/src/pm/hydra/ui/mpich/utils.c
index 3d6772c..cf6c797 100644
--- a/src/pm/hydra/ui/mpich/utils.c
+++ b/src/pm/hydra/ui/mpich/utils.c
@@ -48,7 +48,7 @@ static HYD_status get_current_exec(struct HYD_exec **exec)
static void help_help_fn(void)
{
printf("\n");
- printf("Usage: ./mpiexec [global opts] [local opts for exec1] [exec1] [exec1 args] : [local opts for exec2] [exec2] [exec2 args] : ...\n\n”);
+ printf("Usage: ./mpiexec [global opts] [local opts for exec1] [exec1] [exec1 args] : [local opts for exec2] [exec2] [exec2 args] : ...\n\n");
printf("Global options (passed to all executables):\n");
-----------------------------------------------------------------------
Summary of changes:
src/pm/hydra/ui/mpich/utils.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1b1-166-gb232ae1
by noreply@mpich.org 31 Oct '13
by noreply@mpich.org 31 Oct '13
31 Oct '13
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via b232ae18c131d09d6727393d8b274f32cd9404e4 (commit)
from 12478f2f41665a2c207333b16215c30e853dfa99 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/b232ae18c131d09d6727393d8b274f32c…
commit b232ae18c131d09d6727393d8b274f32cd9404e4
Author: Wesley Bland <wbland(a)mcs.anl.gov>
Date: Thu Oct 31 14:37:50 2013 -0500
Reword the mpiexec usage guide.
The guide was a little unclear about how to use local options for mpiexec
executables when running multiple programs (mpiexec -n 1 exec1 : -n 2 exec2).
Now it says:
Usage: mpiexec [global opts] [local opts for exec1] [exec1] [exec1 args] : ...
Fixes #1936
diff --git a/src/pm/hydra/ui/mpich/utils.c b/src/pm/hydra/ui/mpich/utils.c
index fb86e42..3d6772c 100644
--- a/src/pm/hydra/ui/mpich/utils.c
+++ b/src/pm/hydra/ui/mpich/utils.c
@@ -48,7 +48,7 @@ static HYD_status get_current_exec(struct HYD_exec **exec)
static void help_help_fn(void)
{
printf("\n");
- printf("Usage: ./mpiexec [global opts] [exec1 local opts] : [exec2 local opts] : ...\n\n");
+ printf("Usage: ./mpiexec [global opts] [local opts for exec1] [exec1] [exec1 args] : [local opts for exec2] [exec2] [exec2 args] : ...\n\n”);
printf("Global options (passed to all executables):\n");
-----------------------------------------------------------------------
Summary of changes:
src/pm/hydra/ui/mpich/utils.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1b1-165-g12478f2
by noreply@mpich.org 31 Oct '13
by noreply@mpich.org 31 Oct '13
31 Oct '13
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 12478f2f41665a2c207333b16215c30e853dfa99 (commit)
via 9f8bc14f1fb1c61535a928b0dbab59b2794bc773 (commit)
via 0f06d7ac36d5b510992cf071067f22618fdc1aa7 (commit)
via e289f45f4e42a310e994a7a9c05ab6ffe44a5e73 (commit)
via 255780e99270ad931b33d0480a76555f780b6849 (commit)
via d15c4289c05f26afcd1fa8806c941bcd916b182d (commit)
via 6f267e79b478df773d2343a6738e1cfadd28c995 (commit)
via bf57cc474ad6e29469bd91dd67b680c533edcd02 (commit)
via 91e91a4027c734b2d994aa10671f3e99f71465c7 (commit)
via e192ccc594a0f086c4bb5239d413df0e1f3d4f03 (commit)
via 615d1acb0578253395f4fb9b00d07f52cb30482a (commit)
via e6962c162c743eb130e732e1d3ae8a8f6f7c719c (commit)
via d4e6334c3ae2ae9925306087051b5a930d9ffde2 (commit)
via c66f901220b086cda4cdc5d3739abc66a885bee0 (commit)
via e527fa1dea458e32f97083d49e8689666e5bb363 (commit)
via e518cb4c0c80bf14b5eb828fc32397991a8d38e8 (commit)
via d1bf416117ccff40533f9c3007ba2859b944fb47 (commit)
from 4f691ba86f15151b51ec808943a2b940887c5e22 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/12478f2f41665a2c207333b16215c30e8…
commit 12478f2f41665a2c207333b16215c30e853dfa99
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Fri Oct 18 16:54:12 2013 -0500
type promotion for MPIR_Bsend structure
configure determines the right type for MPI_Aint, MPI_Fint, and
MPI_Count, so we have to move the MPIR_Bsend checks later in configure.
Then we can promote a plain int to MPI_Aint.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/configure.ac b/configure.ac
index 5d7bf15..5300fa8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4486,29 +4486,6 @@ int main(int argc, char **argv )
AC_DEFINE(HAVE_ANY_INT32_T_ALIGNMENT,1,[Define if int32_t works with any alignment])
fi
fi
-
-# Get the size for the bsendoverhead
-AC_CHECK_SIZEOF(MPIR_Bsend_data_t,0,[
-#define MPI_Datatype int
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#include "${master_top_srcdir}/src/include/mpibsend.h"]
-)
-if test "$ac_cv_sizeof_MPIR_Bsend_data_t" = "0" ; then
- AC_MSG_ERROR([Unable to determine the size of MPI_BSEND_OVERHEAD])
- # In the past, a default of 128 was used (still likely good enough),
- # but the autoconf SIZEOF macro has been changed to ignore the second
- # argument, so code that depended on the prior defined behavior now
- # silently breaks.
-fi
-BSEND_OVERHEAD=$ac_cv_sizeof_MPIR_Bsend_data_t
-export BSEND_OVERHEAD
-AC_SUBST(BSEND_OVERHEAD)
-
# Check for special compile characteristics
# If we are either gcc or icc, see if we can use __asm__
# We test on prog_gcc to allow gcc by any name; if we are using
@@ -5244,6 +5221,31 @@ AC_DEFINE_UNQUOTED(MPIU_SIZE_T,$MPIU_SIZE_T,[Set to a type that can express the
if test "$ac_cv_sizeof_void_p" -lt "$aint_size" ; then
AC_DEFINE(USE_AINT_FOR_ATTRVAL,1,[Define if MPI_Aint should be used instead of void * for storing attribute values])
fi
+
+# with MPI_AINT defined, now we can
+# Get the size for the bsendoverhead
+AC_CHECK_SIZEOF(MPIR_Bsend_data_t,0,[
+#define MPI_Datatype int
+typedef $MPI_AINT MPI_Aint;
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include "${master_top_srcdir}/src/include/mpibsend.h"]
+)
+if test "$ac_cv_sizeof_MPIR_Bsend_data_t" = "0" ; then
+ AC_MSG_ERROR([Unable to determine the size of MPI_BSEND_OVERHEAD])
+ # In the past, a default of 128 was used (still likely good enough),
+ # but the autoconf SIZEOF macro has been changed to ignore the second
+ # argument, so code that depended on the prior defined behavior now
+ # silently breaks.
+fi
+BSEND_OVERHEAD=$ac_cv_sizeof_MPIR_Bsend_data_t
+export BSEND_OVERHEAD
+AC_SUBST(BSEND_OVERHEAD)
+
#
# See if we need to update the timer type (which was converted to uppercase)
if test "$timer_type" = "DEVICE" ; then
diff --git a/src/include/mpibsend.h b/src/include/mpibsend.h
index 05b7c7d..91996d7 100644
--- a/src/include/mpibsend.h
+++ b/src/include/mpibsend.h
@@ -53,7 +53,7 @@ struct MPID_Comm;
request is not currently available */
typedef struct MPIR_Bsend_msg {
void *msgbuf;
- int count; /* int type to match needs of Pack routine */
+ MPI_Aint count;
MPI_Datatype dtype;
int tag;
struct MPID_Comm *comm_ptr;
http://git.mpich.org/mpich.git/commitdiff/9f8bc14f1fb1c61535a928b0dbab59b27…
commit 9f8bc14f1fb1c61535a928b0dbab59b2794bc773
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Fri Oct 18 16:25:57 2013 -0500
defective MPI_Pack/Unpack/Pack_size interface
MPI_Pack, MPI_Unpack, and MPI_Pack_size use integers to describe counts
of bytes and posistions in a bytestream. In a world of 2 GiB+
datatypes, this is not correct. It will take an army to change the
standard, but we can at least do the right thing internally.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index 4eb398d..4786d60 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -4375,9 +4375,9 @@ int MPIR_Type_indexed_impl(int count, const int blocklens[], const int indices[]
void MPIR_Type_free_impl(MPI_Datatype *datatype);
int MPIR_Type_vector_impl(int count, int blocklength, int stride, MPI_Datatype old_type, MPI_Datatype *newtype_p);
int MPIR_Type_struct_impl(int count, const int blocklens[], const MPI_Aint indices[], const MPI_Datatype old_types[], MPI_Datatype *newtype);
-int MPIR_Pack_impl(const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, int outcount, int *position);
-void MPIR_Pack_size_impl(int incount, MPI_Datatype datatype, int *size);
-int MPIR_Unpack_impl(const void *inbuf, int insize, int *position,
+int MPIR_Pack_impl(const void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outcount, MPI_Aint *position);
+void MPIR_Pack_size_impl(int incount, MPI_Datatype datatype, MPI_Aint *size);
+int MPIR_Unpack_impl(const void *inbuf, MPI_Aint insize, MPI_Aint *position,
void *outbuf, int outcount, MPI_Datatype datatype);
void MPIR_Type_lb_impl(MPI_Datatype datatype, MPI_Aint *displacement);
int MPIR_Ibsend_impl(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
diff --git a/src/mpi/coll/alltoall.c b/src/mpi/coll/alltoall.c
index 921852b..96e1f9b 100644
--- a/src/mpi/coll/alltoall.c
+++ b/src/mpi/coll/alltoall.c
@@ -91,7 +91,8 @@ int MPIR_Alltoall_intra(
int mpi_errno=MPI_SUCCESS, src, dst, rank, nbytes;
int mpi_errno_ret = MPI_SUCCESS;
MPI_Status status;
- int sendtype_size, pack_size, block, position, *displs, count;
+ int sendtype_size, block, *displs, count;
+ MPI_Aint pack_size, position;
MPI_Datatype newtype = MPI_DATATYPE_NULL;
void *tmp_buf;
MPI_Comm comm;
diff --git a/src/mpi/coll/bcast.c b/src/mpi/coll/bcast.c
index f644bfd..6b56ad7 100644
--- a/src/mpi/coll/bcast.c
+++ b/src/mpi/coll/bcast.c
@@ -47,7 +47,7 @@ static int MPIR_Bcast_binomial(
MPI_Status status;
int is_contig, is_homogeneous;
MPI_Aint type_size;
- int position;
+ MPI_Aint position;
void *tmp_buf=NULL;
MPI_Comm comm;
MPID_Datatype *dtp;
@@ -404,7 +404,8 @@ static int MPIR_Bcast_scatter_doubling_allgather(
int j, k, i, tmp_mask, is_contig, is_homogeneous;
MPI_Aint type_size, nbytes = 0;
int relative_dst, dst_tree_root, my_tree_root, send_offset;
- int recv_offset, tree_root, nprocs_completed, offset, position;
+ int recv_offset, tree_root, nprocs_completed, offset;
+ MPI_Aint position;
MPIU_CHKLMEM_DECL(1);
MPI_Comm comm;
MPID_Datatype *dtp;
@@ -707,10 +708,9 @@ static int MPIR_Bcast_scatter_ring_allgather(
int rank, comm_size;
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
- int scatter_size, nbytes;
+ int scatter_size;
int j, i, is_contig, is_homogeneous;
- MPI_Aint type_size;
- int position;
+ MPI_Aint nbytes, type_size, position;
int left, right, jnext;
int curr_size = 0;
void *tmp_buf;
@@ -1143,7 +1143,8 @@ int MPIR_Bcast_intra (
int mpi_errno_ret = MPI_SUCCESS;
int comm_size;
int nbytes=0;
- int type_size, is_homogeneous;
+ int is_homogeneous;
+ MPI_Aint type_size;
MPID_MPI_STATE_DECL(MPID_STATE_MPIR_BCAST);
MPID_MPI_FUNC_ENTER(MPID_STATE_MPIR_BCAST);
diff --git a/src/mpi/coll/helper_fns.c b/src/mpi/coll/helper_fns.c
index 1c16730..8fbaedf 100644
--- a/src/mpi/coll/helper_fns.c
+++ b/src/mpi/coll/helper_fns.c
@@ -493,8 +493,8 @@ int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
MPID_Request *sreq;
MPID_Request *rreq;
void *tmpbuf = NULL;
- int tmpbuf_size = 0;
- int tmpbuf_count = 0;
+ MPI_Aint tmpbuf_size = 0;
+ MPI_Aint tmpbuf_count = 0;
MPID_Comm *comm_ptr;
MPIU_CHKLMEM_DECL(1);
MPIDI_STATE_DECL(MPID_STATE_MPIC_SENDRECV_REPLACE_FT);
diff --git a/src/mpi/coll/ibcast.c b/src/mpi/coll/ibcast.c
index f80d6d2..483c335 100644
--- a/src/mpi/coll/ibcast.c
+++ b/src/mpi/coll/ibcast.c
@@ -40,8 +40,8 @@ int MPIR_Ibcast_binomial(void *buffer, int count, MPI_Datatype datatype, int roo
int mpi_errno = MPI_SUCCESS;
int mask;
int comm_size, rank;
- int type_size, is_contig, is_homogeneous;
- int nbytes;
+ int is_contig, is_homogeneous;
+ MPI_Aint nbytes, type_size;
int relative_rank;
int src, dst;
void *tmp_buf = NULL;
@@ -669,7 +669,8 @@ fn_fail:
int MPIR_Ibcast_SMP(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, MPID_Sched_t s)
{
int mpi_errno = MPI_SUCCESS;
- int type_size, is_homogeneous;
+ int is_homogeneous;
+ MPI_Aint type_size;
if (!MPIR_CVAR_ENABLE_SMP_COLLECTIVES || !MPIR_CVAR_ENABLE_SMP_BCAST)
MPID_Abort(comm_ptr, MPI_ERR_OTHER, 1, "SMP collectives are disabled!");
@@ -754,7 +755,8 @@ fn_fail:
int MPIR_Ibcast_intra(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, is_homogeneous, type_size, nbytes;
+ int comm_size, is_homogeneous;
+ MPI_Aint type_size, nbytes;
MPIU_Assert(comm_ptr->comm_kind == MPID_INTRACOMM);
diff --git a/src/mpi/datatype/pack.c b/src/mpi/datatype/pack.c
index 54b607d..fb5456c 100644
--- a/src/mpi/datatype/pack.c
+++ b/src/mpi/datatype/pack.c
@@ -31,8 +31,8 @@ int MPIR_Pack_impl(const void *inbuf,
int incount,
MPI_Datatype datatype,
void *outbuf,
- int outsize,
- int *position)
+ MPI_Aint outsize,
+ MPI_Aint *position)
{
int mpi_errno = MPI_SUCCESS;
MPI_Aint first, last;
@@ -151,6 +151,7 @@ int MPI_Pack(const void *inbuf,
MPI_Comm comm)
{
int mpi_errno = MPI_SUCCESS;
+ MPI_Aint position_x;
MPID_Comm *comm_ptr = NULL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_PACK);
@@ -240,7 +241,9 @@ int MPI_Pack(const void *inbuf,
/* ... body of routine ... */
- mpi_errno = MPIR_Pack_impl(inbuf, incount, datatype, outbuf, outsize, position);
+ position_x = *position;
+ mpi_errno = MPIR_Pack_impl(inbuf, incount, datatype, outbuf, outsize, &position_x);
+ MPIU_Assign_trunc(*position, position_x, int);
if (mpi_errno) goto fn_fail;
/* ... end of body of routine ... */
diff --git a/src/mpi/datatype/pack_size.c b/src/mpi/datatype/pack_size.c
index 4f69a14..a4ef60a 100644
--- a/src/mpi/datatype/pack_size.c
+++ b/src/mpi/datatype/pack_size.c
@@ -27,9 +27,9 @@
#define FUNCNAME MPIR_Pack_size_impl
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
-void MPIR_Pack_size_impl(int incount, MPI_Datatype datatype, int *size)
+void MPIR_Pack_size_impl(int incount, MPI_Datatype datatype, MPI_Aint *size)
{
- int typesize;
+ MPI_Aint typesize;
MPID_Datatype_get_size_macro(datatype, typesize);
*size = incount * typesize;
}
@@ -76,6 +76,7 @@ int MPI_Pack_size(int incount,
{
MPID_Comm *comm_ptr = NULL;
int mpi_errno = MPI_SUCCESS;
+ MPI_Aint size_x = MPI_UNDEFINED;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_PACK_SIZE);
MPIR_ERRTEST_INITIALIZED_ORDIE();
@@ -124,8 +125,9 @@ int MPI_Pack_size(int incount,
/* ... body of routine ... */
- MPIR_Pack_size_impl(incount, datatype, size);
-
+ MPIR_Pack_size_impl(incount, datatype, &size_x);
+ MPIU_Assign_trunc(*size, size_x, int);
+
/* ... end of body of routine ... */
#ifdef HAVE_ERROR_CHECKING
diff --git a/src/mpi/datatype/unpack.c b/src/mpi/datatype/unpack.c
index b468068..bb567a0 100644
--- a/src/mpi/datatype/unpack.c
+++ b/src/mpi/datatype/unpack.c
@@ -27,7 +27,7 @@
#define FUNCNAME MPIR_Unpack_impl
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
-int MPIR_Unpack_impl(const void *inbuf, int insize, int *position,
+int MPIR_Unpack_impl(const void *inbuf, MPI_Aint insize, MPI_Aint *position,
void *outbuf, int outcount, MPI_Datatype datatype)
{
int mpi_errno = MPI_SUCCESS;
@@ -137,6 +137,7 @@ int MPI_Unpack(const void *inbuf, int insize, int *position,
MPI_Comm comm)
{
int mpi_errno = MPI_SUCCESS;
+ MPI_Aint position_x;
MPID_Comm *comm_ptr = NULL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_UNPACK);
@@ -193,8 +194,10 @@ int MPI_Unpack(const void *inbuf, int insize, int *position,
/* ... body of routine ... */
- mpi_errno = MPIR_Unpack_impl(inbuf, insize, position, outbuf, outcount, datatype);
+ position_x = *position;
+ mpi_errno = MPIR_Unpack_impl(inbuf, insize, &position_x, outbuf, outcount, datatype);
if (mpi_errno) goto fn_fail;
+ MPIU_Assign_trunc(*position, position_x, int);
/* ... end of body of routine ... */
diff --git a/src/mpi/pt2pt/bsendutil.c b/src/mpi/pt2pt/bsendutil.c
index 6c2dda0..5309e9f 100644
--- a/src/mpi/pt2pt/bsendutil.c
+++ b/src/mpi/pt2pt/bsendutil.c
@@ -213,7 +213,8 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
int mpi_errno = MPI_SUCCESS;
MPIR_Bsend_data_t *p;
MPIR_Bsend_msg_t *msg;
- int packsize, pass;
+ MPI_Aint packsize;
+ int pass;
/* Find a free segment and copy the data into it. If we could
have, we would already have used tBsend to send the message with
@@ -234,7 +235,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
else
packsize = count;
- MPIU_DBG_MSG_D(BSEND,TYPICAL,"looking for buffer of size %d", packsize);
+ MPIU_DBG_MSG_D(BSEND,TYPICAL,"looking for buffer of size %ld", packsize);
/*
* Use two passes. Each pass is the same; between the two passes,
* attempt to complete any active requests, and start any pending
@@ -246,7 +247,7 @@ int MPIR_Bsend_isend(const void *buf, int count, MPI_Datatype dtype,
p = MPIR_Bsend_find_buffer( packsize );
if (p) {
MPIU_DBG_MSG_FMT(BSEND,TYPICAL,(MPIU_DBG_FDEST,
- "found buffer of size %d with address %p",packsize,p));
+ "found buffer of size %ld with address %p",packsize,p));
/* Found a segment */
msg = &p->msg;
diff --git a/src/mpi/pt2pt/sendrecv_rep.c b/src/mpi/pt2pt/sendrecv_rep.c
index 4e022ac..dda4dd7 100644
--- a/src/mpi/pt2pt/sendrecv_rep.c
+++ b/src/mpi/pt2pt/sendrecv_rep.c
@@ -140,8 +140,8 @@ int MPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
MPID_Request * sreq;
MPID_Request * rreq;
void * tmpbuf = NULL;
- int tmpbuf_size = 0;
- int tmpbuf_count = 0;
+ MPI_Aint tmpbuf_size = 0;
+ MPI_Aint tmpbuf_count = 0;
if (count > 0 && dest != MPI_PROC_NULL)
{
http://git.mpich.org/mpich.git/commitdiff/0f06d7ac36d5b510992cf071067f22618…
commit 0f06d7ac36d5b510992cf071067f22618fdc1aa7
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Mon Oct 28 09:56:05 2013 -0500
remove MPIR_Type_get_contig_blocks
MPIR_Type_get_contig_blocks is buggy for certain datatypes (example:
HDF5 multi-dataset IO generated type results in a contig block count of
5 billion. should be more like 200). Nothing uses this function except
ROMIO's flattening code. I'd like to see profiling suggesting the count
of contiguous blocks is a profitable short-circuit before spending a ton
of time debugging it.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpi/romio/adio/common/flatten.c b/src/mpi/romio/adio/common/flatten.c
index 2f995eb..420ef21 100644
--- a/src/mpi/romio/adio/common/flatten.c
+++ b/src/mpi/romio/adio/common/flatten.c
@@ -733,13 +733,6 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
*/
MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, MPI_Count *curr_index)
{
-#ifdef HAVE_MPIR_TYPE_GET_CONTIG_BLOCKS
- /* MPICH can get us this value without all the envelope/contents calls */
- MPI_Count blks;
- MPIR_Type_get_contig_blocks(datatype, &blks);
- *curr_index = blks;
- return blks;
-#else
int i, n;
MPI_Count count=0, prev_index, num, basic_num;
int top_count, combiner, old_combiner, old_is_contig;
@@ -1008,7 +1001,6 @@ MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, MPI_Count *curr_i
ADIOI_Free(adds);
ADIOI_Free(types);
return count;
-#endif /* HAVE_MPIR_TYPE_GET_CONTIG_BLOCKS */
}
/* removezeros() make a second pass over the
diff --git a/src/mpi/romio/adio/include/adioi.h b/src/mpi/romio/adio/include/adioi.h
index 4eb926a..ea07491 100644
--- a/src/mpi/romio/adio/include/adioi.h
+++ b/src/mpi/romio/adio/include/adioi.h
@@ -559,9 +559,6 @@ int ADIOI_Error(ADIO_File fd, int error_code, char *string);
int MPIR_Err_setmsg( int, int, const char *, const char *, const char *, ... );
int ADIOI_End_call(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state);
int MPIR_Status_set_bytes(MPI_Status *status, MPI_Datatype datatype, MPI_Count nbytes);
-#ifdef HAVE_MPIR_TYPE_GET_CONTIG_BLOCKS
-MPI_Count MPIR_Type_get_contig_blocks(MPI_Datatype datatype, MPI_Count *nr_blocks_p);
-#endif
int ADIOI_Uses_generic_read(ADIO_File fd);
int ADIOI_Uses_generic_write(ADIO_File fd);
int ADIOI_Err_create_code(const char *myname, const char *filename, int my_errno);
diff --git a/src/mpid/common/datatype/Makefile.mk b/src/mpid/common/datatype/Makefile.mk
index 5a91f55..31a8c64 100644
--- a/src/mpid/common/datatype/Makefile.mk
+++ b/src/mpid/common/datatype/Makefile.mk
@@ -29,8 +29,7 @@ lib_lib@MPILIBNAME@_la_SOURCES += \
src/mpid/common/datatype/mpid_type_struct.c \
src/mpid/common/datatype/mpid_type_vector.c \
src/mpid/common/datatype/mpid_type_zerolen.c \
- src/mpid/common/datatype/mpir_type_flatten.c \
- src/mpid/common/datatype/mpir_type_get_contig_blocks.c
+ src/mpid/common/datatype/mpir_type_flatten.c
# there are no AC_OUTPUT_FILES headers, so builddir is unnecessary
AM_CPPFLAGS += -I$(top_srcdir)/src/mpid/common/datatype
diff --git a/src/mpid/common/datatype/mpir_type_get_contig_blocks.c b/src/mpid/common/datatype/mpir_type_get_contig_blocks.c
deleted file mode 100644
index 6b3d9d6..0000000
--- a/src/mpid/common/datatype/mpir_type_get_contig_blocks.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-
-/*
- * (C) 2001 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-
-#include <mpiimpl.h>
-#include <mpid_dataloop.h>
-#include <stdlib.h>
-
-/*@
- MPIR_Type_get_contig_blocks
-
-Input Parameters:
-. type - MPI Datatype (must have been committed)
-
-Output Parameters:
-. nr_blocks_p - pointer to int in which to store the number of contiguous blocks in the type
-
-
- Return Value:
- 0 on success, -1 on failure.
-@*/
-
-MPI_Count MPIR_Type_get_contig_blocks(MPI_Datatype type,
- MPI_Count *nr_blocks_p)
-{
- MPID_Datatype *datatype_ptr;
-
- if (HANDLE_GET_KIND(type) == HANDLE_KIND_BUILTIN) {
- *nr_blocks_p = 1;
- return 0;
- }
-
- MPID_Datatype_get_ptr(type, datatype_ptr);
- MPIU_Assert(datatype_ptr->is_committed);
-
- *nr_blocks_p = datatype_ptr->max_contig_blocks;
- return 0;
-}
http://git.mpich.org/mpich.git/commitdiff/e289f45f4e42a310e994a7a9c05ab6ffe…
commit e289f45f4e42a310e994a7a9c05ab6ffe44a5e73
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Fri Oct 18 16:22:25 2013 -0500
casting to make formatting happy
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpid/common/datatype/mpid_segment.c b/src/mpid/common/datatype/mpid_segment.c
index 65e4afb..412e7eb 100644
--- a/src/mpid/common/datatype/mpid_segment.c
+++ b/src/mpid/common/datatype/mpid_segment.c
@@ -321,8 +321,8 @@ static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
", blks=" MPI_AINT_FMT_DEC_SPEC,
(MPI_Aint) rel_off,
bufp,
- paramp->u.pack_vector.length,
- paramp->u.pack_vector.index,
+ (MPI_Aint) paramp->u.pack_vector.length,
+ (MPI_Aint) paramp->u.pack_vector.index,
count,
blksz,
(MPI_Aint) stride,
http://git.mpich.org/mpich.git/commitdiff/255780e99270ad931b33d0480a76555f7…
commit 255780e99270ad931b33d0480a76555f780b6849
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Fri Oct 18 16:21:34 2013 -0500
Small parens-related warning with clang
clang carped about too many parens around (( a == b))
Fixes #1929
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_win_fns.c b/src/mpid/ch3/channels/nemesis/src/ch3_win_fns.c
index 89ef6f9..cdec858 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_win_fns.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_win_fns.c
@@ -85,7 +85,7 @@ static int MPIDI_CH3I_Win_allocate_shm(MPI_Aint size, int disp_unit, MPID_Info *
char alloc_shared_nctg_value[MPI_MAX_INFO_VAL+1];
MPIR_Info_get_impl(info, "alloc_shared_noncontig", MPI_MAX_INFO_VAL,
alloc_shared_nctg_value, &alloc_shared_nctg_flag);
- if ((alloc_shared_nctg_flag == 1)) {
+ if (alloc_shared_nctg_flag == 1) {
if (!strncmp(alloc_shared_nctg_value, "true", strlen("true")))
(*win_ptr)->info_args.alloc_shared_noncontig = 1;
if (!strncmp(alloc_shared_nctg_value, "false", strlen("false")))
http://git.mpich.org/mpich.git/commitdiff/d15c4289c05f26afcd1fa8806c941bcd9…
commit d15c4289c05f26afcd1fa8806c941bcd916b182d
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Wed Oct 16 10:59:42 2013 -0500
A round of 64-to-32 warning squashes
formatting fixes and type promotions to chip away at the 1500 lines of
warnings that pop up with clang's -Wshorten-64-to-32 flag.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpi/romio/adio/ad_testfs/ad_testfs_seek.c b/src/mpi/romio/adio/ad_testfs/ad_testfs_seek.c
index d5ef7c3..a2f6234 100644
--- a/src/mpi/romio/adio/ad_testfs/ad_testfs_seek.c
+++ b/src/mpi/romio/adio/ad_testfs/ad_testfs_seek.c
@@ -28,8 +28,8 @@ ADIO_Offset ADIOI_TESTFS_SeekIndividual(ADIO_File fd, ADIO_Offset offset,
int i, n_etypes_in_filetype, n_filetypes, etype_in_filetype;
ADIO_Offset abs_off_in_filetype=0, sum;
int size_in_filetype;
- int filetype_size, etype_size, filetype_is_contig;
- MPI_Aint filetype_extent;
+ int filetype_size, filetype_is_contig;
+ MPI_Aint etype_size, filetype_extent;
*error_code = MPI_SUCCESS;
diff --git a/src/mpi/romio/adio/common/ad_coll_exch_new.c b/src/mpi/romio/adio/common/ad_coll_exch_new.c
index 62c9282..08fb83a 100644
--- a/src/mpi/romio/adio/common/ad_coll_exch_new.c
+++ b/src/mpi/romio/adio/common/ad_coll_exch_new.c
@@ -134,7 +134,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type,
ADIOI_Flatlist_node *flat_mem_p = NULL, *flat_file_p = NULL;
int memtype_sz = -1;
int memtype_is_contig = -1;
- int filetype_sz = -1;
+ ADIO_Offset filetype_sz = -1;
#ifdef AGGREGATION_PROFILE
MPE_Log_event (5014, 0, NULL);
@@ -157,7 +157,7 @@ void ADIOI_Exch_file_views(int myrank, int nprocs, int file_ptr_type,
}
MPI_Type_extent(fd->filetype, &filetype_extent);
- MPI_Type_size(fd->filetype, &filetype_sz);
+ MPI_Type_size_x(fd->filetype, &filetype_sz);
if (filetype_extent == filetype_sz) {
flat_file_p = ADIOI_Add_contig_flattened(fd->filetype);
flat_file_p->blocklens[0] = memtype_sz*count;
diff --git a/src/mpi/romio/adio/common/ad_fstype.c b/src/mpi/romio/adio/common/ad_fstype.c
index 85d2142..4bd1a11 100644
--- a/src/mpi/romio/adio/common/ad_fstype.c
+++ b/src/mpi/romio/adio/common/ad_fstype.c
@@ -172,7 +172,7 @@ static void ADIO_FileSysType_parentdir(const char *filename, char **dirnamep)
* but this code doesn't care if the target is really there
* or not.
*/
- int namelen;
+ ssize_t namelen;
char *linkbuf;
linkbuf = ADIOI_Malloc(PATH_MAX+1);
diff --git a/src/mpi/romio/adio/common/ad_get_sh_fp.c b/src/mpi/romio/adio/common/ad_get_sh_fp.c
index 1252043..c73b499 100644
--- a/src/mpi/romio/adio/common/ad_get_sh_fp.c
+++ b/src/mpi/romio/adio/common/ad_get_sh_fp.c
@@ -18,7 +18,7 @@ void ADIOI_BG_Get_shared_fp(ADIO_File fd, int size, ADIO_Offset *shared_fp, int
shared_fp by the number of etypes to be accessed (incr) in the read
or write following this function. */
-void ADIOI_NFS_Get_shared_fp(ADIO_File fd, int incr, ADIO_Offset *shared_fp,
+void ADIOI_NFS_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared_fp,
int *error_code);
void ADIO_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared_fp,
diff --git a/src/mpi/romio/adio/common/ad_io_coll.c b/src/mpi/romio/adio/common/ad_io_coll.c
index 198ba62..22d6f43 100644
--- a/src/mpi/romio/adio/common/ad_io_coll.c
+++ b/src/mpi/romio/adio/common/ad_io_coll.c
@@ -701,11 +701,11 @@ void ADIOI_Calc_bounds (ADIO_File fd, int count, MPI_Datatype buftype,
ADIO_Offset *st_offset, ADIO_Offset *end_offset)
{
int filetype_size, buftype_size, etype_size;
- int i, sum;
+ int sum;
MPI_Aint filetype_extent;
ADIO_Offset total_io;
int filetype_is_contig;
- int remainder;
+ ADIO_Offset i, remainder;
ADIOI_Flatlist_node *flat_file;
ADIO_Offset st_byte_off, end_byte_off;
diff --git a/src/mpi/romio/adio/common/ad_iwrite.c b/src/mpi/romio/adio/common/ad_iwrite.c
index 8848dfd..f263a74 100644
--- a/src/mpi/romio/adio/common/ad_iwrite.c
+++ b/src/mpi/romio/adio/common/ad_iwrite.c
@@ -219,7 +219,7 @@ int ADIOI_GEN_aio_poll_fn(void *extra_state, MPI_Status *status)
else if (errno == ECANCELED) {
/* TODO: unsure how to handle this */
} else if (errno == 0) {
- int n = aio_return(aio_req->aiocbp);
+ ssize_t n = aio_return(aio_req->aiocbp);
aio_req->nbytes = n;
errcode = MPI_Grequest_complete(aio_req->req);
/* --BEGIN ERROR HANDLING-- */
@@ -278,7 +278,7 @@ int ADIOI_GEN_aio_wait_fn(int count, void ** array_of_states,
continue;
errno = aio_error(aio_reqlist[i]->aiocbp);
if (errno == 0) {
- int n = aio_return(aio_reqlist[i]->aiocbp);
+ ssize_t n = aio_return(aio_reqlist[i]->aiocbp);
aio_reqlist[i]->nbytes = n;
errcode = MPI_Grequest_complete(aio_reqlist[i]->req);
if (errcode != MPI_SUCCESS) {
@@ -323,8 +323,7 @@ int ADIOI_GEN_aio_query_fn(void *extra_state, MPI_Status *status)
aio_req = (ADIOI_AIO_Request *)extra_state;
-
- MPI_Status_set_elements(status, MPI_BYTE, aio_req->nbytes);
+ MPI_Status_set_elements_x(status, MPI_BYTE, aio_req->nbytes);
/* can never cancel so always true */
MPI_Status_set_cancelled(status, 0);
diff --git a/src/mpi/romio/adio/common/ad_read_str_naive.c b/src/mpi/romio/adio/common/ad_read_str_naive.c
index 95c14b4..6ff428e 100644
--- a/src/mpi/romio/adio/common/ad_read_str_naive.c
+++ b/src/mpi/romio/adio/common/ad_read_str_naive.c
@@ -22,7 +22,7 @@ void ADIOI_GEN_ReadStrided_naive(ADIO_File fd, void *buf, int count,
ADIO_Offset n_filetypes, etype_in_filetype;
ADIO_Offset abs_off_in_filetype=0;
unsigned bufsize, filetype_size, buftype_size, size_in_filetype;
- int etype_size;
+ ADIO_Offset etype_size;
MPI_Aint filetype_extent, buftype_extent;
int buf_count, buftype_is_contig, filetype_is_contig;
ADIO_Offset userbuf_off;
diff --git a/src/mpi/romio/adio/common/ad_write_coll.c b/src/mpi/romio/adio/common/ad_write_coll.c
index e5ed05c..583fc48 100644
--- a/src/mpi/romio/adio/common/ad_write_coll.c
+++ b/src/mpi/romio/adio/common/ad_write_coll.c
@@ -530,9 +530,10 @@ static void ADIOI_Exch_and_write(ADIO_File fd, void *buf, MPI_Datatype
for (i=0; i<nprocs; i++) count[i] = recv_size[i] = 0;
for (m=ntimes; m<max_ntimes; m++) {
+ ADIOI_Assert(size == (int)size);
/* nothing to recv, but check for send. */
ADIOI_W_Exchange_data(fd, buf, write_buf, flat_buf, offset_list,
- len_list, send_size, recv_size, off, size, count,
+ len_list, send_size, recv_size, off, (int)size, count,
start_pos, partial_recv,
sent_to_proc, nprocs, myrank,
buftype_is_contig, contig_access_count,
@@ -659,7 +660,8 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, void *buf, char *write_buf,
else { /* coalesce the sorted offset-length pairs */
for (i=1; i<sum; i++) {
if (srt_off[i] <= srt_off[0] + srt_len[0]) {
- int new_len = srt_off[i] + srt_len[i] - srt_off[0];
+ /* ok to cast: operating on cb_buffer_size chunks */
+ int new_len = (int)srt_off[i] + srt_len[i] - (int)srt_off[0];
if (new_len > srt_len[0]) srt_len[0] = new_len;
}
else
@@ -929,7 +931,8 @@ static void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node
ADIOI_Assert((curr_to_proc[p] + len - done_to_proc[p]) == (unsigned)(curr_to_proc[p] + len - done_to_proc[p]));
buf_incr = curr_to_proc[p] + len - done_to_proc[p];
ADIOI_Assert((done_to_proc[p] + size) == (unsigned)(done_to_proc[p] + size));
- curr_to_proc[p] = done_to_proc[p] + size;
+ /* ok to cast: bounded by cb buffer size */
+ curr_to_proc[p] = done_to_proc[p] + (int)size;
ADIOI_BUF_COPY
}
else {
diff --git a/src/mpi/romio/adio/common/ad_write_nolock.c b/src/mpi/romio/adio/common/ad_write_nolock.c
index 47a6079..7048198 100644
--- a/src/mpi/romio/adio/common/ad_write_nolock.c
+++ b/src/mpi/romio/adio/common/ad_write_nolock.c
@@ -31,8 +31,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count,
off_t err_lseek=-1;
ssize_t err=-1;
ADIO_Offset fwr_size=0, bwr_size, new_bwr_size, new_fwr_size, i_offset, num;
- unsigned bufsize;
- int n_etypes_in_filetype;
+ ADIO_Offset bufsize, n_etypes_in_filetype;
ADIO_Offset n_filetypes, etype_in_filetype, size, sum;
ADIO_Offset abs_off_in_filetype=0, size_in_filetype;
MPI_Count filetype_size, etype_size, buftype_size;
diff --git a/src/mpi/romio/adio/common/ad_write_str.c b/src/mpi/romio/adio/common/ad_write_str.c
index c095b34..b09d6f5 100644
--- a/src/mpi/romio/adio/common/ad_write_str.c
+++ b/src/mpi/romio/adio/common/ad_write_str.c
@@ -119,9 +119,8 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count,
ADIOI_Flatlist_node *flat_buf, *flat_file;
ADIO_Offset i_offset, sum, size_in_filetype;
int i, j, k, st_index=0;
- int n_etypes_in_filetype;
ADIO_Offset num, size, n_filetypes, etype_in_filetype, st_n_filetypes;
- ADIO_Offset abs_off_in_filetype=0;
+ ADIO_Offset n_etypes_in_filetype, abs_off_in_filetype=0;
MPI_Count filetype_size, etype_size, buftype_size;
MPI_Aint filetype_extent, buftype_extent;
int buf_count, buftype_is_contig, filetype_is_contig;
diff --git a/src/mpi/romio/adio/common/ad_write_str_naive.c b/src/mpi/romio/adio/common/ad_write_str_naive.c
index c37e3a1..aa4d4c9 100644
--- a/src/mpi/romio/adio/common/ad_write_str_naive.c
+++ b/src/mpi/romio/adio/common/ad_write_str_naive.c
@@ -20,7 +20,7 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count,
ADIO_Offset bwr_size, fwr_size=0, sum, size_in_filetype;
int b_index;
unsigned bufsize;
- int n_etypes_in_filetype;
+ ADIO_Offset n_etypes_in_filetype;
ADIO_Offset size, n_filetypes, etype_in_filetype;
ADIO_Offset abs_off_in_filetype=0, req_len;
MPI_Count filetype_size, etype_size, buftype_size;
diff --git a/src/mpi/romio/adio/common/cb_config_list.c b/src/mpi/romio/adio/common/cb_config_list.c
index 83e9f29..9db91af 100644
--- a/src/mpi/romio/adio/common/cb_config_list.c
+++ b/src/mpi/romio/adio/common/cb_config_list.c
@@ -666,7 +666,7 @@ static int get_max_procs(int cb_nodes)
if (token != AGG_WILDCARD && token != AGG_STRING) return -1;
if (token == AGG_WILDCARD) max_procs = cb_nodes;
else if (token == AGG_STRING) {
- max_procs = strtol(yylval, &errptr, 10);
+ max_procs = (int)strtol(yylval, &errptr, 10);
if (*errptr != '\0') {
/* some garbage value; default to 1 */
max_procs = 1;
diff --git a/src/mpi/romio/adio/common/flatten.c b/src/mpi/romio/adio/common/flatten.c
index c75bce0..2f995eb 100644
--- a/src/mpi/romio/adio/common/flatten.c
+++ b/src/mpi/romio/adio/common/flatten.c
@@ -61,7 +61,7 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype)
flat->count = ADIOI_Count_contiguous_blocks(datatype, &curr_index);
#ifdef FLATTEN_DEBUG
- DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: count %#z, cur_idx = %#X\n",flat->count,curr_index);
+ DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: count %llX, cur_idx = %#llX\n",flat->count,curr_index);
#endif
/* DBG_FPRINTF(stderr, "%d\n", flat->count);*/
@@ -107,13 +107,13 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype)
void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
ADIO_Offset st_offset, MPI_Count *curr_index)
{
- int i, j, k, m, n, num, basic_num, prev_index;
+ int i, k, m, n, basic_num;
int combiner, old_combiner, old_is_contig;
int nints, nadds, ntypes, old_nints, old_nadds, old_ntypes;
/* By using ADIO_Offset we preserve +/- sign and
avoid >2G integer arithmetic problems */
ADIO_Offset top_count;
- MPI_Count old_size;
+ MPI_Count j, old_size, prev_index, num;
MPI_Aint old_extent;/* Assume extents are non-negative */
int *ints;
MPI_Aint *adds; /* Make no assumptions about +/- sign on these */
@@ -125,7 +125,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
MPI_Type_get_contents(datatype, nints, nadds, ntypes, ints, adds, types);
#ifdef FLATTEN_DEBUG
- DBG_FPRINTF(stderr,"ADIOI_Flatten:: st_offset %#llX, curr_index %#X\n",st_offset,*curr_index);
+ DBG_FPRINTF(stderr,"ADIOI_Flatten:: st_offset %#llX, curr_index %#llX\n",st_offset,*curr_index);
DBG_FPRINTF(stderr,"ADIOI_Flatten:: nints %#X, nadds %#X, ntypes %#X\n",nints, nadds, ntypes);
for(i=0; i< nints; ++i)
{
@@ -194,12 +194,12 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
types[0],
&dtype);
#ifdef FLATTEN_DEBUG
- DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY <ADIOI_Flatten(dtype, flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX, st_offset %#llX, curr_index %#X);\n",
+ DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY <ADIOI_Flatten(dtype, flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX, st_offset %#llX, curr_index %#llX);\n",
0, flat->indices[0], 0, flat->blocklens[0], st_offset, *curr_index);
#endif
ADIOI_Flatten(dtype, flat, st_offset, curr_index);
#ifdef FLATTEN_DEBUG
- DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY >ADIOI_Flatten(dtype, flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX, st_offset %#llX, curr_index %#X);\n",
+ DBG_FPRINTF(stderr,"ADIOI_Flatten:: MPI_COMBINER_DARRAY >ADIOI_Flatten(dtype, flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX, st_offset %#llX, curr_index %#llX);\n",
0, flat->indices[0], 0, flat->blocklens[0], st_offset, *curr_index);
#endif
MPI_Type_free(&dtype);
@@ -226,7 +226,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
MPI_Type_size_x(types[0], &old_size);
flat->blocklens[j] = top_count * old_size;
#ifdef FLATTEN_DEBUG
- DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",j, flat->indices[j], j, flat->blocklens[j]);
+ DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",j, flat->indices[j], j, flat->blocklens[j]);
#endif
(*curr_index)++;
}
@@ -242,7 +242,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
flat->indices[j] = flat->indices[j-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent;
flat->blocklens[j] = flat->blocklens[j-num];
#ifdef FLATTEN_DEBUG
- DBG_FPRINTF(stderr,"ADIOI_Flatten:: derived flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",j, flat->indices[j], j, flat->blocklens[j]);
+ DBG_FPRINTF(stderr,"ADIOI_Flatten:: derived flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",j, flat->indices[j], j, flat->blocklens[j]);
#endif
j++;
}
@@ -615,7 +615,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
MPI_Type_size_x(types[n], &old_size);
flat->blocklens[j] = blocklength * old_size;
#ifdef FLATTEN_DEBUG
- DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",n,adds[n],j, flat->indices[j], j, flat->blocklens[j]);
+ DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",n,adds[n],j, flat->indices[j], j, flat->blocklens[j]);
#endif
(*curr_index)++;
}
@@ -632,7 +632,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
flat->indices[j] = flat->indices[j-num] + ADIOI_AINT_CAST_TO_OFFSET old_extent;
flat->blocklens[j] = flat->blocklens[j-num];
#ifdef FLATTEN_DEBUG
- DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple old_extent "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",old_extent,j, flat->indices[j], j, flat->blocklens[j]);
+ DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple old_extent "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",old_extent,j, flat->indices[j], j, flat->blocklens[j]);
#endif
j++;
}
@@ -655,7 +655,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
flat->blocklens[j] = 0;
#ifdef FLATTEN_DEBUG
- DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]);
+ DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]);
#endif
(*curr_index)++;
@@ -677,7 +677,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
flat->blocklens[j] = old_size;
#ifdef FLATTEN_DEBUG
- DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]);
+ DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",0,adds[0],j, flat->indices[j], j, flat->blocklens[j]);
#endif
(*curr_index)++;
@@ -689,7 +689,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
flat->blocklens[j] = 0;
#ifdef FLATTEN_DEBUG
- DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",1,adds[1],j, flat->indices[j], j, flat->blocklens[j]);
+ DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#llX] %#llX, flat->blocklens[%#llX] %#llX\n",1,adds[1],j, flat->indices[j], j, flat->blocklens[j]);
#endif
(*curr_index)++;
@@ -717,7 +717,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
ADIOI_Free(types);
#ifdef FLATTEN_DEBUG
- DBG_FPRINTF(stderr,"ADIOI_Flatten:: return st_offset %#llX, curr_index %#X\n",st_offset,*curr_index);
+ DBG_FPRINTF(stderr,"ADIOI_Flatten:: return st_offset %#llX, curr_index %#llX\n",st_offset,*curr_index);
#endif
}
@@ -740,8 +740,8 @@ MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, MPI_Count *curr_i
*curr_index = blks;
return blks;
#else
- int i, n, num, basic_num, prev_index;
- MPI_Count count=0;
+ int i, n;
+ MPI_Count count=0, prev_index, num, basic_num;
int top_count, combiner, old_combiner, old_is_contig;
int nints, nadds, ntypes, old_nints, old_nadds, old_ntypes;
int *ints;
diff --git a/src/mpi/romio/adio/common/get_fp_posn.c b/src/mpi/romio/adio/common/get_fp_posn.c
index 8f5b907..671dde3 100644
--- a/src/mpi/romio/adio/common/get_fp_posn.c
+++ b/src/mpi/romio/adio/common/get_fp_posn.c
@@ -16,8 +16,8 @@ void ADIOI_Get_position(ADIO_File fd, ADIO_Offset *offset)
{
ADIOI_Flatlist_node *flat_file;
int i, flag;
- MPI_Count filetype_size;
- int etype_size, filetype_is_contig;
+ MPI_Count filetype_size, etype_size;
+ int filetype_is_contig;
MPI_Aint filetype_extent;
ADIO_Offset disp, byte_offset, sum=0, size_in_file, n_filetypes, frd_size;
diff --git a/src/mpi/romio/adio/common/hint_fns.c b/src/mpi/romio/adio/common/hint_fns.c
index 560b614..34c898b 100644
--- a/src/mpi/romio/adio/common/hint_fns.c
+++ b/src/mpi/romio/adio/common/hint_fns.c
@@ -143,7 +143,8 @@ int ADIOI_Info_check_and_install_true(ADIO_File fd, MPI_Info info, const char *k
int ADIOI_Info_check_and_install_str(ADIO_File fd, MPI_Info info, const char *key,
char **local_cache, char *funcname, int *error_code)
{
- int flag, len;
+ int flag;
+ size_t len;
char *value;
value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL+1)*sizeof(char));
diff --git a/src/mpi/romio/adio/common/shfp_fname.c b/src/mpi/romio/adio/common/shfp_fname.c
index 308b946..c88fe18 100644
--- a/src/mpi/romio/adio/common/shfp_fname.c
+++ b/src/mpi/romio/adio/common/shfp_fname.c
@@ -26,7 +26,8 @@
void ADIOI_Shfp_fname(ADIO_File fd, int rank)
{
double tm;
- int i, len;
+ int i;
+ int len;
char *slash, *ptr, tmp[128];
int pid = 0;
@@ -60,7 +61,8 @@ void ADIOI_Shfp_fname(ADIO_File fd, int rank)
slash = strrchr(fd->shared_fp_fname, '/');
#endif
ADIOI_Strncpy(slash + 1, ".", 2);
- len = 256 - (slash+2 - fd->shared_fp_fname);
+ /* ok to cast: file names bounded by PATH_MAX and NAME_MAX */
+ len = (int) (256 - (slash+2 - fd->shared_fp_fname));
ADIOI_Strncpy(slash + 2, ptr + 1, len);
}
diff --git a/src/mpid/common/datatype/mpid_segment.c b/src/mpid/common/datatype/mpid_segment.c
index f52a5eb..65e4afb 100644
--- a/src/mpid/common/datatype/mpid_segment.c
+++ b/src/mpid/common/datatype/mpid_segment.c
@@ -314,7 +314,8 @@ static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
" vector to vec: do=" MPI_AINT_FMT_DEC_SPEC
", dp=%p"
", len=" MPI_AINT_FMT_DEC_SPEC
- ", ind=%d, ct=" MPI_AINT_FMT_DEC_SPEC
+ ", ind=" MPI_AINT_FMT_DEC_SPEC
+ ", ct=" MPI_AINT_FMT_DEC_SPEC
", blksz=" MPI_AINT_FMT_DEC_SPEC
", str=" MPI_AINT_FMT_DEC_SPEC
", blks=" MPI_AINT_FMT_DEC_SPEC,
diff --git a/src/pm/hydra/ui/mpich/utils.c b/src/pm/hydra/ui/mpich/utils.c
index 9d55fd4..fb86e42 100644
--- a/src/pm/hydra/ui/mpich/utils.c
+++ b/src/pm/hydra/ui/mpich/utils.c
@@ -237,7 +237,7 @@ static void genvlist_help_fn(void)
static HYD_status genvlist_fn(char *arg, char ***argv)
{
- int len;
+ size_t len;
HYD_status status = HYD_SUCCESS;
if (reading_config_file && HYD_server_info.user_global.global_env.prop) {
@@ -684,7 +684,7 @@ static void envlist_help_fn(void)
static HYD_status envlist_fn(char *arg, char ***argv)
{
- int len;
+ size_t len;
struct HYD_exec *exec;
HYD_status status = HYD_SUCCESS;
@@ -1632,7 +1632,8 @@ static HYD_status parse_args(char **t_argv)
HYD_status HYD_uii_mpx_get_parameters(char **t_argv)
{
- int ret, len;
+ int ret;
+ size_t len;
char **argv = t_argv;
char *progname = *argv;
char *post, *loc, *tmp[HYD_NUM_TMP_STRINGS], *conf_file;
http://git.mpich.org/mpich.git/commitdiff/6f267e79b478df773d2343a6738e1cfad…
commit 6f267e79b478df773d2343a6738e1cfadd28c995
Author: Jeff Hammond <jeff.science(a)gmail.com>
Date: Tue Oct 15 14:09:02 2013 -0500
remove cast-to-integer associated with count field
goal: make MPICH count-safe
problem: casting to int when value exceeds INT_MAX
solution: remove all "(int)" in front of values assigned to the count
field
Signed-off-by: Rob Latham <robl(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mx/mx_poll.c b/src/mpid/ch3/channels/nemesis/netmod/mx/mx_poll.c
index c4f79e7..8b39b7e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mx/mx_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mx/mx_poll.c
@@ -607,7 +607,7 @@ MPID_nem_mx_handle_rreq(MPID_Request *req, mx_status_t status)
MPID_Segment_unpack( req->dev.segment_ptr, 0, &last, req->dev.tmpbuf );
MPIU_Free(req->dev.tmpbuf);
if (last != data_sz) {
- MPIR_STATUS_SET_COUNT(req->status, (int)last);
+ MPIR_STATUS_SET_COUNT(req->status, last);
if (req->dev.recv_data_sz <= userbuf_sz) {
MPIU_ERR_SETSIMPLE(req->status.MPI_ERROR,MPI_ERR_TYPE,"**dtypemismatch");
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_poll.c b/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_poll.c
index 0346378..2dba872 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_poll.c
@@ -373,7 +373,7 @@ MPID_nem_newmad_handle_rreq(MPID_Request *req, nm_tag_t match_info, size_t size)
MPID_Segment_unpack( req->dev.segment_ptr, 0, &last, req->dev.tmpbuf);
MPIU_Free(req->dev.tmpbuf);
if (last != data_sz) {
- MPIR_STATUS_SET_COUNT(req->status, (int)last);
+ MPIR_STATUS_SET_COUNT(req->status, last);
if (req->dev.recv_data_sz <= userbuf_sz) {
MPIU_ERR_SETSIMPLE(req->status.MPI_ERROR,MPI_ERR_TYPE,"**dtypemismatch");
}
diff --git a/src/mpid/ch3/src/ch3u_buffer.c b/src/mpid/ch3/src/ch3u_buffer.c
index 2d271c2..abee52d 100644
--- a/src/mpid/ch3/src/ch3u_buffer.c
+++ b/src/mpid/ch3/src/ch3u_buffer.c
@@ -239,7 +239,7 @@ int MPIDI_CH3_RecvFromSelf( MPID_Request *rreq, void *buf, int count,
sreq->dev.datatype, &sreq->status.MPI_ERROR,
buf, count, datatype, &data_sz,
&rreq->status.MPI_ERROR);
- MPIR_STATUS_SET_COUNT(rreq->status, (int)data_sz);
+ MPIR_STATUS_SET_COUNT(rreq->status, data_sz);
MPID_REQUEST_SET_COMPLETED(sreq);
MPID_Request_release(sreq);
}
diff --git a/src/mpid/ch3/src/ch3u_eager.c b/src/mpid/ch3/src/ch3u_eager.c
index 1890b2c..3d185f8 100644
--- a/src/mpid/ch3/src/ch3u_eager.c
+++ b/src/mpid/ch3/src/ch3u_eager.c
@@ -405,7 +405,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
/* There are two cases: a datatype mismatch (could
not consume all data) or a too-short buffer. We
need to distinguish between these two types. */
- MPIR_STATUS_SET_COUNT(rreq->status, (int)last);
+ MPIR_STATUS_SET_COUNT(rreq->status, last);
if (rreq->dev.recv_data_sz <= userbuf_sz) {
MPIU_ERR_SETSIMPLE(rreq->status.MPI_ERROR,MPI_ERR_TYPE,
"**dtypemismatch");
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
index 426429c..92d3e6b 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
@@ -198,7 +198,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
mismatch between the datatype and the amount of
data received. Throw away received data. */
MPIU_ERR_SET(rreq->status.MPI_ERROR, MPI_ERR_TYPE, "**dtypemismatch");
- MPIR_STATUS_SET_COUNT(rreq->status, (int)rreq->dev.segment_first);
+ MPIR_STATUS_SET_COUNT(rreq->status, rreq->dev.segment_first);
*buflen = data_sz;
*complete = TRUE;
/* FIXME: Set OnDataAvail to 0? If not, why not? */
diff --git a/src/mpid/ch3/src/ch3u_request.c b/src/mpid/ch3/src/ch3u_request.c
index ef1779a..af39b3d 100644
--- a/src/mpid/ch3/src/ch3u_request.c
+++ b/src/mpid/ch3/src/ch3u_request.c
@@ -381,7 +381,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
rreq->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_TYPE,
"**dtypemismatch", 0);
- MPIR_STATUS_SET_COUNT(rreq->status, (int)rreq->dev.segment_first);
+ MPIR_STATUS_SET_COUNT(rreq->status, rreq->dev.segment_first);
rreq->dev.segment_size = rreq->dev.segment_first;
mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq);
goto fn_exit;
@@ -518,7 +518,7 @@ int MPIDI_CH3U_Request_unpack_srbuf(MPID_Request * rreq)
/* If no data can be unpacked, then we have a datatype processing
problem. Adjust the segment info so that the remaining
data is received and thrown away. */
- MPIR_STATUS_SET_COUNT(rreq->status, (int)rreq->dev.segment_first);
+ MPIR_STATUS_SET_COUNT(rreq->status, rreq->dev.segment_first);
rreq->dev.segment_size = rreq->dev.segment_first;
rreq->dev.segment_first += tmpbuf_last;
rreq->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS,
@@ -536,7 +536,7 @@ int MPIDI_CH3U_Request_unpack_srbuf(MPID_Request * rreq)
Note: the segment_first field is set to segment_last so that if
this is a truncated message, extra data will be read
off the pipe. */
- MPIR_STATUS_SET_COUNT(rreq->status, (int)last);
+ MPIR_STATUS_SET_COUNT(rreq->status, last);
rreq->dev.segment_size = last;
rreq->dev.segment_first = tmpbuf_last;
rreq->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS,
@@ -600,7 +600,7 @@ int MPIDI_CH3U_Request_unpack_uebuf(MPID_Request * rreq)
", buf_sz=" MPIDI_MSG_SZ_FMT,
rreq->dev.recv_data_sz, userbuf_sz));
unpack_sz = userbuf_sz;
- MPIR_STATUS_SET_COUNT(rreq->status, (int)userbuf_sz);
+ MPIR_STATUS_SET_COUNT(rreq->status, userbuf_sz);
rreq->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_TRUNCATE,
"**truncate", "**truncate %d %d",
@@ -636,7 +636,7 @@ int MPIDI_CH3U_Request_unpack_uebuf(MPID_Request * rreq)
/* received data was not entirely consumed by unpack()
because too few bytes remained to fill the next basic
datatype */
- MPIR_STATUS_SET_COUNT(rreq->status, (int)last);
+ MPIR_STATUS_SET_COUNT(rreq->status, last);
rreq->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_TYPE,
"**dtypemismatch", 0);
diff --git a/src/mpid/ch3/src/mpidi_isend_self.c b/src/mpid/ch3/src/mpidi_isend_self.c
index 0658630..4d3ff12 100644
--- a/src/mpid/ch3/src/mpidi_isend_self.c
+++ b/src/mpid/ch3/src/mpidi_isend_self.c
@@ -74,7 +74,7 @@ int MPIDI_Isend_self(const void * buf, int count, MPI_Datatype datatype, int ran
MPIDI_CH3U_Buffer_copy(buf, count, datatype, &sreq->status.MPI_ERROR,
rreq->dev.user_buf, rreq->dev.user_count, rreq->dev.datatype, &data_sz, &rreq->status.MPI_ERROR);
- MPIR_STATUS_SET_COUNT(rreq->status, (int)data_sz);
+ MPIR_STATUS_SET_COUNT(rreq->status, data_sz);
MPID_REQUEST_SET_COMPLETED(rreq);
MPID_Request_release(rreq);
/* sreq has never been seen by the user or outside this thread, so it is safe to reset ref_count and cc */
http://git.mpich.org/mpich.git/commitdiff/bf57cc474ad6e29469bd91dd67b680c53…
commit bf57cc474ad6e29469bd91dd67b680c533edcd02
Author: Jeff Hammond <jeff.science(a)gmail.com>
Date: Tue Oct 15 14:07:53 2013 -0500
return result of strlen to proper type
strlen returns size_t. since the return argument is localized, there is
no reason to not use the proper type to hold the result.
Signed-off-by: Rob Latham <robl(a)mcs.anl.gov>
diff --git a/src/mpl/src/mplstr.c b/src/mpl/src/mplstr.c
index a9ecb73..1f1f8f6 100644
--- a/src/mpl/src/mplstr.c
+++ b/src/mpl/src/mplstr.c
@@ -70,7 +70,7 @@ int MPL_snprintf(char *str, size_t size, mpl_const char *format, ...)
val = va_arg(list, int);
sprintf(tmp, "%d", val);
if (width > 0) {
- int tmplen = strlen(tmp);
+ size_t tmplen = strlen(tmp);
/* If a width was specified, pad with spaces on the
* left (on the right if %-3d given; not implemented yet */
while (size-- > 0 && width-- > tmplen)
@@ -91,7 +91,7 @@ int MPL_snprintf(char *str, size_t size, mpl_const char *format, ...)
val = va_arg(list, int);
sprintf(tmp, "%x", val);
if (width > 0) {
- int tmplen = strlen(tmp);
+ size_t tmplen = strlen(tmp);
/* If a width was specified, pad with spaces on the
* left (on the right if %-3d given; not implemented yet */
while (size-- > 0 && width-- > tmplen)
@@ -112,7 +112,7 @@ int MPL_snprintf(char *str, size_t size, mpl_const char *format, ...)
val = va_arg(list, void *);
sprintf(tmp, "%p", val);
if (width > 0) {
- int tmplen = strlen(tmp);
+ size_t tmplen = strlen(tmp);
/* If a width was specified, pad with spaces on the
* left (on the right if %-3d given; not implemented yet */
while (size-- > 0 && width-- > tmplen)
http://git.mpich.org/mpich.git/commitdiff/91e91a4027c734b2d994aa10671f3e99f…
commit 91e91a4027c734b2d994aa10671f3e99f71465c7
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Tue Oct 15 13:23:22 2013 -0500
make shared file pointer code "large datatype" safe
this internal-to-romio code was using 'ints' to store things like
"datatype_size * count" calculation. Promote that and all called paths
to ADIO_Offset
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpi/romio/adio/ad_bg/ad_bg.h b/src/mpi/romio/adio/ad_bg/ad_bg.h
index a4de5e8..763c8de 100644
--- a/src/mpi/romio/adio/ad_bg/ad_bg.h
+++ b/src/mpi/romio/adio/ad_bg/ad_bg.h
@@ -86,7 +86,7 @@ void ADIOI_BG_WriteStridedColl(ADIO_File fd, const void *buf, int count,
ADIO_Offset offset, ADIO_Status *status, int
*error_code);
-void ADIOI_BG_Get_shared_fp(ADIO_File fd, int size, ADIO_Offset *shared_fp, int *error_code);
+void ADIOI_BG_Get_shared_fp(ADIO_File fd, ADIO_Offset size, ADIO_Offset *shared_fp, int *error_code);
void ADIOI_BG_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code);
void ADIOI_BG_Flush(ADIO_File fd, int *error_code);
diff --git a/src/mpi/romio/adio/ad_bg/ad_bg_getsh.c b/src/mpi/romio/adio/ad_bg/ad_bg_getsh.c
index 4195d55..f18db25 100644
--- a/src/mpi/romio/adio/ad_bg/ad_bg_getsh.c
+++ b/src/mpi/romio/adio/ad_bg/ad_bg_getsh.c
@@ -19,7 +19,7 @@
shared_fp by the number of etypes to be accessed (incr) in the read
or write following this function. */
-void ADIOI_BG_Get_shared_fp(ADIO_File fd, int incr, ADIO_Offset *shared_fp,
+void ADIOI_BG_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared_fp,
int *error_code)
{
ADIO_Offset new_fp;
diff --git a/src/mpi/romio/adio/ad_bgl/ad_bgl.h b/src/mpi/romio/adio/ad_bgl/ad_bgl.h
index 89d247b..73ab111 100644
--- a/src/mpi/romio/adio/ad_bgl/ad_bgl.h
+++ b/src/mpi/romio/adio/ad_bgl/ad_bgl.h
@@ -86,7 +86,7 @@ void ADIOI_BGL_WriteStridedColl(ADIO_File fd, void *buf, int count,
ADIO_Offset offset, ADIO_Status *status, int
*error_code);
-void ADIOI_BGL_Get_shared_fp(ADIO_File fd, int size, ADIO_Offset *shared_fp, int *error_code);
+void ADIOI_BGL_Get_shared_fp(ADIO_File fd, ADIO_Offset size, ADIO_Offset *shared_fp, int *error_code);
void ADIOI_BGL_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code);
void ADIOI_BGL_Flush(ADIO_File fd, int *error_code);
diff --git a/src/mpi/romio/adio/ad_bgl/ad_bgl_getsh.c b/src/mpi/romio/adio/ad_bgl/ad_bgl_getsh.c
index 2c51b1f..4b47c35 100644
--- a/src/mpi/romio/adio/ad_bgl/ad_bgl_getsh.c
+++ b/src/mpi/romio/adio/ad_bgl/ad_bgl_getsh.c
@@ -19,7 +19,7 @@
shared_fp by the number of etypes to be accessed (incr) in the read
or write following this function. */
-void ADIOI_BGL_Get_shared_fp(ADIO_File fd, int incr, ADIO_Offset *shared_fp,
+void ADIOI_BGL_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared_fp,
int *error_code)
{
ADIO_Offset new_fp;
diff --git a/src/mpi/romio/adio/ad_nfs/ad_nfs.h b/src/mpi/romio/adio/ad_nfs/ad_nfs.h
index b103779..83d394a 100644
--- a/src/mpi/romio/adio/ad_nfs/ad_nfs.h
+++ b/src/mpi/romio/adio/ad_nfs/ad_nfs.h
@@ -74,7 +74,7 @@ void ADIOI_NFS_ReadStrided(ADIO_File fd, void *buf, int count,
ADIO_Offset offset, ADIO_Status *status, int
*error_code);
void ADIOI_NFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
-void ADIOI_NFS_Get_shared_fp(ADIO_File fd, int size, ADIO_Offset *shared_fp,
+void ADIOI_NFS_Get_shared_fp(ADIO_File fd, ADIO_Offset size, ADIO_Offset *shared_fp,
int *error_code);
void ADIOI_NFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code);
void ADIOI_NFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
diff --git a/src/mpi/romio/adio/ad_nfs/ad_nfs_getsh.c b/src/mpi/romio/adio/ad_nfs/ad_nfs_getsh.c
index 3f73a99..974d547 100644
--- a/src/mpi/romio/adio/ad_nfs/ad_nfs_getsh.c
+++ b/src/mpi/romio/adio/ad_nfs/ad_nfs_getsh.c
@@ -12,11 +12,11 @@
shared_fp by the number of etypes to be accessed (incr) in the read
or write following this function. */
-void ADIOI_NFS_Get_shared_fp(ADIO_File fd, int incr, ADIO_Offset *shared_fp,
+void ADIOI_NFS_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared_fp,
int *error_code)
{
ADIO_Offset new_fp;
- int err;
+ ssize_t err;
MPI_Comm dupcommself;
static char myname[] = "ADIOI_NFS_GET_SHARED_FP";
diff --git a/src/mpi/romio/adio/ad_nfs/ad_nfs_setsh.c b/src/mpi/romio/adio/ad_nfs/ad_nfs_setsh.c
index 34c92ba..42e558c 100644
--- a/src/mpi/romio/adio/ad_nfs/ad_nfs_setsh.c
+++ b/src/mpi/romio/adio/ad_nfs/ad_nfs_setsh.c
@@ -30,7 +30,7 @@ Unlock
void ADIOI_NFS_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code)
{
- int err;
+ ssize_t err;
MPI_Comm dupcommself;
static char myname[] = "ADIOI_NFS_SET_SHARED_FP";
diff --git a/src/mpi/romio/adio/common/ad_get_sh_fp.c b/src/mpi/romio/adio/common/ad_get_sh_fp.c
index 5610915..1252043 100644
--- a/src/mpi/romio/adio/common/ad_get_sh_fp.c
+++ b/src/mpi/romio/adio/common/ad_get_sh_fp.c
@@ -18,10 +18,10 @@ void ADIOI_BG_Get_shared_fp(ADIO_File fd, int size, ADIO_Offset *shared_fp, int
shared_fp by the number of etypes to be accessed (incr) in the read
or write following this function. */
-void ADIOI_NFS_Get_shared_fp(ADIO_File fd, int incr, ADIO_Offset *shared_fp,
+void ADIOI_NFS_Get_shared_fp(ADIO_File fd, int incr, ADIO_Offset *shared_fp,
int *error_code);
-void ADIO_Get_shared_fp(ADIO_File fd, int incr, ADIO_Offset *shared_fp,
+void ADIO_Get_shared_fp(ADIO_File fd, ADIO_Offset incr, ADIO_Offset *shared_fp,
int *error_code)
{
ADIO_Status status;
diff --git a/src/mpi/romio/adio/common/ad_prealloc.c b/src/mpi/romio/adio/common/ad_prealloc.c
index 0cc8d2b..9462f77 100644
--- a/src/mpi/romio/adio/common/ad_prealloc.c
+++ b/src/mpi/romio/adio/common/ad_prealloc.c
@@ -15,9 +15,9 @@
*/
void ADIOI_GEN_Prealloc(ADIO_File fd, ADIO_Offset diskspace, int *error_code)
{
- ADIO_Offset curr_fsize, alloc_size, size, len, done;
+ ADIO_Offset curr_fsize, alloc_size, size, len, done, ntimes;
ADIO_Status status;
- int i, ntimes;
+ int i;
char *buf;
ADIO_Fcntl_t *fcntl_struct;
static char myname[] = "ADIOI_GEN_PREALLOC";
@@ -48,7 +48,7 @@ void ADIOI_GEN_Prealloc(ADIO_File fd, ADIO_Offset diskspace, int *error_code)
for (i=0; i<ntimes; i++) {
len = ADIOI_MIN(size-done, ADIOI_PREALLOC_BUFSZ);
ADIO_ReadContig(fd, buf,
- len, /* len is ADIO_Offset but is <= ADIOI_PREALLOC_BUFSZ (16M),
+ (int)len, /* len is ADIO_Offset but is <= ADIOI_PREALLOC_BUFSZ (16M),
so it fits in an int parameter */
MPI_BYTE, ADIO_EXPLICIT_OFFSET, done,
&status, error_code);
@@ -62,7 +62,7 @@ void ADIOI_GEN_Prealloc(ADIO_File fd, ADIO_Offset diskspace, int *error_code)
return;
}
ADIO_WriteContig(fd, buf,
- len, /* len is ADIO_Offset but is <= ADIOI_PREALLOC_BUFSZ (16M),
+ (int)len, /* len is ADIO_Offset but is <= ADIOI_PREALLOC_BUFSZ (16M),
so it fits in an int parameter */
MPI_BYTE, ADIO_EXPLICIT_OFFSET,
done, &status, error_code);
@@ -77,7 +77,7 @@ void ADIOI_GEN_Prealloc(ADIO_File fd, ADIO_Offset diskspace, int *error_code)
for (i=0; i<ntimes; i++) {
len = ADIOI_MIN(alloc_size-done, ADIOI_PREALLOC_BUFSZ);
ADIO_WriteContig(fd, buf,
- len, /* len is ADIO_Offset but is <= ADIOI_PREALLOC_BUFSZ (16M),
+ (int)len, /* len is ADIO_Offset but is <= ADIOI_PREALLOC_BUFSZ (16M),
so it fits in an int parameter */
MPI_BYTE, ADIO_EXPLICIT_OFFSET,
done, &status, error_code);
diff --git a/src/mpi/romio/adio/common/eof_offset.c b/src/mpi/romio/adio/common/eof_offset.c
index 1b2c9ae..c873ffd 100644
--- a/src/mpi/romio/adio/common/eof_offset.c
+++ b/src/mpi/romio/adio/common/eof_offset.c
@@ -14,8 +14,8 @@
void ADIOI_Get_eof_offset(ADIO_File fd, ADIO_Offset *eof_offset)
{
unsigned filetype_size;
- int error_code, filetype_is_contig, etype_size;
- ADIO_Offset fsize, disp, sum=0, size_in_file, n_filetypes, rem;
+ int error_code, filetype_is_contig;
+ ADIO_Offset fsize, disp, sum=0, size_in_file, n_filetypes, rem, etype_size;
int flag, i;
ADIO_Fcntl_t *fcntl_struct;
MPI_Aint filetype_extent;
diff --git a/src/mpi/romio/adio/common/system_hints.c b/src/mpi/romio/adio/common/system_hints.c
index 5b28d4d..507e188 100644
--- a/src/mpi/romio/adio/common/system_hints.c
+++ b/src/mpi/romio/adio/common/system_hints.c
@@ -94,7 +94,8 @@ static int file_to_info(int fd, MPI_Info info)
{
char *buffer, *token, *key, *val, *garbage;
char *pos1=NULL, *pos2=NULL;
- int flag, ret;
+ int flag;
+ ssize_t ret;
char dummy;
struct stat statbuf;
diff --git a/src/mpi/romio/adio/include/adio.h b/src/mpi/romio/adio/include/adio.h
index d168ac5..26f1659 100644
--- a/src/mpi/romio/adio/include/adio.h
+++ b/src/mpi/romio/adio/include/adio.h
@@ -397,7 +397,7 @@ void ADIO_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
void ADIO_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
void ADIO_ResolveFileType(MPI_Comm comm, const char *filename, int *fstype,
ADIOI_Fns **ops, int *error_code);
-void ADIO_Get_shared_fp(ADIO_File fd, int size, ADIO_Offset *shared_fp,
+void ADIO_Get_shared_fp(ADIO_File fd, ADIO_Offset size, ADIO_Offset *shared_fp,
int *error_code);
void ADIO_Set_shared_fp(ADIO_File fd, ADIO_Offset offset, int *error_code);
void ADIO_Set_view(ADIO_File fd, ADIO_Offset disp, MPI_Datatype etype,
diff --git a/src/mpi/romio/mpi-io/iread.c b/src/mpi/romio/mpi-io/iread.c
index 7f4d154..861e7eb 100644
--- a/src/mpi/romio/mpi-io/iread.c
+++ b/src/mpi/romio/mpi-io/iread.c
@@ -73,11 +73,11 @@ int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI
int MPIOI_File_iread(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *buf, int count,
MPI_Datatype datatype, char *myname, MPI_Request *request)
{
- int error_code, bufsize, buftype_is_contig, filetype_is_contig;
+ int error_code, buftype_is_contig, filetype_is_contig;
MPI_Count datatype_size;
ADIO_Status status;
ADIO_File adio_fh;
- ADIO_Offset off;
+ ADIO_Offset off, bufsize;
MPI_Offset nbytes=0;
MPIU_THREAD_CS_ENTER(ALLFUNC,);
diff --git a/src/mpi/romio/mpi-io/iread_sh.c b/src/mpi/romio/mpi-io/iread_sh.c
index a218daa..a9564ed 100644
--- a/src/mpi/romio/mpi-io/iread_sh.c
+++ b/src/mpi/romio/mpi-io/iread_sh.c
@@ -43,7 +43,8 @@ Output Parameters:
int MPI_File_iread_shared(MPI_File fh, void *buf, int count,
MPI_Datatype datatype, MPI_Request *request)
{
- int error_code, bufsize, buftype_is_contig, filetype_is_contig;
+ int error_code, buftype_is_contig, filetype_is_contig;
+ ADIO_Offset bufsize;
ADIO_File adio_fh;
static char myname[] = "MPI_FILE_IREAD_SHARED";
MPI_Count datatype_size, incr;
diff --git a/src/mpi/romio/mpi-io/iwrite.c b/src/mpi/romio/mpi-io/iwrite.c
index 5bfdd78..e6a2026 100644
--- a/src/mpi/romio/mpi-io/iwrite.c
+++ b/src/mpi/romio/mpi-io/iwrite.c
@@ -80,10 +80,10 @@ int MPIOI_File_iwrite(MPI_File fh,
char *myname,
MPI_Request *request)
{
- int error_code, bufsize, buftype_is_contig, filetype_is_contig;
+ int error_code, buftype_is_contig, filetype_is_contig;
MPI_Count datatype_size;
ADIO_Status status;
- ADIO_Offset off;
+ ADIO_Offset off, bufsize;
ADIO_File adio_fh;
MPI_Offset nbytes=0;
diff --git a/src/mpi/romio/mpi-io/iwrite_sh.c b/src/mpi/romio/mpi-io/iwrite_sh.c
index 49c0d30..8d3c7cd 100644
--- a/src/mpi/romio/mpi-io/iwrite_sh.c
+++ b/src/mpi/romio/mpi-io/iwrite_sh.c
@@ -44,9 +44,9 @@ Output Parameters:
int MPI_File_iwrite_shared(MPI_File fh, const void *buf, int count,
MPI_Datatype datatype, MPIO_Request *request)
{
- int error_code, bufsize, buftype_is_contig, filetype_is_contig;
+ int error_code, buftype_is_contig, filetype_is_contig;
ADIO_File adio_fh;
- int incr;
+ ADIO_Offset incr, bufsize;
MPI_Count datatype_size;
ADIO_Status status;
ADIO_Offset off, shared_fp;
diff --git a/src/mpi/romio/mpi-io/read.c b/src/mpi/romio/mpi-io/read.c
index e5b7238..92f11c8 100644
--- a/src/mpi/romio/mpi-io/read.c
+++ b/src/mpi/romio/mpi-io/read.c
@@ -70,10 +70,10 @@ int MPIOI_File_read(MPI_File fh,
char *myname,
MPI_Status *status)
{
- int error_code, bufsize, buftype_is_contig, filetype_is_contig;
+ int error_code, buftype_is_contig, filetype_is_contig;
MPI_Count datatype_size;
ADIO_File adio_fh;
- ADIO_Offset off;
+ ADIO_Offset off, bufsize;
void *xbuf=NULL, *e32_buf=NULL;
MPIU_THREAD_CS_ENTER(ALLFUNC,);
diff --git a/src/mpi/romio/mpi-io/read_ord.c b/src/mpi/romio/mpi-io/read_ord.c
index 19ced81..5dc5abd 100644
--- a/src/mpi/romio/mpi-io/read_ord.c
+++ b/src/mpi/romio/mpi-io/read_ord.c
@@ -42,7 +42,8 @@ Output Parameters:
int MPI_File_read_ordered(MPI_File fh, void *buf, int count,
MPI_Datatype datatype, MPI_Status *status)
{
- int error_code, nprocs, myrank, incr;
+ int error_code, nprocs, myrank;
+ ADIO_Offset incr;
MPI_Count datatype_size;
int source, dest;
static char myname[] = "MPI_FILE_READ_ORDERED";
diff --git a/src/mpi/romio/mpi-io/read_ordb.c b/src/mpi/romio/mpi-io/read_ordb.c
index b29488d..5dd9772 100644
--- a/src/mpi/romio/mpi-io/read_ordb.c
+++ b/src/mpi/romio/mpi-io/read_ordb.c
@@ -39,10 +39,10 @@ Output Parameters:
int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count,
MPI_Datatype datatype)
{
- int error_code, nprocs, myrank, incr;
+ int error_code, nprocs, myrank;
MPI_Count datatype_size;
int source, dest;
- ADIO_Offset shared_fp;
+ ADIO_Offset shared_fp, incr;
ADIO_File adio_fh;
static char myname[] = "MPI_FILE_READ_ORDERED_BEGIN";
void *xbuf=NULL, *e32_buf=NULL;
diff --git a/src/mpi/romio/mpi-io/read_sh.c b/src/mpi/romio/mpi-io/read_sh.c
index 65dd442..952180e 100644
--- a/src/mpi/romio/mpi-io/read_sh.c
+++ b/src/mpi/romio/mpi-io/read_sh.c
@@ -42,11 +42,10 @@ Output Parameters:
int MPI_File_read_shared(MPI_File fh, void *buf, int count,
MPI_Datatype datatype, MPI_Status *status)
{
- int error_code, bufsize, buftype_is_contig, filetype_is_contig;
+ int error_code, buftype_is_contig, filetype_is_contig;
static char myname[] = "MPI_FILE_READ_SHARED";
- int incr;
MPI_Count datatype_size;
- ADIO_Offset off, shared_fp;
+ ADIO_Offset off, shared_fp, incr, bufsize;
ADIO_File adio_fh;
void *xbuf=NULL, *e32_buf=NULL;
diff --git a/src/mpi/romio/mpi-io/write.c b/src/mpi/romio/mpi-io/write.c
index 62d6eb0..ef066a1 100644
--- a/src/mpi/romio/mpi-io/write.c
+++ b/src/mpi/romio/mpi-io/write.c
@@ -70,9 +70,9 @@ int MPIOI_File_write(MPI_File fh,
char *myname,
MPI_Status *status)
{
- int error_code, bufsize, buftype_is_contig, filetype_is_contig;
+ int error_code, buftype_is_contig, filetype_is_contig;
MPI_Count datatype_size;
- ADIO_Offset off;
+ ADIO_Offset off, bufsize;
ADIO_File adio_fh;
void *e32buf=NULL;
const void *xbuf=NULL;
diff --git a/src/mpi/romio/mpi-io/write_ord.c b/src/mpi/romio/mpi-io/write_ord.c
index 22f1f06..fd28480 100644
--- a/src/mpi/romio/mpi-io/write_ord.c
+++ b/src/mpi/romio/mpi-io/write_ord.c
@@ -43,7 +43,8 @@ Output Parameters:
int MPI_File_write_ordered(MPI_File fh, const void *buf, int count,
MPI_Datatype datatype, MPI_Status *status)
{
- int error_code, nprocs, myrank, incr;
+ int error_code, nprocs, myrank;
+ ADIO_Offset incr;
MPI_Count datatype_size;
int source, dest;
static char myname[] = "MPI_FILE_WRITE_ORDERED";
diff --git a/src/mpi/romio/mpi-io/write_ordb.c b/src/mpi/romio/mpi-io/write_ordb.c
index 848de29..968df19 100644
--- a/src/mpi/romio/mpi-io/write_ordb.c
+++ b/src/mpi/romio/mpi-io/write_ordb.c
@@ -39,7 +39,8 @@ Output Parameters:
int MPI_File_write_ordered_begin(MPI_File fh, const void *buf, int count,
MPI_Datatype datatype)
{
- int error_code, nprocs, myrank, incr;
+ int error_code, nprocs, myrank;
+ ADIO_Offset incr;
MPI_Count datatype_size;
int source, dest;
static char myname[] = "MPI_FILE_WRITE_ORDERED_BEGIN";
diff --git a/src/mpi/romio/mpi-io/write_sh.c b/src/mpi/romio/mpi-io/write_sh.c
index 870e901..39b72ce 100644
--- a/src/mpi/romio/mpi-io/write_sh.c
+++ b/src/mpi/romio/mpi-io/write_sh.c
@@ -42,7 +42,8 @@ Output Parameters:
int MPI_File_write_shared(MPI_File fh, const void *buf, int count,
MPI_Datatype datatype, MPI_Status *status)
{
- int error_code, bufsize, buftype_is_contig, filetype_is_contig;
+ int error_code, buftype_is_contig, filetype_is_contig;
+ ADIO_Offset bufsize;
static char myname[] = "MPI_FILE_READ_SHARED";
MPI_Count datatype_size, incr;
ADIO_Offset off, shared_fp;
http://git.mpich.org/mpich.git/commitdiff/e192ccc594a0f086c4bb5239d413df0e1…
commit e192ccc594a0f086c4bb5239d413df0e1f3d4f03
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Tue Aug 27 13:59:45 2013 -0500
datatype_size no longer needs to be an integer
MPIO_CHECK_COUNT_SIZE was designed to ensure "count*datatype_size" did
not overflow integers. Well, I've done my best to relax that need
throughout MPICH, so the cast to unsigned is not needed.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpi/romio/adio/include/adioi_error.h b/src/mpi/romio/adio/include/adioi_error.h
index 88a0408..9045282 100644
--- a/src/mpi/romio/adio/include/adioi_error.h
+++ b/src/mpi/romio/adio/include/adioi_error.h
@@ -48,7 +48,7 @@ if (count < 0) { \
}
#define MPIO_CHECK_COUNT_SIZE(fh, count, datatype_size, myname, error_code) \
-if (count*datatype_size != (ADIO_Offset)(unsigned)count*(ADIO_Offset)(unsigned)datatype_size) { \
+if (count*datatype_size != (ADIO_Offset)(unsigned)count*(ADIO_Offset)datatype_size) { \
error_code = MPIO_Err_create_code(MPI_SUCCESS, \
MPIR_ERR_RECOVERABLE, \
myname, __LINE__, \
http://git.mpich.org/mpich.git/commitdiff/615d1acb0578253395f4fb9b00d07f52c…
commit 615d1acb0578253395f4fb9b00d07f52cb30482a
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Mon Jul 29 09:08:58 2013 -0500
implement MPIU_Assign_trunc without _Generic
The test suite has failures like this:
Assertion failed in file
/home/robl/work/mpich/src/mpid/ch3/src/ch3u_rma_ops.c at line 552
: ((dloop_vec[i].iov_len)/type_size) >= expr_inttype_min(count)
Even though dloop_vec[i].iov_len is 4, type_size is 4, and
expr_inttype_min(count) is -INT_MAX, this assertion is still failing.
while the _Generic-based test was giving strange assertion failures, the
cast-and-compare version still works and should be used.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/include/mpiutil.h b/src/include/mpiutil.h
index 266fbe1..f2fbaf0 100644
--- a/src/include/mpiutil.h
+++ b/src/include/mpiutil.h
@@ -223,6 +223,10 @@ int MPIR_Assert_fail_fmt(const char *cond, const char *file_name, int line_num,
* promotion/truncation/conversion rules in mind. A discussion of these issues
* can be found in Chapter 5 of "Secure Coding in C and C++" by Robert Seacord.
*/
+/* this "check for overflow" macro seems buggy in a crazy way that I can't
+ * figure out. Instead of using the clever 'expr_inttype_max' macro, fall back
+ * to simple "cast and check for obvious overflow" */
+#if 0
#if defined(expr_inttype_max) && defined(expr_inttype_min)
# define MPIU_Assign_trunc(dst_,src_,dst_type_) \
do { \
@@ -231,14 +235,14 @@ int MPIR_Assert_fail_fmt(const char *cond, const char *file_name, int line_num,
MPIU_Assert((src_) >= expr_inttype_min(dst_)); \
dst_ = (dst_type_)(src_); \
} while (0)
-#else
-# define MPIU_Assign_trunc(dst_,src_,dst_type_) \
+#endif
+#endif
+#define MPIU_Assign_trunc(dst_,src_,dst_type_) \
do { \
dst_ = (dst_type_)(src_); \
/* will catch some of the cases if the expr_inttype macros aren't available */ \
MPIU_Assert((dst_) == (src_)); \
} while (0)
-#endif
/*
* Ensure an MPI_Aint value fits into a signed int.
http://git.mpich.org/mpich.git/commitdiff/e6962c162c743eb130e732e1d3ae8a8f6…
commit e6962c162c743eb130e732e1d3ae8a8f6f7c719c
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Fri Jul 19 10:52:28 2013 -0500
resized wasn't setting max_contig_count
Not much in MPICH consults the max_contig_count field of the datatypes,
except ROMIO. Resized types were reporting "huge negative number" for
the count of contiguous blocks because datatype code wasn't setting the
max_contig_count member. Why 3? The lower bound and upper bound parts
of the datatype, while not actually data or blocks, are effectively
blocks for the purposes of the one client of this code -- the ROMIO
datatype flattening code.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpid/common/datatype/mpid_type_create_resized.c b/src/mpid/common/datatype/mpid_type_create_resized.c
index 2120b32..07d753d 100644
--- a/src/mpid/common/datatype/mpid_type_create_resized.c
+++ b/src/mpid/common/datatype/mpid_type_create_resized.c
@@ -60,6 +60,7 @@ int MPID_Type_create_resized(MPI_Datatype oldtype,
new_dtp->element_size = oldsize;
new_dtp->is_contig = (extent == oldsize) ? 1 : 0;
new_dtp->eltype = oldtype;
+ new_dtp->max_contig_blocks = 3; /* lb, data, ub */
}
else
{
@@ -84,6 +85,7 @@ int MPID_Type_create_resized(MPI_Datatype oldtype,
new_dtp->is_contig =
(extent == old_dtp->size) ? old_dtp->is_contig : 0;
+ new_dtp->max_contig_blocks = old_dtp->max_contig_blocks;
}
*newtype_p = new_dtp->handle;
http://git.mpich.org/mpich.git/commitdiff/d4e6334c3ae2ae9925306087051b5a930…
commit d4e6334c3ae2ae9925306087051b5a930d9ffde2
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Tue Jul 16 09:14:48 2013 -0500
More ROMIO updates for large count
When flattening a datatype, be mindful of overflowing integers
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpi/romio/adio/common/flatten.c b/src/mpi/romio/adio/common/flatten.c
index 80fdd4c..c75bce0 100644
--- a/src/mpi/romio/adio/common/flatten.c
+++ b/src/mpi/romio/adio/common/flatten.c
@@ -731,11 +731,11 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
*
* ASSUMES THAT TYPE IS NOT A BASIC!!!
*/
-int ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, int *curr_index)
+MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, MPI_Count *curr_index)
{
#ifdef HAVE_MPIR_TYPE_GET_CONTIG_BLOCKS
/* MPICH can get us this value without all the envelope/contents calls */
- int blks;
+ MPI_Count blks;
MPIR_Type_get_contig_blocks(datatype, &blks);
*curr_index = blks;
return blks;
diff --git a/src/mpi/romio/adio/include/adioi.h b/src/mpi/romio/adio/include/adioi.h
index d138697..4eb926a 100644
--- a/src/mpi/romio/adio/include/adioi.h
+++ b/src/mpi/romio/adio/include/adioi.h
@@ -320,7 +320,7 @@ void ADIOI_Flatten_datatype(MPI_Datatype type);
void ADIOI_Flatten(MPI_Datatype type, ADIOI_Flatlist_node *flat,
ADIO_Offset st_offset, MPI_Count *curr_index);
void ADIOI_Delete_flattened(MPI_Datatype datatype);
-int ADIOI_Count_contiguous_blocks(MPI_Datatype type, int *curr_index);
+MPI_Count ADIOI_Count_contiguous_blocks(MPI_Datatype type, MPI_Count *curr_index);
void ADIOI_Complete_async(int *error_code);
void *ADIOI_Malloc_fn(size_t size, int lineno, const char *fname);
void *ADIOI_Calloc_fn(size_t nelem, size_t elsize, int lineno, const char *fname);
http://git.mpich.org/mpich.git/commitdiff/c66f901220b086cda4cdc5d3739abc66a…
commit c66f901220b086cda4cdc5d3739abc66a885bee0
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Fri Jul 12 08:55:26 2013 -0500
Increase size of internal datatype values
Trying to find all places in the datatype/dataloop code that put size of
datatype into an integer. It's easy, even under MPI-2, to describe more
than an integers worth of data with an MPI datatype.
since Dataloop code calls other dataloop code, just go ahead and make
everything a DLOOP_Count type
Fixes #1890
Fixes #1893
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpi/datatype/type_match_size.c b/src/mpi/datatype/type_match_size.c
index 5062849..cebc7e2 100644
--- a/src/mpi/datatype/type_match_size.c
+++ b/src/mpi/datatype/type_match_size.c
@@ -77,7 +77,8 @@ int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *datatype)
MPI_C_COMPLEX, MPI_C_DOUBLE_COMPLEX, MPI_C_LONG_DOUBLE_COMPLEX,
};
MPI_Datatype matched_datatype = MPI_DATATYPE_NULL;
- int i, tsize;
+ int i;
+ MPI_Aint tsize;
MPIU_THREADPRIV_DECL;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TYPE_MATCH_SIZE);
diff --git a/src/mpid/common/datatype/dataloop/dataloop.c b/src/mpid/common/datatype/dataloop/dataloop.c
index e96b2c5..532c51d 100644
--- a/src/mpid/common/datatype/dataloop/dataloop.c
+++ b/src/mpid/common/datatype/dataloop/dataloop.c
@@ -97,13 +97,13 @@ Input Parameters:
@*/
void PREPEND_PREFIX(Dataloop_copy)(void *dest,
void *src,
- int size)
+ DLOOP_Size size)
{
DLOOP_Offset ptrdiff;
#ifdef DLOOP_DEBUG_MEMORY
- DLOOP_dbg_printf("DLOOP_Dataloop_copy: copying from %x to %x (%d bytes).\n",
- (int) src, (int) dest, size);
+ DLOOP_dbg_printf("DLOOP_Dataloop_copy: copying from %x to %x (%z bytes).\n",
+ (int) src, (int) dest, (size_t)size);
#endif
/* copy region first */
@@ -286,7 +286,7 @@ Input Parameters:
void PREPEND_PREFIX(Dataloop_alloc)(int kind,
DLOOP_Count count,
DLOOP_Dataloop **new_loop_p,
- int *new_loop_sz_p)
+ MPI_Aint *new_loop_sz_p)
{
PREPEND_PREFIX(Dataloop_alloc_and_copy)(kind,
count,
@@ -317,15 +317,15 @@ Input Parameters:
void PREPEND_PREFIX(Dataloop_alloc_and_copy)(int kind,
DLOOP_Count count,
DLOOP_Dataloop *old_loop,
- int old_loop_sz,
+ DLOOP_Size old_loop_sz,
DLOOP_Dataloop **new_loop_p,
- int *new_loop_sz_p)
+ DLOOP_Size *new_loop_sz_p)
{
- int new_loop_sz = 0;
+ DLOOP_Size new_loop_sz = 0;
int align_sz = 8; /* default aligns everything to 8-byte boundaries */
int epsilon;
- int loop_sz = sizeof(DLOOP_Dataloop);
- int off_sz = 0, blk_sz = 0, ptr_sz = 0, extent_sz = 0;
+ DLOOP_Size loop_sz = sizeof(DLOOP_Dataloop);
+ DLOOP_Size off_sz = 0, blk_sz = 0, ptr_sz = 0, extent_sz = 0;
char *pos;
DLOOP_Dataloop *new_loop;
@@ -386,7 +386,7 @@ void PREPEND_PREFIX(Dataloop_alloc_and_copy)(int kind,
}
#ifdef DLOOP_DEBUG_MEMORY
- DLOOP_dbg_printf("DLOOP_Dataloop_alloc_and_copy: new loop @ %x (tot sz = %d, loop = %d, off = %d, blk = %d, ptr = %d, extent = %d, old = %d)\n",
+ DLOOP_dbg_printf("DLOOP_Dataloop_alloc_and_copy: new loop @ %x (tot sz = %z, loop = %z, off = %z, blk = %z, ptr = %z, extent = %z, old = %z)\n",
(int) new_loop,
new_loop_sz,
loop_sz,
@@ -505,17 +505,17 @@ Input Parameters:
old_loop_p (count elements).
@*/
void PREPEND_PREFIX(Dataloop_struct_alloc)(DLOOP_Count count,
- int old_loop_sz,
+ DLOOP_Size old_loop_sz,
int basic_ct,
DLOOP_Dataloop **old_loop_p,
DLOOP_Dataloop **new_loop_p,
- int *new_loop_sz_p)
+ DLOOP_Size *new_loop_sz_p)
{
- int new_loop_sz = 0;
+ DLOOP_Size new_loop_sz = 0;
int align_sz = 8; /* default aligns everything to 8-byte boundaries */
int epsilon;
- int loop_sz = sizeof(DLOOP_Dataloop);
- int off_sz, blk_sz, ptr_sz, extent_sz, basic_sz;
+ DLOOP_Size loop_sz = sizeof(DLOOP_Dataloop);
+ DLOOP_Size off_sz, blk_sz, ptr_sz, extent_sz, basic_sz;
DLOOP_Dataloop *new_loop;
@@ -567,7 +567,7 @@ void PREPEND_PREFIX(Dataloop_struct_alloc)(DLOOP_Count count,
}
#ifdef DLOOP_DEBUG_MEMORY
- DLOOP_dbg_printf("DLOOP_Dataloop_struct_alloc: new loop @ %x (tot sz = %d, loop = %d, off = %d, blk = %d, ptr = %d, extent = %d, basics = %d, old = %d)\n",
+ DLOOP_dbg_printf("DLOOP_Dataloop_struct_alloc: new loop @ %x (tot sz = %z, loop = %z, off = %z, blk = %z, ptr = %z, extent = %z, basics = %z, old = %z)\n",
(int) new_loop,
new_loop_sz,
loop_sz,
@@ -603,7 +603,7 @@ void PREPEND_PREFIX(Dataloop_struct_alloc)(DLOOP_Count count,
Returns 0 on success, -1 on failure.
@*/
void PREPEND_PREFIX(Dataloop_dup)(DLOOP_Dataloop *old_loop,
- int old_loop_sz,
+ DLOOP_Count old_loop_sz,
DLOOP_Dataloop **new_loop_p)
{
DLOOP_Dataloop *new_loop;
diff --git a/src/mpid/common/datatype/dataloop/dataloop_create.c b/src/mpid/common/datatype/dataloop/dataloop_create.c
index b16b63f..1d9f3d7 100644
--- a/src/mpid/common/datatype/dataloop/dataloop_create.c
+++ b/src/mpid/common/datatype/dataloop/dataloop_create.c
@@ -12,13 +12,13 @@
static void DLOOP_Dataloop_create_named(MPI_Datatype type,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ MPI_Aint *dlsz_p,
int *dldepth_p,
int flag);
void PREPEND_PREFIX(Dataloop_create)(MPI_Datatype type,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ MPI_Aint *dlsz_p,
int *dldepth_p,
int flag)
{
@@ -31,13 +31,15 @@ void PREPEND_PREFIX(Dataloop_create)(MPI_Datatype type,
MPI_Aint *aints;
DLOOP_Dataloop *old_dlp;
- int old_dlsz, old_dldepth;
+ MPI_Aint old_dlsz;
+ int old_dldepth;
int dummy1, dummy2, dummy3, type0_combiner, ndims;
MPI_Datatype tmptype;
MPI_Aint stride;
MPI_Aint *disps;
+ DLOOP_Size *blklen;
MPIR_Type_get_envelope_impl(type, &nr_ints, &nr_aints, &nr_types, &combiner);
@@ -222,13 +224,17 @@ void PREPEND_PREFIX(Dataloop_create)(MPI_Datatype type,
DLOOP_Free(disps);
break;
case MPI_COMBINER_INDEXED:
+ blklen = (DLOOP_Size *) DLOOP_Malloc(ints[0] * sizeof(DLOOP_Size));
+ for (i = 0; i < ints[0]; i++)
+ blklen[i] = ints[1+i];
PREPEND_PREFIX(Dataloop_create_indexed)(ints[0] /* count */,
- &ints[1] /* blklens */,
+ blklen /* blklens */,
&ints[ints[0]+1] /* disp */,
0 /* disp not in bytes */,
types[0] /* oldtype */,
dlp_p, dlsz_p, dldepth_p,
flag);
+ DLOOP_Free(blklen);
break;
case MPI_COMBINER_HINDEXED_INTEGER:
case MPI_COMBINER_HINDEXED:
@@ -243,8 +249,11 @@ void PREPEND_PREFIX(Dataloop_create)(MPI_Datatype type,
disps = aints;
}
+ blklen = (DLOOP_Size *) DLOOP_Malloc(ints[0] * sizeof(DLOOP_Size));
+ for (i=0; i< ints[0]; i++)
+ blklen[i] = (DLOOP_Size) ints[1+i];
PREPEND_PREFIX(Dataloop_create_indexed)(ints[0] /* count */,
- &ints[1] /* blklens */,
+ blklen /* blklens */,
disps,
1 /* disp in bytes */,
types[0] /* oldtype */,
@@ -254,6 +263,7 @@ void PREPEND_PREFIX(Dataloop_create)(MPI_Datatype type,
if (combiner == MPI_COMBINER_HINDEXED_INTEGER) {
DLOOP_Free(disps);
}
+ DLOOP_Free(blklen);
break;
case MPI_COMBINER_STRUCT_INTEGER:
@@ -372,7 +382,7 @@ void PREPEND_PREFIX(Dataloop_create)(MPI_Datatype type,
@*/
static void DLOOP_Dataloop_create_named(MPI_Datatype type,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ MPI_Aint *dlsz_p,
int *dldepth_p,
int flag)
{
diff --git a/src/mpid/common/datatype/dataloop/dataloop_create.h b/src/mpid/common/datatype/dataloop/dataloop_create.h
index 1d28d2d..f054429 100644
--- a/src/mpid/common/datatype/dataloop/dataloop_create.h
+++ b/src/mpid/common/datatype/dataloop/dataloop_create.h
@@ -11,53 +11,56 @@
/* Dataloop construction functions */
void PREPEND_PREFIX(Dataloop_create)(MPI_Datatype type,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ DLOOP_Size *dlsz_p,
int *dldepth_p,
int flag);
-int PREPEND_PREFIX(Dataloop_create_contiguous)(int count,
+int PREPEND_PREFIX(Dataloop_create_contiguous)(DLOOP_Count count,
MPI_Datatype oldtype,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ DLOOP_Size *dlsz_p,
int *dldepth_p,
int flag);
-int PREPEND_PREFIX(Dataloop_create_vector)(int count,
- int blocklength,
+int PREPEND_PREFIX(Dataloop_create_vector)(DLOOP_Count count,
+ DLOOP_Size blocklength,
MPI_Aint stride,
int strideinbytes,
MPI_Datatype oldtype,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ DLOOP_Size *dlsz_p,
int *dldepth_p,
int flag);
-int PREPEND_PREFIX(Dataloop_create_blockindexed)(int count,
- int blklen,
+int PREPEND_PREFIX(Dataloop_create_blockindexed)(DLOOP_Count count,
+ DLOOP_Size blklen,
const void *disp_array,
int dispinbytes,
MPI_Datatype oldtype,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ DLOOP_Size *dlsz_p,
int *dldepth_p,
int flag);
-int PREPEND_PREFIX(Dataloop_create_indexed)(int count,
- const int *blocklength_array,
+/* we bump up the size of the blocklength array because create_struct might use
+ * create_indexed in an optimization, and in course of doing so, generate a
+ * request of a large blocklength. */
+int PREPEND_PREFIX(Dataloop_create_indexed)(DLOOP_Count count,
+ const DLOOP_Size *blocklength_array,
const void *displacement_array,
int dispinbytes,
MPI_Datatype oldtype,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ DLOOP_Size *dlsz_p,
int *dldepth_p,
int flag);
-int PREPEND_PREFIX(Dataloop_create_struct)(int count,
+int PREPEND_PREFIX(Dataloop_create_struct)(DLOOP_Count count,
const int *blklen_array,
const MPI_Aint *disp_array,
const MPI_Datatype *oldtype_array,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ DLOOP_Size *dlsz_p,
int *dldepth_p,
int flag);
int PREPEND_PREFIX(Dataloop_create_pairtype)(MPI_Datatype type,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ DLOOP_Size *dlsz_p,
int *dldepth_p,
int flag);
@@ -81,7 +84,7 @@ int PREPEND_PREFIX(Type_convert_darray)(int size,
MPI_Datatype *newtype);
DLOOP_Count PREPEND_PREFIX(Type_indexed_count_contig)(DLOOP_Count count,
- const int *blocklength_array,
+ const DLOOP_Count *blocklength_array,
const void *displacement_array,
int dispinbytes,
DLOOP_Offset old_extent);
diff --git a/src/mpid/common/datatype/dataloop/dataloop_create_blockindexed.c b/src/mpid/common/datatype/dataloop/dataloop_create_blockindexed.c
index 76f20cc..9e9597b 100644
--- a/src/mpid/common/datatype/dataloop/dataloop_create_blockindexed.c
+++ b/src/mpid/common/datatype/dataloop/dataloop_create_blockindexed.c
@@ -19,7 +19,7 @@ static void DLOOP_Type_blockindexed_array_copy(DLOOP_Count count,
Dataloop_create_blockindexed - create blockindexed dataloop
Arguments:
-+ int count
++ DLOOP_Count count
. void *displacement_array (array of either MPI_Aints or ints)
. int displacement_in_bytes (boolean)
. MPI_Datatype old_type
@@ -31,18 +31,19 @@ static void DLOOP_Type_blockindexed_array_copy(DLOOP_Count count,
.N Errors
.N Returns 0 on success, -1 on failure.
@*/
-int PREPEND_PREFIX(Dataloop_create_blockindexed)(int icount,
- int iblklen,
+int PREPEND_PREFIX(Dataloop_create_blockindexed)(DLOOP_Count icount,
+ DLOOP_Count iblklen,
const void *disp_array,
int dispinbytes,
DLOOP_Type oldtype,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ DLOOP_Size *dlsz_p,
int *dldepth_p,
int flag)
{
int err, is_builtin, is_vectorizable = 1;
- int i, new_loop_sz, old_loop_depth;
+ int i, old_loop_depth;
+ DLOOP_Size new_loop_sz;
DLOOP_Count contig_count, count, blklen;
DLOOP_Offset old_extent, eff_disp0, eff_disp1, last_stride;
@@ -201,7 +202,7 @@ int PREPEND_PREFIX(Dataloop_create_blockindexed)(int icount,
else
{
DLOOP_Dataloop *old_loop_ptr = NULL;
- int old_loop_sz = 0;
+ MPI_Aint old_loop_sz = 0;
DLOOP_Handle_get_loopptr_macro(oldtype, old_loop_ptr, flag);
DLOOP_Handle_get_loopsize_macro(oldtype, old_loop_sz, flag);
diff --git a/src/mpid/common/datatype/dataloop/dataloop_create_contig.c b/src/mpid/common/datatype/dataloop/dataloop_create_contig.c
index b72b9a2..290bf2a 100644
--- a/src/mpid/common/datatype/dataloop/dataloop_create_contig.c
+++ b/src/mpid/common/datatype/dataloop/dataloop_create_contig.c
@@ -22,20 +22,21 @@
.N Errors
.N Returns 0 on success, -1 on failure.
@*/
-int PREPEND_PREFIX(Dataloop_create_contiguous)(int icount,
+int PREPEND_PREFIX(Dataloop_create_contiguous)(DLOOP_Count icount,
DLOOP_Type oldtype,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ DLOOP_Size *dlsz_p,
int *dldepth_p,
int flag)
{
DLOOP_Count count;
int is_builtin, apply_contig_coalescing = 0;
- int new_loop_sz, new_loop_depth;
+ int new_loop_depth;
+ DLOOP_Size new_loop_sz;
DLOOP_Dataloop *new_dlp;
- count = (DLOOP_Count) icount; /* avoid subsequent casting */
+ count = icount;
is_builtin = (DLOOP_Handle_hasloop_macro(oldtype)) ? 0 : 1;
@@ -103,7 +104,7 @@ int PREPEND_PREFIX(Dataloop_create_contiguous)(int icount,
{
/* user-defined base type (oldtype) */
DLOOP_Dataloop *old_loop_ptr;
- int old_loop_sz = 0;
+ MPI_Aint old_loop_sz = 0;
DLOOP_Handle_get_loopptr_macro(oldtype, old_loop_ptr, flag);
DLOOP_Handle_get_loopsize_macro(oldtype, old_loop_sz, flag);
diff --git a/src/mpid/common/datatype/dataloop/dataloop_create_indexed.c b/src/mpid/common/datatype/dataloop/dataloop_create_indexed.c
index 59fafc6..62dcf63 100644
--- a/src/mpid/common/datatype/dataloop/dataloop_create_indexed.c
+++ b/src/mpid/common/datatype/dataloop/dataloop_create_indexed.c
@@ -11,7 +11,7 @@
static void DLOOP_Type_indexed_array_copy(DLOOP_Count count,
DLOOP_Count contig_count,
- const int *input_blocklength_array,
+ const DLOOP_Size *input_blocklength_array,
const void *input_displacement_array,
DLOOP_Count *output_blocklength_array,
DLOOP_Offset *out_disp_array,
@@ -23,7 +23,7 @@ static void DLOOP_Type_indexed_array_copy(DLOOP_Count count,
Arguments:
+ int icount
-. int *iblocklength_array
+. DLOOP_Size *iblocklength_array
. void *displacement_array (either ints or MPI_Aints)
. int dispinbytes
. MPI_Datatype oldtype
@@ -36,18 +36,20 @@ static void DLOOP_Type_indexed_array_copy(DLOOP_Count count,
.N Returns 0 on success, -1 on error.
@*/
-int PREPEND_PREFIX(Dataloop_create_indexed)(int icount,
- const int *blocklength_array,
+int PREPEND_PREFIX(Dataloop_create_indexed)(DLOOP_Count icount,
+ const DLOOP_Size *blocklength_array,
const void *displacement_array,
int dispinbytes,
MPI_Datatype oldtype,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ DLOOP_Size *dlsz_p,
int *dldepth_p,
int flag)
{
int err, is_builtin;
- int i, new_loop_sz, old_loop_depth, blksz;
+ int old_loop_depth;
+ MPI_Aint i;
+ DLOOP_Size new_loop_sz, blksz;
DLOOP_Count first;
DLOOP_Count old_type_count = 0, contig_count, count;
@@ -120,7 +122,7 @@ int PREPEND_PREFIX(Dataloop_create_indexed)(int icount,
((!dispinbytes && ((int *) displacement_array)[first] == 0) ||
(dispinbytes && ((MPI_Aint *) displacement_array)[first] == 0)))
{
- err = PREPEND_PREFIX(Dataloop_create_contiguous)((int) old_type_count,
+ err = PREPEND_PREFIX(Dataloop_create_contiguous)(old_type_count,
oldtype,
dlp_p,
dlsz_p,
@@ -143,7 +145,7 @@ int PREPEND_PREFIX(Dataloop_create_indexed)(int icount,
else
disp_arr_tmp = &(((const int *)displacement_array)[first]);
err = PREPEND_PREFIX(Dataloop_create_blockindexed)(1,
- (int) old_type_count,
+ old_type_count,
disp_arr_tmp,
dispinbytes,
oldtype,
@@ -228,7 +230,7 @@ int PREPEND_PREFIX(Dataloop_create_indexed)(int icount,
else
{
DLOOP_Dataloop *old_loop_ptr = NULL;
- int old_loop_sz = 0;
+ MPI_Aint old_loop_sz = 0;
DLOOP_Handle_get_loopptr_macro(oldtype, old_loop_ptr, flag);
DLOOP_Handle_get_loopsize_macro(oldtype, old_loop_sz, flag);
@@ -299,7 +301,7 @@ int PREPEND_PREFIX(Dataloop_create_indexed)(int icount,
*/
static void DLOOP_Type_indexed_array_copy(DLOOP_Count count,
DLOOP_Count contig_count,
- const int *in_blklen_array,
+ const DLOOP_Size *in_blklen_array,
const void *in_disp_array,
DLOOP_Count *out_blklen_array,
DLOOP_Offset *out_disp_array,
@@ -384,7 +386,7 @@ static void DLOOP_Type_indexed_array_copy(DLOOP_Count count,
* Extent passed in is for the original type.
*/
DLOOP_Count PREPEND_PREFIX(Type_indexed_count_contig)(DLOOP_Count count,
- const int *blocklength_array,
+ const DLOOP_Count *blocklength_array,
const void *displacement_array,
int dispinbytes,
DLOOP_Offset old_extent)
diff --git a/src/mpid/common/datatype/dataloop/dataloop_create_pairtype.c b/src/mpid/common/datatype/dataloop/dataloop_create_pairtype.c
index 81644a7..78ec694 100644
--- a/src/mpid/common/datatype/dataloop/dataloop_create_pairtype.c
+++ b/src/mpid/common/datatype/dataloop/dataloop_create_pairtype.c
@@ -38,7 +38,7 @@
@*/
int PREPEND_PREFIX(Dataloop_create_pairtype)(MPI_Datatype type,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ MPI_Aint *dlsz_p,
int *dldepth_p,
int flag)
{
diff --git a/src/mpid/common/datatype/dataloop/dataloop_create_struct.c b/src/mpid/common/datatype/dataloop/dataloop_create_struct.c
index 3df6328..7d51b7b 100644
--- a/src/mpid/common/datatype/dataloop/dataloop_create_struct.c
+++ b/src/mpid/common/datatype/dataloop/dataloop_create_struct.c
@@ -12,30 +12,30 @@
#endif
static int DLOOP_Dataloop_create_struct_memory_error(void);
-static int DLOOP_Dataloop_create_unique_type_struct(int count,
+static int DLOOP_Dataloop_create_unique_type_struct(DLOOP_Count count,
const int *blklens,
const MPI_Aint *disps,
const DLOOP_Type *oldtypes,
int type_pos,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ MPI_Aint *dlsz_p,
int *dldepth_p,
int flag);
static int DLOOP_Dataloop_create_basic_all_bytes_struct(
- int count,
+ DLOOP_Count count,
const int *blklens,
const MPI_Aint *disps,
const DLOOP_Type *oldtypes,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ MPI_Aint *dlsz_p,
int *dldepth_p,
int flag);
-static int DLOOP_Dataloop_create_flattened_struct(int count,
+static int DLOOP_Dataloop_create_flattened_struct(DLOOP_Count count,
const int *blklens,
const MPI_Aint *disps,
const DLOOP_Type *oldtypes,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ MPI_Aint *dlsz_p,
int *dldepth_p,
int flag);
@@ -64,12 +64,12 @@ Output Parameters:
or corrected in this code at this time.
@*/
-int PREPEND_PREFIX(Dataloop_create_struct)(int count,
+int PREPEND_PREFIX(Dataloop_create_struct)(DLOOP_Count count,
const int *blklens,
const MPI_Aint *disps,
const DLOOP_Type *oldtypes,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ MPI_Aint *dlsz_p,
int *dldepth_p,
int flag)
{
@@ -79,8 +79,9 @@ int PREPEND_PREFIX(Dataloop_create_struct)(int count,
first_derived = MPI_DATATYPE_NULL;
/* variables used in general case only */
- int loop_idx, new_loop_sz, new_loop_depth;
- int old_loop_sz = 0, old_loop_depth = 0;
+ int loop_idx, new_loop_depth;
+ int old_loop_depth = 0;
+ MPI_Aint new_loop_sz, old_loop_sz = 0;
DLOOP_Dataloop *new_dlp, *curpos;
@@ -259,7 +260,8 @@ int PREPEND_PREFIX(Dataloop_create_struct)(int count,
if (DLOOP_Handle_hasloop_macro(oldtypes[i]))
{
- int tmp_loop_depth, tmp_loop_sz;
+ int tmp_loop_depth;
+ MPI_Aint tmp_loop_sz;
DLOOP_Handle_get_loopdepth_macro(oldtypes[i], tmp_loop_depth, flag);
DLOOP_Handle_get_loopsize_macro(oldtypes[i], tmp_loop_sz, flag);
@@ -326,7 +328,8 @@ int PREPEND_PREFIX(Dataloop_create_struct)(int count,
if (is_builtin)
{
DLOOP_Dataloop *dummy_dlp;
- int dummy_sz, dummy_depth;
+ int dummy_depth;
+ MPI_Aint dummy_sz;
/* LBs and UBs already taken care of -- skip them */
if (oldtypes[i] == MPI_LB || oldtypes[i] == MPI_UB)
@@ -405,24 +408,25 @@ static int DLOOP_Dataloop_create_struct_memory_error(void)
}
/* --END ERROR HANDLING-- */
-static int DLOOP_Dataloop_create_unique_type_struct(int count,
+static int DLOOP_Dataloop_create_unique_type_struct(DLOOP_Count count,
const int *blklens,
const MPI_Aint *disps,
const DLOOP_Type *oldtypes,
int type_pos,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ MPI_Aint *dlsz_p,
int *dldepth_p,
int flag)
{
/* the same type used more than once in the array; type_pos
* indexes to the first of these.
*/
- int i, err, *tmp_blklens, cur_pos = 0;
+ int i, err, cur_pos = 0;
+ DLOOP_Size *tmp_blklens;
DLOOP_Offset *tmp_disps;
/* count is an upper bound on number of type instances */
- tmp_blklens = (int *) DLOOP_Malloc(count * sizeof(int));
+ tmp_blklens = (DLOOP_Size *) DLOOP_Malloc(count * sizeof(DLOOP_Size));
/* --BEGIN ERROR HANDLING-- */
if (!tmp_blklens) {
/* TODO: ??? */
@@ -468,21 +472,21 @@ static int DLOOP_Dataloop_create_unique_type_struct(int count,
}
static int DLOOP_Dataloop_create_basic_all_bytes_struct(
- int count,
+ DLOOP_Count count,
const int *blklens,
const MPI_Aint *disps,
const DLOOP_Type *oldtypes,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ MPI_Aint *dlsz_p,
int *dldepth_p,
int flag)
{
int i, err, cur_pos = 0;
- int *tmp_blklens;
+ DLOOP_Size *tmp_blklens;
MPI_Aint *tmp_disps;
/* count is an upper bound on number of type instances */
- tmp_blklens = (int *) DLOOP_Malloc(count * sizeof(int));
+ tmp_blklens = (DLOOP_Size *) DLOOP_Malloc(count * sizeof(DLOOP_Size));
/* --BEGIN ERROR HANDLING-- */
if (!tmp_blklens)
@@ -529,23 +533,25 @@ static int DLOOP_Dataloop_create_basic_all_bytes_struct(
return err;
}
-static int DLOOP_Dataloop_create_flattened_struct(int count,
+static int DLOOP_Dataloop_create_flattened_struct(DLOOP_Count count,
const int *blklens,
const MPI_Aint *disps,
const DLOOP_Type *oldtypes,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ MPI_Aint *dlsz_p,
int *dldepth_p,
int flag)
{
/* arbitrary types, convert to bytes and use indexed */
- int i, err, *tmp_blklens, nr_blks = 0;
+ int i, err, nr_blks = 0;
+ DLOOP_Size *tmp_blklens;
MPI_Aint *tmp_disps; /* since we're calling another fn that takes
this type as an input parameter */
DLOOP_Offset bytes;
DLOOP_Segment *segp;
- int first_ind, last_ind;
+ int first_ind;
+ DLOOP_Size last_ind;
segp = PREPEND_PREFIX(Segment_alloc)();
/* --BEGIN ERROR HANDLING-- */
@@ -615,7 +621,7 @@ static int DLOOP_Dataloop_create_flattened_struct(int count,
nr_blks += 2; /* safety measure */
- tmp_blklens = (int *) DLOOP_Malloc(nr_blks * sizeof(int));
+ tmp_blklens = (DLOOP_Size *) DLOOP_Malloc(nr_blks * sizeof(DLOOP_Size));
/* --BEGIN ERROR HANDLING-- */
if (!tmp_blklens) {
PREPEND_PREFIX(Segment_free)(segp);
diff --git a/src/mpid/common/datatype/dataloop/dataloop_create_vector.c b/src/mpid/common/datatype/dataloop/dataloop_create_vector.c
index fc0e069..9f86daf 100644
--- a/src/mpid/common/datatype/dataloop/dataloop_create_vector.c
+++ b/src/mpid/common/datatype/dataloop/dataloop_create_vector.c
@@ -24,18 +24,19 @@
Returns 0 on success, -1 on failure.
@*/
-int PREPEND_PREFIX(Dataloop_create_vector)(int icount,
- int iblocklength,
+int PREPEND_PREFIX(Dataloop_create_vector)(DLOOP_Count icount,
+ DLOOP_Size iblocklength,
MPI_Aint astride,
int strideinbytes,
DLOOP_Type oldtype,
DLOOP_Dataloop **dlp_p,
- int *dlsz_p,
+ DLOOP_Size *dlsz_p,
int *dldepth_p,
int flag)
{
int err, is_builtin;
- int new_loop_sz, new_loop_depth;
+ DLOOP_Size new_loop_sz;
+ int new_loop_depth;
DLOOP_Count count, blocklength;
DLOOP_Offset stride;
@@ -81,7 +82,8 @@ int PREPEND_PREFIX(Dataloop_create_vector)(int icount,
new_loop_depth = 1;
}
else {
- int old_loop_sz = 0, old_loop_depth = 0;
+ MPI_Aint old_loop_sz = 0;
+ int old_loop_depth = 0;
DLOOP_Handle_get_loopsize_macro(oldtype, old_loop_sz, flag);
DLOOP_Handle_get_loopdepth_macro(oldtype, old_loop_depth, flag);
@@ -129,7 +131,7 @@ int PREPEND_PREFIX(Dataloop_create_vector)(int icount,
}
else /* user-defined base type (oldtype) */ {
DLOOP_Dataloop *old_loop_ptr;
- int old_loop_sz = 0;
+ MPI_Aint old_loop_sz = 0;
DLOOP_Handle_get_loopptr_macro(oldtype, old_loop_ptr, flag);
DLOOP_Handle_get_loopsize_macro(oldtype, old_loop_sz, flag);
diff --git a/src/mpid/common/datatype/dataloop/dataloop_parts.h b/src/mpid/common/datatype/dataloop/dataloop_parts.h
index 6da3517..b4bd636 100644
--- a/src/mpid/common/datatype/dataloop/dataloop_parts.h
+++ b/src/mpid/common/datatype/dataloop/dataloop_parts.h
@@ -33,6 +33,10 @@
#error "DLOOP_Type must be defined before dataloop_parts.h is included."
#endif
+#ifndef DLOOP_Size
+#error "DLOOP_Size must be defined before dataloop_parts.h is included."
+#endif
+
/* Redefine all of the internal structures in terms of the prefix */
#define DLOOP_Dataloop PREPEND_PREFIX(Dataloop)
#define DLOOP_Dataloop_contig PREPEND_PREFIX(Dataloop_contig)
@@ -317,7 +321,7 @@ typedef struct DLOOP_Segment {
/* Dataloop functions (dataloop.c) */
void PREPEND_PREFIX(Dataloop_copy)(void *dest,
void *src,
- int size);
+ DLOOP_Size size);
void PREPEND_PREFIX(Dataloop_update)(DLOOP_Dataloop *dataloop,
DLOOP_Offset ptrdiff);
DLOOP_Offset
@@ -329,21 +333,21 @@ void PREPEND_PREFIX(Dataloop_print)(DLOOP_Dataloop *dataloop,
void PREPEND_PREFIX(Dataloop_alloc)(int kind,
DLOOP_Count count,
DLOOP_Dataloop **new_loop_p,
- int *new_loop_sz_p);
+ DLOOP_Size *new_loop_sz_p);
void PREPEND_PREFIX(Dataloop_alloc_and_copy)(int kind,
DLOOP_Count count,
DLOOP_Dataloop *old_loop,
- int old_loop_sz,
+ DLOOP_Size old_loop_sz,
DLOOP_Dataloop **new_loop_p,
- int *new_loop_sz_p);
+ DLOOP_Size *new_loop_sz_p);
void PREPEND_PREFIX(Dataloop_struct_alloc)(DLOOP_Count count,
- int old_loop_sz,
+ DLOOP_Size old_loop_sz,
int basic_ct,
DLOOP_Dataloop **old_loop_p,
DLOOP_Dataloop **new_loop_p,
- int *new_loop_sz_p);
+ DLOOP_Size *new_loop_sz_p);
void PREPEND_PREFIX(Dataloop_dup)(DLOOP_Dataloop *old_loop,
- int old_loop_sz,
+ DLOOP_Size old_loop_sz,
DLOOP_Dataloop **new_loop_p);
void PREPEND_PREFIX(Dataloop_free)(DLOOP_Dataloop **dataloop);
@@ -403,9 +407,9 @@ void PREPEND_PREFIX(Segment_count_contig_blocks)(DLOOP_Segment *segp,
void PREPEND_PREFIX(Segment_mpi_flatten)(DLOOP_Segment *segp,
DLOOP_Offset first,
DLOOP_Offset *lastp,
- int *blklens,
+ DLOOP_Size *blklens,
MPI_Aint *disps,
- int *lengthp);
+ DLOOP_Size *lengthp);
#define DLOOP_M2M_TO_USERBUF 0
#define DLOOP_M2M_FROM_USERBUF 1
diff --git a/src/mpid/common/datatype/dataloop/segment.c b/src/mpid/common/datatype/dataloop/segment.c
index 87c0d8a..5408135 100644
--- a/src/mpid/common/datatype/dataloop/segment.c
+++ b/src/mpid/common/datatype/dataloop/segment.c
@@ -593,7 +593,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
return;
}
else /* myblocks >= cur_elmp->curblock */ {
- int count_index = 0;
+ MPI_Aint count_index = 0;
/* this assumes we're either *just* processing the last parts
* of the current block, or we're processing as many blocks as
@@ -736,7 +736,7 @@ void PREPEND_PREFIX(Segment_manipulate)(struct DLOOP_Segment *segp,
}
else /* push the stackelm */ {
DLOOP_Dataloop_stackelm *next_elmp;
- int count_index, block_index;
+ MPI_Aint count_index, block_index;
count_index = cur_elmp->orig_count - cur_elmp->curcount;
block_index = cur_elmp->orig_block - cur_elmp->curblock;
diff --git a/src/mpid/common/datatype/dataloop/segment_flatten.c b/src/mpid/common/datatype/dataloop/segment_flatten.c
index c8ea1ba..0a035ec 100644
--- a/src/mpid/common/datatype/dataloop/segment_flatten.c
+++ b/src/mpid/common/datatype/dataloop/segment_flatten.c
@@ -45,9 +45,10 @@ static int DLOOP_Leaf_index_mpi_flatten(DLOOP_Offset *blocks_p,
void *v_paramp);
struct PREPEND_PREFIX(mpi_flatten_params) {
- int index, length;
+ int index;
+ MPI_Aint length;
MPI_Aint last_end;
- int *blklens;
+ MPI_Aint *blklens;
MPI_Aint *disps;
};
@@ -72,9 +73,9 @@ struct PREPEND_PREFIX(mpi_flatten_params) {
void PREPEND_PREFIX(Segment_mpi_flatten)(DLOOP_Segment *segp,
DLOOP_Offset first,
DLOOP_Offset *lastp,
- int *blklens,
+ DLOOP_Size *blklens,
MPI_Aint *disps,
- int *lengthp)
+ DLOOP_Size *lengthp)
{
struct PREPEND_PREFIX(mpi_flatten_params) params;
@@ -111,7 +112,8 @@ static int DLOOP_Leaf_contig_mpi_flatten(DLOOP_Offset *blocks_p,
void *bufp,
void *v_paramp)
{
- int last_idx, size;
+ int last_idx;
+ DLOOP_Offset size;
DLOOP_Offset el_size;
char *last_end = NULL;
struct PREPEND_PREFIX(mpi_flatten_params) *paramp = v_paramp;
@@ -186,24 +188,25 @@ static int DLOOP_Leaf_vector_mpi_flatten(DLOOP_Offset *blocks_p,
void *bufp, /* start of buffer */
void *v_paramp)
{
- int i, size, blocks_left;
+ int i;
+ DLOOP_Size size, blocks_left;
DLOOP_Offset el_size;
struct PREPEND_PREFIX(mpi_flatten_params) *paramp = v_paramp;
DLOOP_Handle_get_size_macro(el_type, el_size);
- blocks_left = (int)*blocks_p;
+ blocks_left = *blocks_p;
for (i=0; i < count && blocks_left > 0; i++) {
int last_idx;
char *last_end = NULL;
if (blocks_left > blksz) {
- size = blksz * (int) el_size;
+ size = blksz * el_size;
blocks_left -= blksz;
}
else {
/* last pass */
- size = blocks_left * (int) el_size;
+ size = blocks_left * el_size;
blocks_left = 0;
}
@@ -231,7 +234,7 @@ static int DLOOP_Leaf_vector_mpi_flatten(DLOOP_Offset *blocks_p,
/* we have used up all our entries, and this one doesn't fit on
* the end of the last one.
*/
- *blocks_p -= (blocks_left + (size / (int) el_size));
+ *blocks_p -= (blocks_left + (size / el_size));
#ifdef MPID_SP_VERBOSE
MPIU_dbg_printf("\t[vector to vec exiting (1): next ind = %d, " DLOOP_OFFSET_FMT_DEC_SPEC " blocks processed.\n",
paramp->u.pack_vector.index,
@@ -280,7 +283,8 @@ static int DLOOP_Leaf_blkidx_mpi_flatten(DLOOP_Offset *blocks_p,
void *bufp,
void *v_paramp)
{
- int i, size, blocks_left;
+ int i;
+ DLOOP_Size blocks_left, size;
DLOOP_Offset el_size;
struct PREPEND_PREFIX(mpi_flatten_params) *paramp = v_paramp;
@@ -292,12 +296,12 @@ static int DLOOP_Leaf_blkidx_mpi_flatten(DLOOP_Offset *blocks_p,
char *last_end = NULL;
if (blocks_left > blksz) {
- size = blksz * (int) el_size;
+ size = blksz * el_size;
blocks_left -= blksz;
}
else {
/* last pass */
- size = blocks_left * (int) el_size;
+ size = blocks_left * el_size;
blocks_left = 0;
}
@@ -362,7 +366,8 @@ static int DLOOP_Leaf_index_mpi_flatten(DLOOP_Offset *blocks_p,
void *bufp,
void *v_paramp)
{
- int i, size, blocks_left;
+ int i;
+ DLOOP_Size size, blocks_left;
DLOOP_Offset el_size;
struct PREPEND_PREFIX(mpi_flatten_params) *paramp = v_paramp;
@@ -374,12 +379,12 @@ static int DLOOP_Leaf_index_mpi_flatten(DLOOP_Offset *blocks_p,
char *last_end = NULL;
if (blocks_left > blockarray[i]) {
- size = blockarray[i] * (int) el_size;
+ size = blockarray[i] * el_size;
blocks_left -= blockarray[i];
}
else {
/* last pass */
- size = blocks_left * (int) el_size;
+ size = blocks_left * el_size;
blocks_left = 0;
}
@@ -407,7 +412,7 @@ static int DLOOP_Leaf_index_mpi_flatten(DLOOP_Offset *blocks_p,
/* we have used up all our entries, and this one doesn't fit on
* the end of the last one.
*/
- *blocks_p -= (blocks_left + (size / (int) el_size));
+ *blocks_p -= (blocks_left + (size / el_size));
return 1;
}
else if (last_idx >= 0 && (last_end == ((char *) bufp + rel_off + offsetarray[i])))
diff --git a/src/mpid/common/datatype/mpid_dataloop.h b/src/mpid/common/datatype/mpid_dataloop.h
index 7cf0290..7469792 100644
--- a/src/mpid/common/datatype/mpid_dataloop.h
+++ b/src/mpid/common/datatype/mpid_dataloop.h
@@ -19,13 +19,14 @@
* instance:
*/
#define DLOOP_Offset MPI_Aint
-#define DLOOP_Count int
+#define DLOOP_Count MPI_Aint
#define DLOOP_Handle MPI_Datatype
#define DLOOP_Type MPI_Datatype
#define DLOOP_Buffer void *
#define DLOOP_VECTOR MPID_IOV
#define DLOOP_VECTOR_LEN MPID_IOV_LEN
#define DLOOP_VECTOR_BUF MPID_IOV_BUF
+#define DLOOP_Size MPI_Aint
/* The following accessor functions must also be defined:
*
diff --git a/src/mpid/common/datatype/mpid_datatype.h b/src/mpid/common/datatype/mpid_datatype.h
index 84ad551..9f1e51a 100644
--- a/src/mpid/common/datatype/mpid_datatype.h
+++ b/src/mpid/common/datatype/mpid_datatype.h
@@ -358,11 +358,12 @@ typedef struct MPID_Datatype {
MPIU_OBJECT_HEADER; /* adds handle and ref_count fields */
/* basic parameters for datatype, accessible via MPI calls */
- MPI_Aint size;
+ MPI_Aint size; /* MPI_Count could be 128 bits, so use MPI_Aint */
MPI_Aint extent, ub, lb, true_ub, true_lb;
/* chars affecting subsequent datatype processing and creation */
- int alignsize, has_sticky_ub, has_sticky_lb;
+ MPI_Aint alignsize;
+ int has_sticky_ub, has_sticky_lb;
int is_permanent; /* non-zero if datatype is a predefined type */
int is_committed;
@@ -371,7 +372,8 @@ typedef struct MPID_Datatype {
* if type is composed of more than one element type, then
* eltype == MPI_DATATYPE_NULL and element_size == -1
*/
- int eltype, n_elements;
+ int eltype;
+ MPI_Aint n_elements;
MPI_Aint element_size;
/* information on contiguity of type, for processing shortcuts.
@@ -384,7 +386,7 @@ typedef struct MPID_Datatype {
* It is not trivial to calculate the *real* number of contig
* blocks in the case where old datatype is non-contiguous
*/
- int max_contig_blocks;
+ MPI_Aint max_contig_blocks;
/* pointer to contents and envelope data for the datatype */
MPID_Datatype_contents *contents;
@@ -393,11 +395,11 @@ typedef struct MPID_Datatype {
* and a depth used to verify that we can process it (limited stack depth
*/
struct MPID_Dataloop *dataloop; /* might be optimized for homogenous */
- int dataloop_size;
+ MPI_Aint dataloop_size;
int dataloop_depth;
#if defined(MPID_HAS_HETERO) || 1
struct MPID_Dataloop *hetero_dloop; /* heterogeneous dataloop */
- int hetero_dloop_size;
+ MPI_Aint hetero_dloop_size;
int hetero_dloop_depth;
#endif /* MPID_HAS_HETERO */
/* MPI-2 attributes and name */
@@ -623,30 +625,30 @@ void MPIDI_Datatype_printf(MPI_Datatype type,
/* Dataloop functions */
void MPID_Dataloop_copy(void *dest,
void *src,
- int size);
+ MPI_Aint size);
void MPID_Dataloop_print(struct MPID_Dataloop *dataloop,
int depth);
void MPID_Dataloop_alloc(int kind,
- int count,
+ MPI_Aint count,
DLOOP_Dataloop **new_loop_p,
- int *new_loop_sz_p);
+ MPI_Aint *new_loop_sz_p);
void MPID_Dataloop_alloc_and_copy(int kind,
- int count,
+ MPI_Aint count,
struct DLOOP_Dataloop *old_loop,
- int old_loop_sz,
+ MPI_Aint old_loop_sz,
struct DLOOP_Dataloop **new_loop_p,
- int *new_loop_sz_p);
-void MPID_Dataloop_struct_alloc(int count,
- int old_loop_sz,
+ MPI_Aint *new_loop_sz_p);
+void MPID_Dataloop_struct_alloc(MPI_Aint count,
+ MPI_Aint old_loop_sz,
int basic_ct,
DLOOP_Dataloop **old_loop_p,
DLOOP_Dataloop **new_loop_p,
- int *new_loop_sz_p);
+ MPI_Aint *new_loop_sz_p);
void MPID_Dataloop_dup(DLOOP_Dataloop *old_loop,
- int old_loop_sz,
+ MPI_Aint old_loop_sz,
DLOOP_Dataloop **new_loop_p);
void MPID_Dataloop_free(struct MPID_Dataloop **dataloop);
@@ -667,7 +669,7 @@ void MPID_Segment_flatten(struct DLOOP_Segment *segp,
DLOOP_Offset first,
DLOOP_Offset *lastp,
DLOOP_Offset *offp,
- int *sizep,
+ DLOOP_Size *sizep,
DLOOP_Offset *lengthp);
/* misc */
@@ -693,12 +695,12 @@ void MPID_Datatype_free(struct MPID_Datatype *ptr);
void MPID_Dataloop_update(struct DLOOP_Dataloop *dataloop,
MPI_Aint ptrdiff);
-int MPIR_Type_get_contig_blocks(MPI_Datatype type,
- int *nr_blocks_p);
+MPI_Count MPIR_Type_get_contig_blocks(MPI_Datatype type,
+ MPI_Count *nr_blocks_p);
int MPIR_Type_flatten(MPI_Datatype type,
MPI_Aint *off_array,
- int *size_array,
+ DLOOP_Size *size_array,
MPI_Aint *array_len_p);
void MPID_Segment_pack_external32(struct DLOOP_Segment *segp,
diff --git a/src/mpid/common/datatype/mpid_segment.c b/src/mpid/common/datatype/mpid_segment.c
index 3cf7ce4..f52a5eb 100644
--- a/src/mpid/common/datatype/mpid_segment.c
+++ b/src/mpid/common/datatype/mpid_segment.c
@@ -35,9 +35,9 @@ struct MPID_Segment_piece_params {
} pack_vector;
struct {
int64_t *offp;
- int *sizep; /* see notes in Segment_flatten header */
+ DLOOP_Size *sizep; /* see notes in Segment_flatten header */
int index;
- int length;
+ MPI_Aint length;
} flatten;
struct {
char *last_loc;
@@ -54,8 +54,8 @@ struct MPID_Segment_piece_params {
/* prototypes of internal functions */
static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
- int count,
- int blksz,
+ DLOOP_Count count,
+ DLOOP_Size blksz,
DLOOP_Offset stride,
DLOOP_Type el_type,
DLOOP_Offset rel_off,
@@ -75,8 +75,8 @@ static int MPID_Segment_contig_flatten(DLOOP_Offset *blocks_p,
void *v_paramp);
static int MPID_Segment_vector_flatten(DLOOP_Offset *blocks_p,
- int count,
- int blksz,
+ DLOOP_Count count,
+ DLOOP_Size blksz,
DLOOP_Offset stride,
DLOOP_Type el_type,
DLOOP_Offset rel_off, /* offset into buffer */
@@ -173,7 +173,7 @@ void MPID_Segment_flatten(struct DLOOP_Segment *segp,
DLOOP_Offset first,
DLOOP_Offset *lastp,
DLOOP_Offset *offp,
- int *sizep,
+ DLOOP_Size *sizep,
DLOOP_Offset *lengthp)
{
struct MPID_Segment_piece_params packvec_params;
@@ -292,8 +292,8 @@ static int MPID_Segment_contig_pack_to_iov(DLOOP_Offset *blocks_p,
* of a whole block in a vector type.
*/
static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
- int count,
- int blksz,
+ DLOOP_Count count,
+ DLOOP_Size blksz,
DLOOP_Offset stride,
DLOOP_Type el_type,
DLOOP_Offset rel_off, /* offset into buffer */
@@ -313,7 +313,9 @@ static int MPID_Segment_vector_pack_to_iov(DLOOP_Offset *blocks_p,
MPIU_DBG_MSG_FMT(DATATYPE,VERBOSE,(MPIU_DBG_FDEST,
" vector to vec: do=" MPI_AINT_FMT_DEC_SPEC
", dp=%p"
- ", len=%d, ind=%d, ct=%d, blksz=%d"
+ ", len=" MPI_AINT_FMT_DEC_SPEC
+ ", ind=%d, ct=" MPI_AINT_FMT_DEC_SPEC
+ ", blksz=" MPI_AINT_FMT_DEC_SPEC
", str=" MPI_AINT_FMT_DEC_SPEC
", blks=" MPI_AINT_FMT_DEC_SPEC,
(MPI_Aint) rel_off,
@@ -465,8 +467,8 @@ static int MPID_Segment_contig_flatten(DLOOP_Offset *blocks_p,
* blocks_p.
*/
static int MPID_Segment_vector_flatten(DLOOP_Offset *blocks_p,
- int count,
- int blksz,
+ DLOOP_Count count,
+ DLOOP_Size blksz,
DLOOP_Offset stride,
DLOOP_Type el_type,
DLOOP_Offset rel_off, /* offset into buffer */
diff --git a/src/mpid/common/datatype/mpid_type_blockindexed.c b/src/mpid/common/datatype/mpid_type_blockindexed.c
index 47d4287..f90f81f 100644
--- a/src/mpid/common/datatype/mpid_type_blockindexed.c
+++ b/src/mpid/common/datatype/mpid_type_blockindexed.c
@@ -38,7 +38,8 @@ int MPID_Type_blockindexed(int count,
MPI_Datatype *newtype)
{
int mpi_errno = MPI_SUCCESS, i;
- int is_builtin, contig_count, old_is_contig;
+ int is_builtin, old_is_contig;
+ MPI_Aint contig_count;
MPI_Aint el_sz;
MPI_Datatype el_type;
MPI_Aint old_lb, old_ub, old_extent, old_true_lb, old_true_ub;
diff --git a/src/mpid/common/datatype/mpid_type_contiguous.c b/src/mpid/common/datatype/mpid_type_contiguous.c
index 9efb34a..565eb72 100644
--- a/src/mpid/common/datatype/mpid_type_contiguous.c
+++ b/src/mpid/common/datatype/mpid_type_contiguous.c
@@ -30,7 +30,7 @@ int MPID_Type_contiguous(int count,
{
int mpi_errno = MPI_SUCCESS;
int is_builtin;
- int el_sz;
+ MPI_Aint el_sz;
MPI_Datatype el_type;
MPID_Datatype *new_dtp;
diff --git a/src/mpid/common/datatype/mpid_type_debug.c b/src/mpid/common/datatype/mpid_type_debug.c
index 8e895cf..fcece4b 100644
--- a/src/mpid/common/datatype/mpid_type_debug.c
+++ b/src/mpid/common/datatype/mpid_type_debug.c
@@ -234,7 +234,7 @@ void MPIDI_Datatype_printf(MPI_Datatype type,
int header)
{
char *string;
- int size;
+ MPI_Aint size;
MPI_Aint extent, true_lb, true_ub, lb, ub, sticky_lb, sticky_ub;
if (HANDLE_GET_KIND(type) == HANDLE_KIND_BUILTIN) {
@@ -457,8 +457,8 @@ void MPIDU_Datatype_debug(MPI_Datatype type,
MPIU_Assert(dtp != NULL);
MPIU_DBG_OUT_FMT(DATATYPE,(MPIU_DBG_FDEST,
- "# Size = %d, Extent = " MPI_AINT_FMT_DEC_SPEC ", LB = " MPI_AINT_FMT_DEC_SPEC "%s, UB = " MPI_AINT_FMT_DEC_SPEC "%s, Extent = " MPI_AINT_FMT_DEC_SPEC ", Element Size = " MPI_AINT_FMT_DEC_SPEC " (%s), %s",
- (int) dtp->size,
+ "# Size = " MPI_AINT_FMT_DEC_SPEC ", Extent = " MPI_AINT_FMT_DEC_SPEC ", LB = " MPI_AINT_FMT_DEC_SPEC "%s, UB = " MPI_AINT_FMT_DEC_SPEC "%s, Extent = " MPI_AINT_FMT_DEC_SPEC ", Element Size = " MPI_AINT_FMT_DEC_SPEC " (%s), %s",
+ (MPI_Aint) dtp->size,
(MPI_Aint) dtp->extent,
(MPI_Aint) dtp->lb,
(dtp->has_sticky_lb) ? "(sticky)" : "",
diff --git a/src/mpid/common/datatype/mpid_type_indexed.c b/src/mpid/common/datatype/mpid_type_indexed.c
index 0e3e259..f64acea 100644
--- a/src/mpid/common/datatype/mpid_type_indexed.c
+++ b/src/mpid/common/datatype/mpid_type_indexed.c
@@ -40,9 +40,9 @@ int MPID_Type_indexed(int count,
{
int mpi_errno = MPI_SUCCESS;
int is_builtin, old_is_contig;
- int i, contig_count;
- int el_ct, old_ct;
- MPI_Aint el_sz, old_sz;
+ int i;
+ MPI_Aint contig_count;
+ MPI_Aint el_sz, el_ct, old_ct, old_sz;
MPI_Aint old_lb, old_ub, old_extent, old_true_lb, old_true_ub;
MPI_Aint min_lb = 0, max_ub = 0, eff_disp;
MPI_Datatype el_type;
@@ -110,7 +110,7 @@ int MPID_Type_indexed(int count,
new_dtp->has_sticky_ub = 0;
new_dtp->has_sticky_lb = 0;
- MPIU_Assign_trunc(new_dtp->alignsize, el_sz, int);
+ MPIU_Assign_trunc(new_dtp->alignsize, el_sz, MPI_Aint);
new_dtp->element_size = el_sz;
new_dtp->eltype = el_type;
@@ -216,8 +216,11 @@ int MPID_Type_indexed(int count,
new_dtp->is_contig = 0;
if(old_is_contig)
{
+ MPI_Aint *blklens = MPIU_Malloc(count *sizeof(MPI_Aint));
+ for (i=0; i<count; i++)
+ blklens[i] = blocklength_array[i];
contig_count = MPID_Type_indexed_count_contig(count,
- blocklength_array,
+ blklens,
displacement_array,
dispinbytes,
old_extent);
@@ -227,6 +230,7 @@ int MPID_Type_indexed(int count,
{
new_dtp->is_contig = 1;
}
+ MPIU_Free(blklens);
}
*newtype = new_dtp->handle;
diff --git a/src/mpid/common/datatype/mpid_type_struct.c b/src/mpid/common/datatype/mpid_type_struct.c
index 8ba96c6..148958e 100644
--- a/src/mpid/common/datatype/mpid_type_struct.c
+++ b/src/mpid/common/datatype/mpid_type_struct.c
@@ -13,7 +13,7 @@
#undef MPID_STRUCT_FLATTEN_DEBUG
#undef MPID_STRUCT_DEBUG
-static int MPID_Type_struct_alignsize(int count,
+static MPI_Aint MPID_Type_struct_alignsize(int count,
const MPI_Datatype *oldtype_array,
const MPI_Aint *displacement_array);
@@ -39,11 +39,12 @@ static int MPID_Type_struct_alignsize(int count,
* have different natural alignments). Linux on X86, however, does not have
* different rules for this case.
*/
-static int MPID_Type_struct_alignsize(int count,
+static MPI_Aint MPID_Type_struct_alignsize(int count,
const MPI_Datatype *oldtype_array,
const MPI_Aint *displacement_array)
{
- int i, max_alignsize = 0, tmp_alignsize, derived_alignsize = 0;
+ int i;
+ MPI_Aint max_alignsize = 0, tmp_alignsize, derived_alignsize = 0;
for (i=0; i < count; i++)
{
@@ -152,7 +153,7 @@ int MPID_Type_struct(int count,
int found_sticky_lb = 0, found_sticky_ub = 0, found_true_lb = 0,
found_true_ub = 0, found_el_type = 0;
MPI_Aint el_sz = 0;
- int size = 0;
+ MPI_Aint size = 0;
MPI_Datatype el_type = MPI_DATATYPE_NULL;
MPI_Aint true_lb_disp = 0, true_ub_disp = 0, sticky_lb_disp = 0,
sticky_ub_disp = 0;
diff --git a/src/mpid/common/datatype/mpir_type_flatten.c b/src/mpid/common/datatype/mpir_type_flatten.c
index 66ae8fc..8e9b332 100644
--- a/src/mpid/common/datatype/mpir_type_flatten.c
+++ b/src/mpid/common/datatype/mpir_type_flatten.c
@@ -25,7 +25,7 @@ Output Parameters:
int MPIR_Type_flatten(MPI_Datatype type,
MPI_Aint *off_array,
- int *size_array,
+ MPI_Aint *size_array,
MPI_Aint *array_len_p)
{
int err;
diff --git a/src/mpid/common/datatype/mpir_type_get_contig_blocks.c b/src/mpid/common/datatype/mpir_type_get_contig_blocks.c
index d718ff1..6b3d9d6 100644
--- a/src/mpid/common/datatype/mpir_type_get_contig_blocks.c
+++ b/src/mpid/common/datatype/mpir_type_get_contig_blocks.c
@@ -23,8 +23,8 @@ Output Parameters:
0 on success, -1 on failure.
@*/
-int MPIR_Type_get_contig_blocks(MPI_Datatype type,
- int *nr_blocks_p)
+MPI_Count MPIR_Type_get_contig_blocks(MPI_Datatype type,
+ MPI_Count *nr_blocks_p)
{
MPID_Datatype *datatype_ptr;
http://git.mpich.org/mpich.git/commitdiff/e527fa1dea458e32f97083d49e8689666…
commit e527fa1dea458e32f97083d49e8689666e5bb363
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Fri Jun 28 08:40:29 2013 -0500
ROMIO: improve handling of large datatypes
MPI-3 introduced MPI_Count and MPI_Type_size_x. Use these new routines
throughout ROMIO to support large datatypes.
Still to do:
- update other ADIO drivers
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpi/romio/adio/common/ad_coll_exch_new.c b/src/mpi/romio/adio/common/ad_coll_exch_new.c
index 10a441c..62c9282 100644
--- a/src/mpi/romio/adio/common/ad_coll_exch_new.c
+++ b/src/mpi/romio/adio/common/ad_coll_exch_new.c
@@ -43,7 +43,7 @@ void ADIOI_Print_flatlist_node(ADIOI_Flatlist_node *flatlist_node_p)
return;
}
fprintf(stderr, "print flatlist node count = %d (idx,blocklen)\n",
- flatlist_node_p->count);
+ (int)flatlist_node_p->count);
for (i = 0; i < flatlist_node_p->count; i++)
{
if (i % 5 == 0 && i != 0)
diff --git a/src/mpi/romio/adio/common/ad_read.c b/src/mpi/romio/adio/common/ad_read.c
index 1961b16..13bdb52 100644
--- a/src/mpi/romio/adio/common/ad_read.c
+++ b/src/mpi/romio/adio/common/ad_read.c
@@ -21,7 +21,7 @@ void ADIOI_GEN_ReadContig(ADIO_File fd, void *buf, int count,
{
off_t err_lseek = -1;
ssize_t err = -1;
- int datatype_size;
+ MPI_Count datatype_size;
ADIO_Offset len, bytes_xfered=0;
size_t rd_count;
static char myname[] = "ADIOI_GEN_READCONTIG";
@@ -30,8 +30,8 @@ void ADIOI_GEN_ReadContig(ADIO_File fd, void *buf, int count,
#ifdef AGGREGATION_PROFILE
MPE_Log_event (5034, 0, NULL);
#endif
- MPI_Type_size(datatype, &datatype_size);
- len = (ADIO_Offset)datatype_size * (ADIO_Offset)count;
+ MPI_Type_size_x(datatype, &datatype_size);
+ len = datatype_size * (ADIO_Offset)count;
if (file_ptr_type == ADIO_INDIVIDUAL) {
offset = fd->fp_ind;
diff --git a/src/mpi/romio/adio/common/ad_read_coll.c b/src/mpi/romio/adio/common/ad_read_coll.c
index ec849ac..7d8c928 100644
--- a/src/mpi/romio/adio/common/ad_read_coll.c
+++ b/src/mpi/romio/adio/common/ad_read_coll.c
@@ -281,8 +281,8 @@ void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype
ADIO_Offset *end_offset_ptr, int
*contig_access_count_ptr)
{
- int filetype_size, etype_size;
- unsigned buftype_size;
+ MPI_Count filetype_size, etype_size;
+ MPI_Count buftype_size;
int i, j, k;
ADIO_Offset i_offset;
ADIO_Offset frd_size=0, old_frd_size=0;
@@ -306,10 +306,10 @@ void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype
ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
- MPI_Type_size(fd->filetype, &filetype_size);
+ MPI_Type_size_x(fd->filetype, &filetype_size);
MPI_Type_extent(fd->filetype, &filetype_extent);
MPI_Type_lb(fd->filetype, &filetype_lb);
- MPI_Type_size(datatype, (int*)&buftype_size);
+ MPI_Type_size_x(datatype, &buftype_size);
etype_size = fd->etype_size;
if ( ! filetype_size ) {
@@ -359,7 +359,7 @@ void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype
#ifdef RDCOLL_DEBUG
{
int ii;
- DBG_FPRINTF(stderr, "flattened %3d : ", flat_file->count );
+ DBG_FPRINTF(stderr, "flattened %3lld : ", flat_file->count );
for (ii=0; ii<flat_file->count; ii++) {
DBG_FPRINTF(stderr, "%16qd:%-16qd", flat_file->indices[ii], flat_file->blocklens[ii] );
}
diff --git a/src/mpi/romio/adio/common/ad_read_str.c b/src/mpi/romio/adio/common/ad_read_str.c
index 1491e96..99e32fd 100644
--- a/src/mpi/romio/adio/common/ad_read_str.c
+++ b/src/mpi/romio/adio/common/ad_read_str.c
@@ -55,7 +55,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count,
int n_etypes_in_filetype;
ADIO_Offset n_filetypes, etype_in_filetype, st_n_filetypes, size_in_filetype;
ADIO_Offset abs_off_in_filetype=0, new_frd_size, frd_size=0, st_frd_size;
- int filetype_size, etype_size, buftype_size, partial_read;
+ MPI_Count filetype_size, etype_size, buftype_size, partial_read;
MPI_Aint filetype_extent, buftype_extent;
int buf_count, buftype_is_contig, filetype_is_contig;
ADIO_Offset userbuf_off, req_len, sum;
@@ -85,7 +85,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count,
ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
- MPI_Type_size(fd->filetype, &filetype_size);
+ MPI_Type_size_x(fd->filetype, &filetype_size);
if ( ! filetype_size ) {
#ifdef HAVE_STATUS_SET_BYTES
MPIR_Status_set_bytes(status, datatype, 0);
@@ -95,7 +95,7 @@ void ADIOI_GEN_ReadStrided(ADIO_File fd, void *buf, int count,
}
MPI_Type_extent(fd->filetype, &filetype_extent);
- MPI_Type_size(datatype, &buftype_size);
+ MPI_Type_size_x(datatype, &buftype_size);
MPI_Type_extent(datatype, &buftype_extent);
etype_size = fd->etype_size;
diff --git a/src/mpi/romio/adio/common/ad_set_view.c b/src/mpi/romio/adio/common/ad_set_view.c
index 71ed7b7..31aa6c6 100644
--- a/src/mpi/romio/adio/common/ad_set_view.c
+++ b/src/mpi/romio/adio/common/ad_set_view.c
@@ -54,7 +54,7 @@ void ADIO_Set_view(ADIO_File fd, ADIO_Offset disp, MPI_Datatype etype,
to be all contiguous. */
}
- MPI_Type_size(fd->etype, &(fd->etype_size));
+ MPI_Type_size_x(fd->etype, &(fd->etype_size));
fd->disp = disp;
/* reset MPI-IO file pointer to point to the first byte that can
diff --git a/src/mpi/romio/adio/common/ad_write.c b/src/mpi/romio/adio/common/ad_write.c
index 6f01aff..05b470a 100644
--- a/src/mpi/romio/adio/common/ad_write.c
+++ b/src/mpi/romio/adio/common/ad_write.c
@@ -21,7 +21,7 @@ void ADIOI_GEN_WriteContig(ADIO_File fd, const void *buf, int count,
{
off_t err_lseek = -1;
ssize_t err = -1;
- int datatype_size;
+ MPI_Count datatype_size;
ADIO_Offset len, bytes_xfered=0;
size_t wr_count;
static char myname[] = "ADIOI_GEN_WRITECONTIG";
@@ -31,7 +31,7 @@ void ADIOI_GEN_WriteContig(ADIO_File fd, const void *buf, int count,
MPE_Log_event (5036, 0, NULL);
#endif
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
len = (ADIO_Offset)datatype_size * (ADIO_Offset)count;
if (file_ptr_type == ADIO_INDIVIDUAL) {
diff --git a/src/mpi/romio/adio/common/ad_write_nolock.c b/src/mpi/romio/adio/common/ad_write_nolock.c
index c84be8e..47a6079 100644
--- a/src/mpi/romio/adio/common/ad_write_nolock.c
+++ b/src/mpi/romio/adio/common/ad_write_nolock.c
@@ -35,7 +35,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count,
int n_etypes_in_filetype;
ADIO_Offset n_filetypes, etype_in_filetype, size, sum;
ADIO_Offset abs_off_in_filetype=0, size_in_filetype;
- int filetype_size, etype_size, buftype_size;
+ MPI_Count filetype_size, etype_size, buftype_size;
MPI_Aint filetype_extent, buftype_extent, indx;
int buf_count, buftype_is_contig, filetype_is_contig;
ADIO_Offset off, disp;
@@ -58,7 +58,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count,
ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
- MPI_Type_size(fd->filetype, &filetype_size);
+ MPI_Type_size_x(fd->filetype, &filetype_size);
if ( ! filetype_size ) {
#ifdef HAVE_STATUS_SET_BYTES
MPIR_Status_set_bytes(status, datatype, 0);
@@ -73,7 +73,7 @@ void ADIOI_NOLOCK_WriteStrided(ADIO_File fd, const void *buf, int count,
#endif
MPI_Type_extent(fd->filetype, &filetype_extent);
- MPI_Type_size(datatype, &buftype_size);
+ MPI_Type_size_x(datatype, &buftype_size);
MPI_Type_extent(datatype, &buftype_extent);
etype_size = fd->etype_size;
diff --git a/src/mpi/romio/adio/common/ad_write_str.c b/src/mpi/romio/adio/common/ad_write_str.c
index 5acc300..c095b34 100644
--- a/src/mpi/romio/adio/common/ad_write_str.c
+++ b/src/mpi/romio/adio/common/ad_write_str.c
@@ -122,13 +122,14 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count,
int n_etypes_in_filetype;
ADIO_Offset num, size, n_filetypes, etype_in_filetype, st_n_filetypes;
ADIO_Offset abs_off_in_filetype=0;
- int filetype_size, etype_size, buftype_size;
+ MPI_Count filetype_size, etype_size, buftype_size;
MPI_Aint filetype_extent, buftype_extent;
int buf_count, buftype_is_contig, filetype_is_contig;
ADIO_Offset userbuf_off;
ADIO_Offset off, req_off, disp, end_offset=0, writebuf_off, start_off;
char *writebuf;
- unsigned bufsize, writebuf_len, max_bufsize, write_sz;
+ unsigned writebuf_len, max_bufsize, write_sz;
+ MPI_Aint bufsize;
ADIO_Status status1;
ADIO_Offset new_bwr_size, new_fwr_size, st_fwr_size, fwr_size=0, bwr_size, req_len;
static char myname[] = "ADIOI_GEN_WriteStrided";
@@ -155,7 +156,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count,
ADIOI_Datatype_iscontig(datatype, &buftype_is_contig);
ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
- MPI_Type_size(fd->filetype, &filetype_size);
+ MPI_Type_size_x(fd->filetype, &filetype_size);
if ( ! filetype_size ) {
#ifdef HAVE_STATUS_SET_BYTES
MPIR_Status_set_bytes(status, datatype, 0);
@@ -165,11 +166,11 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count,
}
MPI_Type_extent(fd->filetype, &filetype_extent);
- MPI_Type_size(datatype, &buftype_size);
+ MPI_Type_size_x(datatype, &buftype_size);
MPI_Type_extent(datatype, &buftype_extent);
etype_size = fd->etype_size;
- ADIOI_Assert((buftype_size * count) == ((ADIO_Offset)(unsigned)buftype_size * (ADIO_Offset)count));
+ ADIOI_Assert((buftype_size * count) == ((ADIO_Offset)buftype_size * (ADIO_Offset)count));
bufsize = buftype_size * count;
/* get max_bufsize from the info object. */
@@ -285,6 +286,10 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count,
/* this could happen, for example, with subarray types that are
* actually fairly contiguous */
if (buftype_is_contig && bufsize <= fwr_size) {
+ /* though MPI api has an integer 'count' parameter, derived
+ * datatypes might describe more bytes than can fit into an integer.
+ * Other WriteContig calls in this path are operating on data
+ * sieving buffer */
ADIO_WriteContig(fd, buf, bufsize, MPI_BYTE, ADIO_EXPLICIT_OFFSET,
offset, status, error_code);
@@ -475,6 +480,7 @@ void ADIOI_GEN_WriteStrided(ADIO_File fd, const void *buf, int count,
fd->fp_sys_posn = -1; /* set it to null. */
#ifdef HAVE_STATUS_SET_BYTES
+ /* datatypes returning negagive values, probably related to tt 1893 */
MPIR_Status_set_bytes(status, datatype, bufsize);
/* This is a temporary way of filling in status. The right way is to
keep track of how much data was actually written by ADIOI_BUFFERED_WRITE. */
diff --git a/src/mpi/romio/adio/common/ad_write_str_naive.c b/src/mpi/romio/adio/common/ad_write_str_naive.c
index 4fb4b35..c37e3a1 100644
--- a/src/mpi/romio/adio/common/ad_write_str_naive.c
+++ b/src/mpi/romio/adio/common/ad_write_str_naive.c
@@ -23,7 +23,7 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count,
int n_etypes_in_filetype;
ADIO_Offset size, n_filetypes, etype_in_filetype;
ADIO_Offset abs_off_in_filetype=0, req_len;
- int filetype_size, etype_size, buftype_size;
+ MPI_Count filetype_size, etype_size, buftype_size;
MPI_Aint filetype_extent, buftype_extent;
int buf_count, buftype_is_contig, filetype_is_contig;
ADIO_Offset userbuf_off;
@@ -35,7 +35,7 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count,
ADIOI_Datatype_iscontig(buftype, &buftype_is_contig);
ADIOI_Datatype_iscontig(fd->filetype, &filetype_is_contig);
- MPI_Type_size(fd->filetype, &filetype_size);
+ MPI_Type_size_x(fd->filetype, &filetype_size);
if ( ! filetype_size ) {
#ifdef HAVE_STATUS_SET_BYTES
MPIR_Status_set_bytes(status, buftype, 0);
@@ -45,7 +45,7 @@ void ADIOI_GEN_WriteStrided_naive(ADIO_File fd, const void *buf, int count,
}
MPI_Type_extent(fd->filetype, &filetype_extent);
- MPI_Type_size(buftype, &buftype_size);
+ MPI_Type_size_x(buftype, &buftype_size);
MPI_Type_extent(buftype, &buftype_extent);
etype_size = fd->etype_size;
diff --git a/src/mpi/romio/adio/common/byte_offset.c b/src/mpi/romio/adio/common/byte_offset.c
index df16e2e..df0a240 100644
--- a/src/mpi/romio/adio/common/byte_offset.c
+++ b/src/mpi/romio/adio/common/byte_offset.c
@@ -16,7 +16,7 @@ void ADIOI_Get_byte_offset(ADIO_File fd, ADIO_Offset offset, ADIO_Offset *disp)
ADIOI_Flatlist_node *flat_file;
int i;
ADIO_Offset n_filetypes, etype_in_filetype, sum, abs_off_in_filetype=0, size_in_filetype;
- unsigned n_etypes_in_filetype, filetype_size, etype_size;
+ MPI_Count n_etypes_in_filetype, filetype_size, etype_size;
int filetype_is_contig;
MPI_Aint filetype_extent;
@@ -29,7 +29,7 @@ void ADIOI_Get_byte_offset(ADIO_File fd, ADIO_Offset offset, ADIO_Offset *disp)
flat_file = ADIOI_Flatlist;
while (flat_file->type != fd->filetype) flat_file = flat_file->next;
- MPI_Type_size(fd->filetype, (int*)&filetype_size);
+ MPI_Type_size_x(fd->filetype, &filetype_size);
n_etypes_in_filetype = filetype_size/etype_size;
n_filetypes = offset / n_etypes_in_filetype;
etype_in_filetype = offset % n_etypes_in_filetype;
diff --git a/src/mpi/romio/adio/common/flatten.c b/src/mpi/romio/adio/common/flatten.c
index 6ed7f06..80fdd4c 100644
--- a/src/mpi/romio/adio/common/flatten.c
+++ b/src/mpi/romio/adio/common/flatten.c
@@ -21,7 +21,8 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype)
#ifdef HAVE_MPIR_TYPE_FLATTEN
MPI_Aint flatten_idx;
#endif
- int curr_index=0, is_contig;
+ MPI_Count curr_index=0;
+ int is_contig;
ADIOI_Flatlist_node *flat, *prev=0;
/* check if necessary to flatten. */
@@ -60,7 +61,7 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype)
flat->count = ADIOI_Count_contiguous_blocks(datatype, &curr_index);
#ifdef FLATTEN_DEBUG
- DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: count %#X, cur_idx = %#X\n",flat->count,curr_index);
+ DBG_FPRINTF(stderr,"ADIOI_Flatten_datatype:: count %#z, cur_idx = %#X\n",flat->count,curr_index);
#endif
/* DBG_FPRINTF(stderr, "%d\n", flat->count);*/
@@ -104,7 +105,7 @@ void ADIOI_Flatten_datatype(MPI_Datatype datatype)
* Assumption: input datatype is not a basic!!!!
*/
void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
- ADIO_Offset st_offset, int *curr_index)
+ ADIO_Offset st_offset, MPI_Count *curr_index)
{
int i, j, k, m, n, num, basic_num, prev_index;
int combiner, old_combiner, old_is_contig;
@@ -112,8 +113,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
/* By using ADIO_Offset we preserve +/- sign and
avoid >2G integer arithmetic problems */
ADIO_Offset top_count;
- /* By using unsigned we avoid >2G integer arithmetic problems */
- unsigned old_size;
+ MPI_Count old_size;
MPI_Aint old_extent;/* Assume extents are non-negative */
int *ints;
MPI_Aint *adds; /* Make no assumptions about +/- sign on these */
@@ -223,7 +223,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
/* simplest case, made up of basic or contiguous types */
j = *curr_index;
flat->indices[j] = st_offset;
- MPI_Type_size(types[0], (int*)&old_size);
+ MPI_Type_size_x(types[0], &old_size);
flat->blocklens[j] = top_count * old_size;
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",j, flat->indices[j], j, flat->blocklens[j]);
@@ -271,7 +271,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
ADIO_Offset blocklength = ints[1], stride = ints[2];
j = *curr_index;
flat->indices[j] = st_offset;
- MPI_Type_size(types[0], (int*)&old_size);
+ MPI_Type_size_x(types[0], &old_size);
flat->blocklens[j] = blocklength * old_size;
for (i=j+1; i<j+top_count; i++) {
flat->indices[i] = flat->indices[i-1] + stride * old_size;
@@ -334,7 +334,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
ADIO_Offset blocklength = ints[1];
j = *curr_index;
flat->indices[j] = st_offset;
- MPI_Type_size(types[0], (int*)&old_size);
+ MPI_Type_size_x(types[0], &old_size);
flat->blocklens[j] = blocklength * old_size;
for (i=j+1; i<j+top_count; i++) {
flat->indices[i] = flat->indices[i-1] + adds[0];
@@ -539,7 +539,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
if (prev_index == *curr_index) {
/* simplest case, indexed type made up of basic or contiguous types */
j = *curr_index;
- MPI_Type_size(types[0], (int*)&old_size);
+ MPI_Type_size_x(types[0], &old_size);
for (i=j; i<j+top_count; i++) {
/* By using ADIO_Offset we preserve +/- sign and
avoid >2G integer arithmetic problems */
@@ -612,7 +612,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
ADIO_Offset blocklength = ints[1+n];
j = *curr_index;
flat->indices[j] = st_offset + adds[n];
- MPI_Type_size(types[n], (int*)&old_size);
+ MPI_Type_size_x(types[n], &old_size);
flat->blocklens[j] = blocklength * old_size;
#ifdef FLATTEN_DEBUG
DBG_FPRINTF(stderr,"ADIOI_Flatten:: simple adds[%#X] "MPI_AINT_FMT_HEX_SPEC", flat->indices[%#X] %#llX, flat->blocklens[%#X] %#llX\n",n,adds[n],j, flat->indices[j], j, flat->blocklens[j]);
@@ -673,7 +673,7 @@ void ADIOI_Flatten(MPI_Datatype datatype, ADIOI_Flatlist_node *flat,
/* current type is basic or contiguous */
j = *curr_index;
flat->indices[j] = st_offset;
- MPI_Type_size(types[0], (int*)&old_size);
+ MPI_Type_size_x(types[0], &old_size);
flat->blocklens[j] = old_size;
#ifdef FLATTEN_DEBUG
@@ -740,7 +740,8 @@ int ADIOI_Count_contiguous_blocks(MPI_Datatype datatype, int *curr_index)
*curr_index = blks;
return blks;
#else
- int count=0, i, n, num, basic_num, prev_index;
+ int i, n, num, basic_num, prev_index;
+ MPI_Count count=0;
int top_count, combiner, old_combiner, old_is_contig;
int nints, nadds, ntypes, old_nints, old_nadds, old_ntypes;
int *ints;
diff --git a/src/mpi/romio/adio/common/get_fp_posn.c b/src/mpi/romio/adio/common/get_fp_posn.c
index 0421a8d..8f5b907 100644
--- a/src/mpi/romio/adio/common/get_fp_posn.c
+++ b/src/mpi/romio/adio/common/get_fp_posn.c
@@ -16,7 +16,7 @@ void ADIOI_Get_position(ADIO_File fd, ADIO_Offset *offset)
{
ADIOI_Flatlist_node *flat_file;
int i, flag;
- unsigned filetype_size;
+ MPI_Count filetype_size;
int etype_size, filetype_is_contig;
MPI_Aint filetype_extent;
ADIO_Offset disp, byte_offset, sum=0, size_in_file, n_filetypes, frd_size;
@@ -30,7 +30,7 @@ void ADIOI_Get_position(ADIO_File fd, ADIO_Offset *offset)
flat_file = ADIOI_Flatlist;
while (flat_file->type != fd->filetype) flat_file = flat_file->next;
- MPI_Type_size(fd->filetype, (int*)&filetype_size);
+ MPI_Type_size_x(fd->filetype, &filetype_size);
MPI_Type_extent(fd->filetype, &filetype_extent);
disp = fd->disp;
diff --git a/src/mpi/romio/adio/common/status_setb.c b/src/mpi/romio/adio/common/status_setb.c
index 7e46fbd..ec1e4ff 100644
--- a/src/mpi/romio/adio/common/status_setb.c
+++ b/src/mpi/romio/adio/common/status_setb.c
@@ -14,18 +14,18 @@
* implementation fills status with something other than bytes (globus2 might
* do this) */
int MPIR_Status_set_bytes(MPI_Status *status, MPI_Datatype datatype,
- int nbytes)
+ MPI_Count nbytes)
{
ADIOI_UNREFERENCED_ARG(datatype);
/* it's ok that ROMIO stores number-of-bytes in status, not
* count-of-copies, as long as MPI_GET_COUNT knows what to do */
if (status != MPI_STATUS_IGNORE)
- MPI_Status_set_elements(status, MPI_BYTE, nbytes);
+ MPI_Status_set_elements_x(status, MPI_BYTE, nbytes);
return MPI_SUCCESS;
}
#elif defined(MPILAM) || defined(MPISGI)
int MPIR_Status_set_bytes(MPI_Status *status, MPI_Datatype datatype,
- int nbytes)
+ MPI_Count nbytes)
{
/* Bogusness to silence compiler warnings */
if (datatype == MPI_DATATYPE_NULL);
diff --git a/src/mpi/romio/adio/include/adio.h b/src/mpi/romio/adio/include/adio.h
index 067641f..d168ac5 100644
--- a/src/mpi/romio/adio/include/adio.h
+++ b/src/mpi/romio/adio/include/adio.h
@@ -209,7 +209,7 @@ typedef struct ADIOI_FileD {
ADIO_Offset disp; /* reqd. for MPI-IO */
MPI_Datatype etype; /* reqd. for MPI-IO */
MPI_Datatype filetype; /* reqd. for MPI-IO */
- int etype_size; /* in bytes */
+ MPI_Count etype_size; /* in bytes */
ADIOI_Hints *hints; /* structure containing fs-indep. info values */
MPI_Info info;
diff --git a/src/mpi/romio/adio/include/adioi.h b/src/mpi/romio/adio/include/adioi.h
index 063b39c..d138697 100644
--- a/src/mpi/romio/adio/include/adioi.h
+++ b/src/mpi/romio/adio/include/adioi.h
@@ -104,7 +104,7 @@ enum {
typedef struct ADIOI_Fl_node {
MPI_Datatype type;
- int count; /* no. of contiguous blocks */
+ MPI_Count count; /* no. of contiguous blocks */
ADIO_Offset *blocklens; /* array of contiguous block lengths (bytes)*/
ADIO_Offset *indices; /* array of byte offsets of each block */
struct ADIOI_Fl_node *next; /* pointer to next node */
@@ -318,7 +318,7 @@ typedef struct {
void ADIOI_SetFunctions(ADIO_File fd);
void ADIOI_Flatten_datatype(MPI_Datatype type);
void ADIOI_Flatten(MPI_Datatype type, ADIOI_Flatlist_node *flat,
- ADIO_Offset st_offset, int *curr_index);
+ ADIO_Offset st_offset, MPI_Count *curr_index);
void ADIOI_Delete_flattened(MPI_Datatype datatype);
int ADIOI_Count_contiguous_blocks(MPI_Datatype type, int *curr_index);
void ADIOI_Complete_async(int *error_code);
@@ -558,7 +558,10 @@ void ADIOI_GEN_Prealloc(ADIO_File fd, ADIO_Offset size, int *error_code);
int ADIOI_Error(ADIO_File fd, int error_code, char *string);
int MPIR_Err_setmsg( int, int, const char *, const char *, const char *, ... );
int ADIOI_End_call(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state);
-int MPIR_Status_set_bytes(MPI_Status *status, MPI_Datatype datatype, int nbytes);
+int MPIR_Status_set_bytes(MPI_Status *status, MPI_Datatype datatype, MPI_Count nbytes);
+#ifdef HAVE_MPIR_TYPE_GET_CONTIG_BLOCKS
+MPI_Count MPIR_Type_get_contig_blocks(MPI_Datatype datatype, MPI_Count *nr_blocks_p);
+#endif
int ADIOI_Uses_generic_read(ADIO_File fd);
int ADIOI_Uses_generic_write(ADIO_File fd);
int ADIOI_Err_create_code(const char *myname, const char *filename, int my_errno);
diff --git a/src/mpi/romio/mpi-io/iread.c b/src/mpi/romio/mpi-io/iread.c
index fb07e70..7f4d154 100644
--- a/src/mpi/romio/mpi-io/iread.c
+++ b/src/mpi/romio/mpi-io/iread.c
@@ -74,7 +74,7 @@ int MPIOI_File_iread(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *bu
MPI_Datatype datatype, char *myname, MPI_Request *request)
{
int error_code, bufsize, buftype_is_contig, filetype_is_contig;
- int datatype_size;
+ MPI_Count datatype_size;
ADIO_Status status;
ADIO_File adio_fh;
ADIO_Offset off;
@@ -98,7 +98,7 @@ int MPIOI_File_iread(MPI_File fh, MPI_Offset offset, int file_ptr_type, void *bu
}
/* --END ERROR HANDLING-- */
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/iread_sh.c b/src/mpi/romio/mpi-io/iread_sh.c
index 548e6c5..a218daa 100644
--- a/src/mpi/romio/mpi-io/iread_sh.c
+++ b/src/mpi/romio/mpi-io/iread_sh.c
@@ -46,7 +46,7 @@ int MPI_File_iread_shared(MPI_File fh, void *buf, int count,
int error_code, bufsize, buftype_is_contig, filetype_is_contig;
ADIO_File adio_fh;
static char myname[] = "MPI_FILE_IREAD_SHARED";
- int datatype_size, incr;
+ MPI_Count datatype_size, incr;
MPI_Status status;
ADIO_Offset off, shared_fp;
MPI_Offset nbytes=0;
@@ -61,7 +61,7 @@ int MPI_File_iread_shared(MPI_File fh, void *buf, int count,
MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code);
/* --END ERROR HANDLING-- */
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/iwrite.c b/src/mpi/romio/mpi-io/iwrite.c
index 54872e4..5bfdd78 100644
--- a/src/mpi/romio/mpi-io/iwrite.c
+++ b/src/mpi/romio/mpi-io/iwrite.c
@@ -81,7 +81,7 @@ int MPIOI_File_iwrite(MPI_File fh,
MPI_Request *request)
{
int error_code, bufsize, buftype_is_contig, filetype_is_contig;
- int datatype_size;
+ MPI_Count datatype_size;
ADIO_Status status;
ADIO_Offset off;
ADIO_File adio_fh;
@@ -104,7 +104,7 @@ int MPIOI_File_iwrite(MPI_File fh,
}
/* --END ERROR HANDLING-- */
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/iwrite_sh.c b/src/mpi/romio/mpi-io/iwrite_sh.c
index e0e2b0b..49c0d30 100644
--- a/src/mpi/romio/mpi-io/iwrite_sh.c
+++ b/src/mpi/romio/mpi-io/iwrite_sh.c
@@ -46,7 +46,8 @@ int MPI_File_iwrite_shared(MPI_File fh, const void *buf, int count,
{
int error_code, bufsize, buftype_is_contig, filetype_is_contig;
ADIO_File adio_fh;
- int datatype_size, incr;
+ int incr;
+ MPI_Count datatype_size;
ADIO_Status status;
ADIO_Offset off, shared_fp;
static char myname[] = "MPI_FILE_IWRITE_SHARED";
@@ -61,7 +62,7 @@ int MPI_File_iwrite_shared(MPI_File fh, const void *buf, int count,
MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code);
/* --END ERROR HANDLING-- */
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/read.c b/src/mpi/romio/mpi-io/read.c
index 029db3b..e5b7238 100644
--- a/src/mpi/romio/mpi-io/read.c
+++ b/src/mpi/romio/mpi-io/read.c
@@ -71,7 +71,7 @@ int MPIOI_File_read(MPI_File fh,
MPI_Status *status)
{
int error_code, bufsize, buftype_is_contig, filetype_is_contig;
- int datatype_size;
+ MPI_Count datatype_size;
ADIO_File adio_fh;
ADIO_Offset off;
void *xbuf=NULL, *e32_buf=NULL;
@@ -95,7 +95,7 @@ int MPIOI_File_read(MPI_File fh,
}
/* --END ERROR HANDLING-- */
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/read_all.c b/src/mpi/romio/mpi-io/read_all.c
index b387fe9..641d58d 100644
--- a/src/mpi/romio/mpi-io/read_all.c
+++ b/src/mpi/romio/mpi-io/read_all.c
@@ -72,7 +72,8 @@ int MPIOI_File_read_all(MPI_File fh,
char *myname,
MPI_Status *status)
{
- int error_code, datatype_size;
+ int error_code;
+ MPI_Count datatype_size;
ADIO_File adio_fh;
void *xbuf=NULL, *e32_buf=NULL;
@@ -95,7 +96,7 @@ int MPIOI_File_read_all(MPI_File fh,
}
/* --END ERROR HANDLING-- */
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/read_allb.c b/src/mpi/romio/mpi-io/read_allb.c
index ecc9088..743424d 100644
--- a/src/mpi/romio/mpi-io/read_allb.c
+++ b/src/mpi/romio/mpi-io/read_allb.c
@@ -59,7 +59,8 @@ int MPIOI_File_read_all_begin(MPI_File fh,
MPI_Datatype datatype,
char *myname)
{
- int error_code, datatype_size;
+ int error_code;
+ MPI_Count datatype_size;
ADIO_File adio_fh;
void *xbuf=NULL, *e32_buf=NULL;
@@ -82,7 +83,7 @@ int MPIOI_File_read_all_begin(MPI_File fh,
}
/* --END ERROR HANDLING-- */
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/read_ord.c b/src/mpi/romio/mpi-io/read_ord.c
index dc2573b..19ced81 100644
--- a/src/mpi/romio/mpi-io/read_ord.c
+++ b/src/mpi/romio/mpi-io/read_ord.c
@@ -42,7 +42,8 @@ Output Parameters:
int MPI_File_read_ordered(MPI_File fh, void *buf, int count,
MPI_Datatype datatype, MPI_Status *status)
{
- int error_code, datatype_size, nprocs, myrank, incr;
+ int error_code, nprocs, myrank, incr;
+ MPI_Count datatype_size;
int source, dest;
static char myname[] = "MPI_FILE_READ_ORDERED";
ADIO_Offset shared_fp=0;
@@ -58,7 +59,7 @@ int MPI_File_read_ordered(MPI_File fh, void *buf, int count,
MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code);
/* --END ERROR HANDLING-- */
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/read_ordb.c b/src/mpi/romio/mpi-io/read_ordb.c
index 324fa7f..b29488d 100644
--- a/src/mpi/romio/mpi-io/read_ordb.c
+++ b/src/mpi/romio/mpi-io/read_ordb.c
@@ -39,7 +39,8 @@ Output Parameters:
int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count,
MPI_Datatype datatype)
{
- int error_code, datatype_size, nprocs, myrank, incr;
+ int error_code, nprocs, myrank, incr;
+ MPI_Count datatype_size;
int source, dest;
ADIO_Offset shared_fp;
ADIO_File adio_fh;
@@ -68,7 +69,7 @@ int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count,
adio_fh->split_coll_count = 1;
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/read_sh.c b/src/mpi/romio/mpi-io/read_sh.c
index 1536838..65dd442 100644
--- a/src/mpi/romio/mpi-io/read_sh.c
+++ b/src/mpi/romio/mpi-io/read_sh.c
@@ -44,7 +44,8 @@ int MPI_File_read_shared(MPI_File fh, void *buf, int count,
{
int error_code, bufsize, buftype_is_contig, filetype_is_contig;
static char myname[] = "MPI_FILE_READ_SHARED";
- int datatype_size, incr;
+ int incr;
+ MPI_Count datatype_size;
ADIO_Offset off, shared_fp;
ADIO_File adio_fh;
void *xbuf=NULL, *e32_buf=NULL;
@@ -59,7 +60,7 @@ int MPI_File_read_shared(MPI_File fh, void *buf, int count,
MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code);
/* --END ERROR HANDLING-- */
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/set_view.c b/src/mpi/romio/mpi-io/set_view.c
index 77a7756..89762b5 100644
--- a/src/mpi/romio/mpi-io/set_view.c
+++ b/src/mpi/romio/mpi-io/set_view.c
@@ -39,7 +39,8 @@ Input Parameters:
int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype,
MPI_Datatype filetype, const char *datarep, MPI_Info info)
{
- int filetype_size, etype_size, error_code;
+ int error_code;
+ MPI_Count filetype_size, etype_size;
static char myname[] = "MPI_FILE_SET_VIEW";
ADIO_Offset shared_fp, byte_off;
ADIO_File adio_fh;
@@ -109,8 +110,8 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype,
MPIO_CHECK_INFO_ALL(info, error_code, adio_fh->comm);
/* --END ERROR HANDLING-- */
- MPI_Type_size(filetype, &filetype_size);
- MPI_Type_size(etype, &etype_size);
+ MPI_Type_size_x(filetype, &filetype_size);
+ MPI_Type_size_x(etype, &etype_size);
/* --BEGIN ERROR HANDLING-- */
if (etype_size != 0 && filetype_size % etype_size != 0)
diff --git a/src/mpi/romio/mpi-io/write.c b/src/mpi/romio/mpi-io/write.c
index 02867c2..62d6eb0 100644
--- a/src/mpi/romio/mpi-io/write.c
+++ b/src/mpi/romio/mpi-io/write.c
@@ -71,7 +71,7 @@ int MPIOI_File_write(MPI_File fh,
MPI_Status *status)
{
int error_code, bufsize, buftype_is_contig, filetype_is_contig;
- int datatype_size;
+ MPI_Count datatype_size;
ADIO_Offset off;
ADIO_File adio_fh;
void *e32buf=NULL;
@@ -96,7 +96,7 @@ int MPIOI_File_write(MPI_File fh,
}
/* --END ERROR HANDLING-- */
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/write_all.c b/src/mpi/romio/mpi-io/write_all.c
index 2e1533c..822330a 100644
--- a/src/mpi/romio/mpi-io/write_all.c
+++ b/src/mpi/romio/mpi-io/write_all.c
@@ -72,7 +72,8 @@ int MPIOI_File_write_all(MPI_File fh,
char *myname,
MPI_Status *status)
{
- int error_code, datatype_size;
+ int error_code;
+ MPI_Count datatype_size;
ADIO_File adio_fh;
void *e32buf=NULL;
const void *xbuf=NULL;
@@ -96,7 +97,7 @@ int MPIOI_File_write_all(MPI_File fh,
}
/* --END ERROR HANDLING-- */
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/write_allb.c b/src/mpi/romio/mpi-io/write_allb.c
index 21e928e..e7e2fc2 100644
--- a/src/mpi/romio/mpi-io/write_allb.c
+++ b/src/mpi/romio/mpi-io/write_allb.c
@@ -58,7 +58,8 @@ int MPIOI_File_write_all_begin(MPI_File fh,
MPI_Datatype datatype,
char *myname)
{
- int error_code, datatype_size;
+ int error_code;
+ MPI_Count datatype_size;
ADIO_File adio_fh;
void *e32buf=NULL;
const void *xbuf=NULL;
@@ -94,7 +95,7 @@ int MPIOI_File_write_all_begin(MPI_File fh,
adio_fh->split_coll_count = 1;
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/write_ord.c b/src/mpi/romio/mpi-io/write_ord.c
index d0fe63f..22f1f06 100644
--- a/src/mpi/romio/mpi-io/write_ord.c
+++ b/src/mpi/romio/mpi-io/write_ord.c
@@ -43,7 +43,8 @@ Output Parameters:
int MPI_File_write_ordered(MPI_File fh, const void *buf, int count,
MPI_Datatype datatype, MPI_Status *status)
{
- int error_code, datatype_size, nprocs, myrank, incr;
+ int error_code, nprocs, myrank, incr;
+ MPI_Count datatype_size;
int source, dest;
static char myname[] = "MPI_FILE_WRITE_ORDERED";
ADIO_Offset shared_fp;
@@ -61,7 +62,7 @@ int MPI_File_write_ordered(MPI_File fh, const void *buf, int count,
MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code);
/* --END ERROR HANDLING-- */
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/write_ordb.c b/src/mpi/romio/mpi-io/write_ordb.c
index 87ee213..848de29 100644
--- a/src/mpi/romio/mpi-io/write_ordb.c
+++ b/src/mpi/romio/mpi-io/write_ordb.c
@@ -39,7 +39,8 @@ Output Parameters:
int MPI_File_write_ordered_begin(MPI_File fh, const void *buf, int count,
MPI_Datatype datatype)
{
- int error_code, datatype_size, nprocs, myrank, incr;
+ int error_code, nprocs, myrank, incr;
+ MPI_Count datatype_size;
int source, dest;
static char myname[] = "MPI_FILE_WRITE_ORDERED_BEGIN";
ADIO_Offset shared_fp;
@@ -68,7 +69,7 @@ int MPI_File_write_ordered_begin(MPI_File fh, const void *buf, int count,
adio_fh->split_coll_count = 1;
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code);
diff --git a/src/mpi/romio/mpi-io/write_sh.c b/src/mpi/romio/mpi-io/write_sh.c
index de7d21d..870e901 100644
--- a/src/mpi/romio/mpi-io/write_sh.c
+++ b/src/mpi/romio/mpi-io/write_sh.c
@@ -44,7 +44,7 @@ int MPI_File_write_shared(MPI_File fh, const void *buf, int count,
{
int error_code, bufsize, buftype_is_contig, filetype_is_contig;
static char myname[] = "MPI_FILE_READ_SHARED";
- int datatype_size, incr;
+ MPI_Count datatype_size, incr;
ADIO_Offset off, shared_fp;
ADIO_File adio_fh;
void *e32buf = NULL;
@@ -60,7 +60,7 @@ int MPI_File_write_shared(MPI_File fh, const void *buf, int count,
MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code);
/* --END ERROR HANDLING-- */
- MPI_Type_size(datatype, &datatype_size);
+ MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code);
http://git.mpich.org/mpich.git/commitdiff/e518cb4c0c80bf14b5eb828fc32397991…
commit e518cb4c0c80bf14b5eb828fc32397991a8d38e8
Author: Rob Latham <robl(a)mcs.anl.gov>
Date: Tue Sep 24 16:02:30 2013 -0500
Configure check for (need for) header padding
Dancing around with various schemes to detect/deal-with compiler padding
in structs so the 'payload' field ends up double-aligned. The new
"large type , large count" work introduced a pointer into the nemisis
packet, so we have to be a bit more dynamic about how or if we pad out
the structure.
- put the members of MPID_nem_pkt_header inside a struct, so subsequent
payload does not "fall into" compiler-introduced padding
- use this updated datatype to determine the size, and if we need to pad
or not.
- use the result of the configure test to introduce padding, or omit the
padding from the definition if the amount of padding is '0'
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpid/ch3/channels/nemesis/include/mpid_nem_datatypes.h b/src/mpid/ch3/channels/nemesis/include/mpid_nem_datatypes.h
index bbc7b98..13a3940 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_datatypes.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_datatypes.h
@@ -144,20 +144,14 @@
#define MPID_NEM_MPICH_HEAD_LEN sizeof(MPID_nem_pkt_header_t)
#define MPID_NEM_MPICH_DATA_LEN (MPID_NEM_CELL_PAYLOAD_LEN - MPID_NEM_MPICH_HEAD_LEN)
-#define MPID_NEM_PKT_HEADER_FIELDS \
- int source; \
- int dest; \
- MPIDI_msg_sz_t datalen; \
- unsigned short seqno; \
- unsigned short type /* currently used only with checkpointing */
-typedef struct MPID_nem_pkt_header
-{
- MPID_NEM_PKT_HEADER_FIELDS;
-} MPID_nem_pkt_header_t;
+#include "mpid_nem_pkt_header.h"
typedef struct MPID_nem_pkt_mpich
{
MPID_NEM_PKT_HEADER_FIELDS;
+#if (MPID_NEM_PKT_HEADER_PADDING > 0)
+ char padding[MPID_NEM_PKT_HEADER_PADDING];
+#endif
char payload[MPID_NEM_MPICH_DATA_LEN];
} MPID_nem_pkt_mpich_t;
diff --git a/src/mpid/ch3/channels/nemesis/include/mpid_nem_pkt_header.h b/src/mpid/ch3/channels/nemesis/include/mpid_nem_pkt_header.h
new file mode 100644
index 0000000..5888cf3
--- /dev/null
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_pkt_header.h
@@ -0,0 +1,25 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2013 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+
+#ifndef MPID_NEM_PKT_HEADER_H
+#define MPID_NEM_PKT_HEADER_H
+
+#define MPID_NEM_PKT_HEADER_FIELDS \
+ struct { \
+ int source; \
+ int dest; \
+ MPIR_Pint datalen; \
+ unsigned short seqno; \
+ unsigned short type; /* currently used only with checkpointing */ \
+ };
+
+typedef struct MPID_nem_pkt_header
+{
+ MPID_NEM_PKT_HEADER_FIELDS;
+} MPID_nem_pkt_header_t;
+
+
+#endif /* MPID_NEM_DATATYPES_H */
diff --git a/src/mpid/ch3/channels/nemesis/subconfigure.m4 b/src/mpid/ch3/channels/nemesis/subconfigure.m4
index c53932f..fab8504 100644
--- a/src/mpid/ch3/channels/nemesis/subconfigure.m4
+++ b/src/mpid/ch3/channels/nemesis/subconfigure.m4
@@ -319,6 +319,23 @@ if test "$enable_nemesis_lock_free_queues" = "yes" ; then
AC_DEFINE(MPID_NEM_USE_LOCK_FREE_QUEUES, 1, [Define to enable lock-free communication queues])
fi
+# for nemisis header alignment, will need to know how this structure laid out:
+AC_CHECK_SIZEOF(MPID_nem_pkt_header_t, 0, [
+typedef $MPI_PINT MPIR_Pint;
+#include "${master_top_srcdir}/src/mpid/ch3/channels/nemesis/include/mpid_nem_pkt_header.h"])
+
+AC_CHECK_ALIGNOF(MPID_nem_pkt_header_t, [
+typedef $MPI_PINT MPIR_Pint;
+#include "${master_top_srcdir}/src/mpid/ch3/channels/nemesis/include/mpid_nem_pkt_header.h"])
+
+# We're trying to get 'payload' to live at a double-aligned memory address
+AS_VAR_ARITH([mpid_pkt_header_padding],
+ [ $ac_cv_alignof_MPID_nem_pkt_header_t % $ac_cv_sizeof_double])
+AC_DEFINE_UNQUOTED(MPID_NEM_PKT_HEADER_PADDING, [$mpid_pkt_header_padding], [Amount of padding needed in the MPID_nem_pkt_header_t structure])
+
+
+
+
AC_SUBST(device_name)
AC_SUBST(channel_name)
AC_SUBST(nemesis_networks)
http://git.mpich.org/mpich.git/commitdiff/d1bf416117ccff40533f9c3007ba2859b…
commit d1bf416117ccff40533f9c3007ba2859b944fb47
Author: Dave Goodell <goodell(a)mcs.anl.gov>
Date: Thu Apr 4 13:02:16 2013 -0500
large count work: use MPI_Aint for dtype size and collectives
Also includes random fixes to `-Wshorten-64-to-32` warnings which might
need to be teased out.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/include/mpierrs.h b/src/include/mpierrs.h
index ee592e2..e9c69e3 100644
--- a/src/include/mpierrs.h
+++ b/src/include/mpierrs.h
@@ -298,7 +298,7 @@
int ferr = 0; \
if (HANDLE_GET_KIND(dtype) == HANDLE_KIND_BUILTIN) { ferr=1; } \
else { \
- int errsize; \
+ MPI_Aint errsize; \
MPID_Datatype *errdtypeptr; \
MPID_Datatype_get_ptr(dtype,errdtypeptr); \
MPID_Datatype_get_size_macro(dtype,errsize); \
diff --git a/src/include/mpiutil.h b/src/include/mpiutil.h
index 9cd5d66..266fbe1 100644
--- a/src/include/mpiutil.h
+++ b/src/include/mpiutil.h
@@ -195,7 +195,10 @@ int MPIR_Assert_fail_fmt(const char *cond, const char *file_name, int line_num,
unsigned short: USHRT_MAX, \
unsigned int: UINT_MAX, \
unsigned long: ULONG_MAX, \
- unsigned long long: ULLONG_MAX)
+ unsigned long long: ULLONG_MAX,\
+ /* _Generic cares about cv-qualifiers */ \
+ volatile signed int: INT_MAX, \
+ volatile unsigned int: UINT_MAX)
#define expr_inttype_min(expr_) \
_Generic(expr_, \
signed char: SCHAR_MIN, \
@@ -207,7 +210,10 @@ int MPIR_Assert_fail_fmt(const char *cond, const char *file_name, int line_num,
unsigned short: 0, \
unsigned int: 0, \
unsigned long: 0, \
- unsigned long long: 0)
+ unsigned long long: 0, \
+ /* _Generic cares about cv-qualifiers */ \
+ volatile signed int: INT_MIN, \
+ volatile unsigned int: 0)
#endif
/* Assigns (src_) to (dst_), checking that (src_) fits in (dst_) without
@@ -218,18 +224,19 @@ int MPIR_Assert_fail_fmt(const char *cond, const char *file_name, int line_num,
* can be found in Chapter 5 of "Secure Coding in C and C++" by Robert Seacord.
*/
#if defined(expr_inttype_max) && defined(expr_inttype_min)
-# define MPIU_Assign_trunc(dst_,src_) \
- do { \
- MPIU_Assert((src_) <= expr_inttype_max(dst_)); \
- MPIU_Assert((src_) >= expr_inttype_min(dst_)); \
- dst_ = (src_); \
+# define MPIU_Assign_trunc(dst_,src_,dst_type_) \
+ do { \
+ MPIU_Assert_has_type((dst_), dst_type_); \
+ MPIU_Assert((src_) <= expr_inttype_max(dst_)); \
+ MPIU_Assert((src_) >= expr_inttype_min(dst_)); \
+ dst_ = (dst_type_)(src_); \
} while (0)
#else
-# define MPIU_Assign_trunc(dst_,src_) \
- do { \
- dst_ = (src_); \
+# define MPIU_Assign_trunc(dst_,src_,dst_type_) \
+ do { \
+ dst_ = (dst_type_)(src_); \
/* will catch some of the cases if the expr_inttype macros aren't available */ \
- MPIU_Assert((dst_) == (src_)); \
+ MPIU_Assert((dst_) == (src_)); \
} while (0)
#endif
diff --git a/src/mpi/coll/allred_group.c b/src/mpi/coll/allred_group.c
index a493bc1..396fb76 100644
--- a/src/mpi/coll/allred_group.c
+++ b/src/mpi/coll/allred_group.c
@@ -29,7 +29,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
MPID_Group *group_ptr, int tag, int *errflag)
{
- int type_size;
+ MPI_Aint type_size;
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
/* newrank is a rank in group_ptr */
diff --git a/src/mpi/coll/allreduce.c b/src/mpi/coll/allreduce.c
index 766caa8..e0b014b 100644
--- a/src/mpi/coll/allreduce.c
+++ b/src/mpi/coll/allreduce.c
@@ -136,7 +136,8 @@ int MPIR_Allreduce_intra (
int is_homogeneous;
int rc;
#endif
- int comm_size, rank, type_size;
+ int comm_size, rank;
+ MPI_Aint type_size;
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
int nbytes = 0;
diff --git a/src/mpi/coll/bcast.c b/src/mpi/coll/bcast.c
index aa3ec5e..f644bfd 100644
--- a/src/mpi/coll/bcast.c
+++ b/src/mpi/coll/bcast.c
@@ -45,7 +45,8 @@ static int MPIR_Bcast_binomial(
int nbytes=0;
int recvd_size;
MPI_Status status;
- int type_size, is_contig, is_homogeneous;
+ int is_contig, is_homogeneous;
+ MPI_Aint type_size;
int position;
void *tmp_buf=NULL;
MPI_Comm comm;
@@ -399,8 +400,9 @@ static int MPIR_Bcast_scatter_doubling_allgather(
int relative_rank, mask;
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
- int scatter_size, nbytes=0, curr_size, recv_size = 0;
- int type_size, j, k, i, tmp_mask, is_contig, is_homogeneous;
+ int scatter_size, curr_size, recv_size = 0;
+ int j, k, i, tmp_mask, is_contig, is_homogeneous;
+ MPI_Aint type_size, nbytes = 0;
int relative_dst, dst_tree_root, my_tree_root, send_offset;
int recv_offset, tree_root, nprocs_completed, offset, position;
MPIU_CHKLMEM_DECL(1);
@@ -706,7 +708,8 @@ static int MPIR_Bcast_scatter_ring_allgather(
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
int scatter_size, nbytes;
- int type_size, j, i, is_contig, is_homogeneous;
+ int j, i, is_contig, is_homogeneous;
+ MPI_Aint type_size;
int position;
int left, right, jnext;
int curr_size = 0;
@@ -912,8 +915,8 @@ static int MPIR_SMP_Bcast(
{
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
- int type_size, is_homogeneous;
- int nbytes=0;
+ int is_homogeneous;
+ MPI_Aint type_size, nbytes=0;
MPI_Status status;
int recvd_size;
diff --git a/src/mpi_t/mpit.c b/src/mpi_t/mpit.c
index 9ca5f0f..8636b80 100644
--- a/src/mpi_t/mpit.c
+++ b/src/mpi_t/mpit.c
@@ -455,7 +455,7 @@ void MPIR_T_strncpy(char *dst, const char *src, int *len)
MPIU_Assert(*len > 0);
if (src != NULL) {
MPL_strncpy(dst, src, *len);
- *len = strlen(dst) + 1;
+ *len = (int)strlen(dst) + 1;
} else {
/* As if an empty string is copied */
*dst = '\0';
diff --git a/src/mpid/ch3/channels/nemesis/include/mpid_nem_datatypes.h b/src/mpid/ch3/channels/nemesis/include/mpid_nem_datatypes.h
index 04b3c56..bbc7b98 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_datatypes.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_datatypes.h
@@ -147,7 +147,7 @@
#define MPID_NEM_PKT_HEADER_FIELDS \
int source; \
int dest; \
- int datalen; \
+ MPIDI_msg_sz_t datalen; \
unsigned short seqno; \
unsigned short type /* currently used only with checkpointing */
typedef struct MPID_nem_pkt_header
diff --git a/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h b/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h
index 32eb82d..2e3f299 100644
--- a/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h
+++ b/src/mpid/ch3/channels/nemesis/include/mpid_nem_inline.h
@@ -217,7 +217,7 @@ MPID_nem_mpich_sendv (MPID_IOV **iov, int *n_iov, MPIDI_VC_t *vc, int *again)
while (*n_iov && payload_len >= (*iov)->MPID_IOV_LEN)
{
- int _iov_len = (*iov)->MPID_IOV_LEN;
+ size_t _iov_len = (*iov)->MPID_IOV_LEN;
MPIU_Memcpy (cell_buf, (*iov)->MPID_IOV_BUF, _iov_len);
payload_len -= _iov_len;
cell_buf += _iov_len;
@@ -352,7 +352,7 @@ MPID_nem_mpich_sendv_header (MPID_IOV **iov, int *n_iov, MPIDI_VC_t *vc, int *ag
payload_len = MPID_NEM_MPICH_DATA_LEN - sizeof(MPIDI_CH3_Pkt_t);
while (*n_iov && payload_len >= (*iov)->MPID_IOV_LEN)
{
- int _iov_len = (*iov)->MPID_IOV_LEN;
+ size_t _iov_len = (*iov)->MPID_IOV_LEN;
MPIU_Memcpy (cell_buf, (*iov)->MPID_IOV_BUF, _iov_len);
payload_len -= _iov_len;
cell_buf += _iov_len;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
index a26cfb2..d27a525 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
@@ -459,7 +459,9 @@ static int send_id_info(const sockconn_t *const sc)
MPIDI_nem_tcp_idinfo_t id_info;
MPIDI_nem_tcp_header_t hdr;
struct iovec iov[3];
- int pg_id_len = 0, offset, buf_size, iov_cnt = 2;
+ int buf_size, iov_cnt = 2;
+ ssize_t offset;
+ size_t pg_id_len = 0;
MPIDI_STATE_DECL(MPID_STATE_SEND_ID_INFO);
MPIDI_FUNC_ENTER(MPID_STATE_SEND_ID_INFO);
@@ -503,7 +505,7 @@ static int send_id_info(const sockconn_t *const sc)
MPIDI_FUNC_EXIT(MPID_STATE_SEND_ID_INFO);
return mpi_errno;
fn_fail:
- MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d, offset=%d, errno=%d %s", mpi_errno, offset, errno, MPIU_Strerror(errno)));
+ MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d, offset=%lld, errno=%d %s", mpi_errno, (long long)offset, errno, MPIU_Strerror(errno)));
goto fn_exit;
}
@@ -518,7 +520,8 @@ static int send_tmpvc_info(const sockconn_t *const sc)
MPIDI_nem_tcp_portinfo_t port_info;
MPIDI_nem_tcp_header_t hdr;
struct iovec iov[3];
- int offset, buf_size, iov_cnt = 2;
+ int buf_size, iov_cnt = 2;
+ ssize_t offset;
MPIDI_STATE_DECL(MPID_STATE_SEND_TMPVC_INFO);
MPIDI_FUNC_ENTER(MPID_STATE_SEND_TMPVC_INFO);
@@ -552,7 +555,7 @@ static int send_tmpvc_info(const sockconn_t *const sc)
MPIDI_FUNC_EXIT(MPID_STATE_SEND_TMPVC_INFO);
return mpi_errno;
fn_fail:
- MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d, offset=%d, errno=%d %s", mpi_errno, offset, errno, MPIU_Strerror(errno)));
+ MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d, offset=%lld, errno=%d %s", mpi_errno, (long long)offset, errno, MPIU_Strerror(errno)));
goto fn_exit;
}
@@ -564,7 +567,9 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_nem_tcp_header_t hdr;
- int pg_id_len = 0, nread, iov_cnt = 1;
+ int iov_cnt = 1;
+ size_t pg_id_len = 0;
+ ssize_t nread;
int hdr_len = sizeof(MPIDI_nem_tcp_header_t);
struct iovec iov[2];
char *pg_id = NULL;
@@ -695,7 +700,8 @@ static int recv_id_or_tmpvc_info(sockconn_t *const sc, int *got_sc_eof)
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static int send_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t pkt_type)
{
- int mpi_errno = MPI_SUCCESS, offset;
+ int mpi_errno = MPI_SUCCESS;
+ ssize_t offset;
MPIDI_nem_tcp_header_t pkt;
int pkt_len = sizeof(MPIDI_nem_tcp_header_t);
@@ -729,7 +735,8 @@ static int send_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t pkt_type)
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static int recv_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t *pkt_type)
{
- int mpi_errno = MPI_SUCCESS, nread;
+ int mpi_errno = MPI_SUCCESS;
+ ssize_t nread;
MPIDI_nem_tcp_header_t pkt;
int pkt_len = sizeof(MPIDI_nem_tcp_header_t);
MPIDI_STATE_DECL(MPID_STATE_RECV_CMD_PKT);
@@ -1597,11 +1604,11 @@ static int MPID_nem_tcp_recv_handler(sockconn_t *const sc)
{
iov->MPID_IOV_BUF = (char *)iov->MPID_IOV_BUF + bytes_recvd;
iov->MPID_IOV_LEN -= bytes_recvd;
- rreq->dev.iov_count = &rreq->dev.iov[rreq->dev.iov_offset + rreq->dev.iov_count] - iov;
+ rreq->dev.iov_count = (int)(&rreq->dev.iov[rreq->dev.iov_offset + rreq->dev.iov_count] - iov);
rreq->dev.iov_offset = iov - rreq->dev.iov;
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "bytes_recvd = %ld", (long int)bytes_recvd);
MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov len = %ld", (long int)iov->MPID_IOV_LEN);
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_offset = %d", rreq->dev.iov_offset);
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, "iov_offset = %lld", (long long)rreq->dev.iov_offset);
goto fn_exit;
}
bytes_recvd -= iov->MPID_IOV_LEN;
@@ -1811,7 +1818,7 @@ int MPID_nem_tcp_connpoll(int in_blocking_poll)
* on many platforms, including modern Linux. */
if (it_plfd->revents & POLLERR || it_plfd->revents & POLLNVAL) {
int req_errno = MPI_SUCCESS;
- int rc;
+ ssize_t rc;
char dummy;
const char *err_str = "UNKNOWN";
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h
index ea3e02e..270de1a 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h
@@ -162,7 +162,7 @@ typedef enum MPIDI_nem_tcp_socksm_pkt_type {
typedef struct MPIDI_nem_tcp_header {
MPIDI_nem_tcp_socksm_pkt_type_t pkt_type;
- int datalen;
+ MPIDI_msg_sz_t datalen;
} MPIDI_nem_tcp_header_t;
typedef struct MPIDI_nem_tcp_idinfo {
diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_utility.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_utility.c
index b4bca79..fbc9d2c 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_utility.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/tcp_utility.c
@@ -179,7 +179,8 @@ int MPID_nem_tcp_is_sock_connected(int fd)
{
int rc = FALSE;
char buf[1];
- int buf_len = sizeof(buf)/sizeof(buf[0]), ret_recv, error=0;
+ int buf_len = sizeof(buf)/sizeof(buf[0]), error=0;
+ size_t ret_recv;
socklen_t n = sizeof(error);
n = sizeof(error);
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_isend.c b/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
index 1b15039..da5141a 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_isend.c
@@ -51,8 +51,9 @@ int MPIDI_CH3_iSend (MPIDI_VC_t *vc, MPID_Request *sreq, void * hdr, MPIDI_msg_s
if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq))
{
+ MPIU_Assert(hdr_sz <= INT_MAX);
MPIU_DBG_MSG_D (CH3_CHANNEL, VERBOSE, "iSend %d", (int) hdr_sz);
- mpi_errno = MPID_nem_mpich_send_header (hdr, hdr_sz, vc, &again);
+ mpi_errno = MPID_nem_mpich_send_header (hdr, (int)hdr_sz, vc, &again);
if (mpi_errno) MPIU_ERR_POP (mpi_errno);
if (again)
{
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
index a21219e..4e97a0a 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c
@@ -55,8 +55,9 @@ int MPIDI_CH3_iStartMsg (MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, MPID_
if (MPIDI_CH3I_Sendq_empty(MPIDI_CH3I_shm_sendq))
/* MT */
{
+ MPIU_Assert(hdr_sz <= INT_MAX);
MPIU_DBG_MSG_D (CH3_CHANNEL, VERBOSE, "iStartMsg %d", (int) hdr_sz);
- mpi_errno = MPID_nem_mpich_send_header (hdr, hdr_sz, vc, &again);
+ mpi_errno = MPID_nem_mpich_send_header (hdr, (int)hdr_sz, vc, &again);
if (mpi_errno) MPIU_ERR_POP (mpi_errno);
if (again)
{
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
index e26658a..0b4657e 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
@@ -723,8 +723,8 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
while (n_iov && buflen >= iov->MPID_IOV_LEN)
{
- int iov_len = iov->MPID_IOV_LEN;
- MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, " %d", iov_len);
+ size_t iov_len = iov->MPID_IOV_LEN;
+ MPIU_DBG_MSG_D(CH3_CHANNEL, VERBOSE, " %d", (int)iov_len);
MPIU_Memcpy (iov->MPID_IOV_BUF, buf, iov_len);
buflen -= iov_len;
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c
index 1ab1fe1..44dfd0b 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c
@@ -20,7 +20,7 @@ void MPID_nem_dbg_dump_cell (volatile struct MPID_nem_cell *cell)
MPIU_DBG_MSG_D (ALL, TERSE, " src = %6d", cell->pkt.mpich.source);
MPIU_DBG_MSG_D (ALL, TERSE, " dst = %6d", cell->pkt.mpich.dest);
- MPIU_DBG_MSG_D (ALL, TERSE, " len = %6d", cell->pkt.mpich.datalen);
+ MPIU_DBG_MSG_D (ALL, TERSE, " len = %6d", (int)cell->pkt.mpich.datalen);
MPIU_DBG_MSG_D (ALL, TERSE, " sqn = %6d", cell->pkt.mpich.seqno);
MPIU_DBG_MSG_D (ALL, TERSE, " typ = %6d", cell->pkt.mpich.type);
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
index 5674e8d..34243cd 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c
@@ -4,7 +4,7 @@
* See COPYRIGHT in top-level directory.
*/
-#include "mpid_nem_pre.h"
+#include "mpiimpl.h"
#include "mpid_nem_impl.h"
#include "mpid_nem_nets.h"
#include <errno.h>
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_shm.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_shm.c
index 489de5c..e8ccc6d 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_shm.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt_shm.c
@@ -494,7 +494,7 @@ static int lmt_shm_send_progress(MPIDI_VC_t *vc, MPID_Request *req, int *done)
last = (data_sz - first <= copy_limit) ? data_sz : first + copy_limit;
MPID_Segment_pack(req->dev.segment_ptr, first, &last, (void *)copy_buf->buf[buf_num]); /* cast away volatile */
OPA_write_barrier();
- copy_buf->len[buf_num].val = last - first;
+ MPIU_Assign_trunc(copy_buf->len[buf_num].val, (last - first), volatile int);
first = last;
buf_num = (buf_num+1) % NUM_BUFS;
diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h
index 3e0935d..4d93ae4 100644
--- a/src/mpid/ch3/include/mpidpre.h
+++ b/src/mpid/ch3/include/mpidpre.h
@@ -340,7 +340,7 @@ typedef struct MPIDI_Request {
iov_offset points to the current head element in the IOV */
MPID_IOV iov[MPID_IOV_LIMIT];
int iov_count;
- int iov_offset;
+ size_t iov_offset;
/* OnDataAvail is the action to take when data is now available.
For example, when an operation described by an iov has
diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h
index 54b8d7f..4eb6206 100644
--- a/src/mpid/ch3/include/mpidrma.h
+++ b/src/mpid/ch3/include/mpidrma.h
@@ -47,7 +47,7 @@ enum MPID_Lock_state {
typedef struct MPIDI_RMA_dtype_info { /* for derived datatypes */
int is_contig;
int max_contig_blocks;
- int size;
+ MPI_Aint size;
MPI_Aint extent;
int dataloop_size; /* not needed because this info is sent in
packet header. remove it after lock/unlock
@@ -707,7 +707,8 @@ static inline int MPIDI_CH3I_Shm_acc_op(const void *origin_addr, int origin_coun
if (shm_op) MPIDI_CH3I_SHM_MUTEX_LOCK(win_ptr);
for (i=0; i<vec_len; i++)
{
- count = (dloop_vec[i].DLOOP_VECTOR_LEN)/type_size;
+ MPIU_Assign_trunc(count, (dloop_vec[i].DLOOP_VECTOR_LEN)/type_size, int);
+
(*uop)((char *)source_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
(char *)target_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
&count, &type);
@@ -866,7 +867,7 @@ static inline int MPIDI_CH3I_Shm_get_acc_op(const void *origin_addr, int origin_
type_size = MPID_Datatype_get_basic_size(type);
for (i=0; i<vec_len; i++) {
- count = (dloop_vec[i].DLOOP_VECTOR_LEN)/type_size;
+ MPIU_Assign_trunc(count, (dloop_vec[i].DLOOP_VECTOR_LEN)/type_size, int);
(*uop)((char *)source_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
(char *)target_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
&count, &type);
@@ -943,7 +944,8 @@ static inline int MPIDI_CH3I_Shm_cas_op(const void *origin_addr, const void *com
{
void *base = NULL, *dest_addr = NULL;
int disp_unit;
- int len, shm_locked = 0;
+ MPI_Aint len;
+ int shm_locked = 0;
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_SHM_CAS_OP);
@@ -999,7 +1001,8 @@ static inline int MPIDI_CH3I_Shm_fop_op(const void *origin_addr, void *result_ad
void *base = NULL, *dest_addr = NULL;
MPI_User_function *uop = NULL;
int disp_unit;
- int len, one, shm_locked = 0;
+ MPI_Aint len;
+ int one, shm_locked = 0;
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_SHM_FOP_OP);
diff --git a/src/mpid/ch3/src/ch3u_handle_connection.c b/src/mpid/ch3/src/ch3u_handle_connection.c
index fbbe3cb..cc34eb9 100644
--- a/src/mpid/ch3/src/ch3u_handle_connection.c
+++ b/src/mpid/ch3/src/ch3u_handle_connection.c
@@ -424,7 +424,7 @@ static int terminate_failed_VCs(MPID_Group *new_failed_group)
while (isspace(*c)) /* skip spaces */ \
++c; \
MPIU_ERR_CHKINTERNAL(!isdigit(*c), mpi_errno, "error parsing failed process list"); \
- *(r_p) = strtol(c, &c, 0); \
+ *(r_p) = (int)strtol(c, &c, 0); \
while (isspace(*c)) /* skip spaces */ \
++c; \
} while (0)
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_req.c b/src/mpid/ch3/src/ch3u_handle_recv_req.c
index 1ea9b52..0b9be5d 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_req.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_req.c
@@ -90,7 +90,7 @@ int MPIDI_CH3_ReqHandler_PutAccumRespComplete( MPIDI_VC_t *vc,
/* Perform get in get-accumulate */
if (rreq->dev.resp_request_handle != MPI_REQUEST_NULL) {
- int type_size;
+ MPI_Aint type_size;
MPIDI_CH3_Pkt_t upkt;
MPIDI_CH3_Pkt_get_accum_resp_t *get_accum_resp_pkt = &upkt.get_accum_resp;
MPID_Request *resp_req;
@@ -493,7 +493,8 @@ int MPIDI_CH3_ReqHandler_FOPComplete( MPIDI_VC_t *vc,
MPID_Request *resp_req;
MPID_Win *win_ptr;
MPI_User_function *uop;
- int len, one;
+ MPI_Aint len;
+ int one;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_REQHANDLER_FOPCOMPLETE);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_REQHANDLER_FOPCOMPLETE);
@@ -822,7 +823,8 @@ static int do_accumulate_op(MPID_Request *rreq)
MPID_Segment *segp;
DLOOP_VECTOR *dloop_vec;
MPI_Aint first, last;
- int vec_len, i, type_size, count;
+ int vec_len, i, count;
+ MPI_Aint type_size;
MPI_Datatype type;
MPID_Datatype *dtp;
@@ -860,7 +862,7 @@ static int do_accumulate_op(MPID_Request *rreq)
MPID_Datatype_get_size_macro(type, type_size);
for (i=0; i<vec_len; i++)
{
- count = (dloop_vec[i].DLOOP_VECTOR_LEN)/type_size;
+ MPIU_Assign_trunc(count, (dloop_vec[i].DLOOP_VECTOR_LEN)/type_size, int);
(*uop)((char *)rreq->dev.user_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
(char *)rreq->dev.real_user_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF),
&count, &type);
@@ -1171,7 +1173,8 @@ static int do_simple_get(MPID_Win *win_ptr, MPIDI_Win_lock_queue *lock_queue)
MPIDI_CH3_Pkt_get_resp_t * get_resp_pkt = &upkt.get_resp;
MPID_Request *req;
MPID_IOV iov[MPID_IOV_LIMIT];
- int type_size, mpi_errno=MPI_SUCCESS;
+ int mpi_errno=MPI_SUCCESS;
+ MPI_Aint type_size;
MPIDI_STATE_DECL(MPID_STATE_DO_SIMPLE_GET);
MPIDI_FUNC_ENTER(MPID_STATE_DO_SIMPLE_GET);
diff --git a/src/mpid/ch3/src/ch3u_request.c b/src/mpid/ch3/src/ch3u_request.c
index 86dff27..ef1779a 100644
--- a/src/mpid/ch3/src/ch3u_request.c
+++ b/src/mpid/ch3/src/ch3u_request.c
@@ -366,8 +366,8 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
rreq->dev.segment_first,
&last, &rreq->dev.iov[0], &rreq->dev.iov_count);
MPIU_DBG_MSG_FMT(CH3_CHANNEL,VERBOSE,(MPIU_DBG_FDEST,
- "post-upv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d, iov_offset=%d",
- rreq->dev.segment_first, last, rreq->dev.iov_count, rreq->dev.iov_offset));
+ "post-upv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d, iov_offset=%lld",
+ rreq->dev.segment_first, last, rreq->dev.iov_count, (long long)rreq->dev.iov_offset));
MPIU_Assert(rreq->dev.iov_count >= 0 && rreq->dev.iov_count <=
MPID_IOV_LIMIT);
diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c
index 0d51fc1..beb5a6c 100644
--- a/src/mpid/ch3/src/ch3u_rma_sync.c
+++ b/src/mpid/ch3/src/ch3u_rma_sync.c
@@ -488,7 +488,7 @@ static int create_datatype(const MPIDI_RMA_dtype_info *dtype_info,
datatypes[0] = MPI_BYTE;
displaces[1] = MPIU_PtrToAint(dataloop);
- blocklens[1] = dataloop_sz;
+ MPIU_Assign_trunc(blocklens[1], dataloop_sz, int);
datatypes[1] = MPI_BYTE;
displaces[2] = MPIU_PtrToAint(o_addr);
@@ -554,7 +554,8 @@ static int MPIDI_CH3I_Send_rma_msg(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
MPIDI_CH3_Pkt_accum_t *accum_pkt = &upkt.accum;
MPID_IOV iov[MPID_IOV_LIMIT];
int mpi_errno=MPI_SUCCESS;
- int origin_dt_derived, target_dt_derived, origin_type_size, iovcnt;
+ int origin_dt_derived, target_dt_derived, iovcnt;
+ MPI_Aint origin_type_size;
MPIDI_VC_t * vc;
MPID_Comm *comm_ptr;
MPID_Datatype *target_dtp=NULL, *origin_dtp=NULL;
@@ -866,10 +867,11 @@ static int MPIDI_CH3I_Send_contig_acc_msg(MPIDI_RMA_Op_t *rma_op,
MPIDI_CH3_Pkt_accum_t *accum_pkt = &upkt.accum;
MPID_IOV iov[MPID_IOV_LIMIT];
int mpi_errno=MPI_SUCCESS;
- int origin_type_size, iovcnt;
+ int iovcnt;
+ MPI_Aint origin_type_size;
MPIDI_VC_t * vc;
MPID_Comm *comm_ptr;
- int len;
+ size_t len;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_SEND_CONTIG_ACC_MSG);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SEND_CONTIG_ACC_MSG);
@@ -878,7 +880,7 @@ static int MPIDI_CH3I_Send_contig_acc_msg(MPIDI_RMA_Op_t *rma_op,
MPID_Datatype_get_size_macro(rma_op->origin_datatype, origin_type_size);
/* FIXME: Make this size check efficient and match the packet type */
- len = rma_op->origin_count * origin_type_size;
+ MPIU_Assign_trunc(len, rma_op->origin_count * origin_type_size, size_t);
if (MPIR_CVAR_CH3_RMA_ACC_IMMED && len <= MPIDI_RMA_IMMED_INTS*sizeof(int)) {
MPIDI_CH3_Pkt_accum_immed_t * accumi_pkt = &upkt.accum_immed;
void *dest = accumi_pkt->data, *src = rma_op->origin_addr;
@@ -981,7 +983,7 @@ static int MPIDI_CH3I_Send_immed_rmw_msg(MPIDI_RMA_Op_t *rma_op,
MPID_Request *rmw_req = NULL, *resp_req = NULL;
MPIDI_VC_t *vc;
MPID_Comm *comm_ptr;
- int len;
+ MPI_Aint len;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_SEND_IMMED_RMW_MSG);
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SEND_IMMED_RMW_MSG);
@@ -2041,7 +2043,7 @@ int MPIDI_Win_unlock(int dest, MPID_Win *win_ptr)
* do an optimization where the lock and the RMA operation are
* sent in a single packet. Otherwise, we send a separate lock
* request first. */
- int type_size;
+ MPI_Aint type_size;
MPIDI_VC_t *vc;
MPIDI_RMA_Op_t *curr_op = rma_op;
@@ -2969,7 +2971,7 @@ static int MPIDI_CH3I_Send_lock_put_or_acc(MPID_Win *win_ptr, int target_rank)
MPID_IOV iov[MPID_IOV_LIMIT];
MPID_Comm *comm_ptr;
MPID_Datatype *origin_dtp=NULL;
- int origin_type_size;
+ MPI_Aint origin_type_size;
MPIDI_CH3_Pkt_t upkt;
MPIDI_CH3_Pkt_lock_put_unlock_t *lock_put_unlock_pkt =
&upkt.lock_put_unlock;
@@ -3344,7 +3346,7 @@ int MPIDI_CH3_PktHandler_Put( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
{
MPIDI_CH3_Pkt_put_t * put_pkt = &pkt->put;
MPID_Request *req = NULL;
- int type_size;
+ MPI_Aint type_size;
int complete = 0;
char *data_buf = NULL;
MPIDI_msg_sz_t data_len;
@@ -3514,7 +3516,7 @@ int MPIDI_CH3_PktHandler_Get( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
MPIDI_msg_sz_t data_len;
MPID_Win *win_ptr;
int mpi_errno = MPI_SUCCESS;
- int type_size;
+ MPI_Aint type_size;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_GET);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GET);
@@ -3647,7 +3649,7 @@ int MPIDI_CH3_PktHandler_Accumulate( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
MPIDI_msg_sz_t data_len;
MPID_Win *win_ptr;
int mpi_errno = MPI_SUCCESS;
- int type_size;
+ MPI_Aint type_size;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_ACCUMULATE);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_ACCUMULATE);
@@ -3841,7 +3843,8 @@ int MPIDI_CH3_PktHandler_Accumulate_Immed( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
/* Data is already present */
if (accum_pkt->op == MPI_REPLACE) {
/* no datatypes required */
- int len = accum_pkt->count * extent;
+ int len;
+ MPIU_Assign_trunc(len, (accum_pkt->count * extent), int);
/* FIXME: use immediate copy because this is short */
MPIUI_Memcpy( accum_pkt->addr, accum_pkt->data, len );
}
@@ -3899,7 +3902,7 @@ int MPIDI_CH3_PktHandler_CAS( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
MPIDI_CH3_Pkt_cas_t *cas_pkt = &pkt->cas;
MPID_Win *win_ptr;
MPID_Request *req;
- int len;
+ MPI_Aint len;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_CAS);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_CAS);
@@ -3977,7 +3980,7 @@ int MPIDI_CH3_PktHandler_CASResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
int mpi_errno = MPI_SUCCESS;
MPIDI_CH3_Pkt_cas_resp_t *cas_resp_pkt = &pkt->cas_resp;
MPID_Request *req;
- int len;
+ MPI_Aint len;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_CASRESP);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_CASRESP);
@@ -4012,7 +4015,8 @@ int MPIDI_CH3_PktHandler_FOP( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
MPIDI_CH3_Pkt_fop_t *fop_pkt = &pkt->fop;
MPID_Request *req;
MPID_Win *win_ptr;
- int len, data_complete = 0;
+ int data_complete = 0;
+ MPI_Aint len;
MPIU_CHKPMEM_DECL(1);
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_FOP);
@@ -4104,7 +4108,8 @@ int MPIDI_CH3_PktHandler_FOPResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
int mpi_errno = MPI_SUCCESS;
MPIDI_CH3_Pkt_fop_resp_t *fop_resp_pkt = &pkt->fop_resp;
MPID_Request *req;
- int len, complete = 0;
+ int complete = 0;
+ MPI_Aint len;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_FOPRESP);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_FOPRESP);
@@ -4167,7 +4172,7 @@ int MPIDI_CH3_PktHandler_Get_AccumResp( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
char *data_buf = NULL;
MPIDI_msg_sz_t data_len;
int mpi_errno = MPI_SUCCESS;
- int type_size;
+ MPI_Aint type_size;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_GET_ACCUM_RESP);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GET_ACCUM_RESP);
@@ -4295,7 +4300,7 @@ int MPIDI_CH3_PktHandler_LockPutUnlock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
&pkt->lock_put_unlock;
MPID_Win *win_ptr = NULL;
MPID_Request *req = NULL;
- int type_size;
+ MPI_Aint type_size;
int complete;
char *data_buf = NULL;
MPIDI_msg_sz_t data_len;
@@ -4442,7 +4447,7 @@ int MPIDI_CH3_PktHandler_LockGetUnlock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
MPIDI_CH3_Pkt_lock_get_unlock_t * lock_get_unlock_pkt =
&pkt->lock_get_unlock;
MPID_Win *win_ptr = NULL;
- int type_size;
+ MPI_Aint type_size;
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKGETUNLOCK);
@@ -4561,7 +4566,7 @@ int MPIDI_CH3_PktHandler_LockAccumUnlock( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
MPID_Request *req = NULL;
MPID_Win *win_ptr = NULL;
MPIDI_Win_lock_queue *curr_ptr = NULL, *prev_ptr = NULL, *new_ptr = NULL;
- int type_size;
+ MPI_Aint type_size;
int complete;
char *data_buf = NULL;
MPIDI_msg_sz_t data_len;
@@ -4695,7 +4700,7 @@ int MPIDI_CH3_PktHandler_GetResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
char *data_buf = NULL;
MPIDI_msg_sz_t data_len;
int mpi_errno = MPI_SUCCESS;
- int type_size;
+ MPI_Aint type_size;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_GETRESP);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_GETRESP);
diff --git a/src/mpid/ch3/src/mpid_vc.c b/src/mpid/ch3/src/mpid_vc.c
index 73b4796..5640966 100644
--- a/src/mpid/ch3/src/mpid_vc.c
+++ b/src/mpid/ch3/src/mpid_vc.c
@@ -919,7 +919,7 @@ static int parse_mapping(char *map_str, mapping_type_t *type, map_block_t **map,
if (!isdigit(*c))
parse_error();
- (*map)[i].start_id = strtol(c, &c, 0);
+ (*map)[i].start_id = (int)strtol(c, &c, 0);
skip_space(c);
expect_and_skip_c(c, ',');
@@ -927,7 +927,7 @@ static int parse_mapping(char *map_str, mapping_type_t *type, map_block_t **map,
if (!isdigit(*c))
parse_error();
- (*map)[i].count = strtol(c, &c, 0);
+ (*map)[i].count = (int)strtol(c, &c, 0);
skip_space(c);
expect_and_skip_c(c, ',');
@@ -935,7 +935,7 @@ static int parse_mapping(char *map_str, mapping_type_t *type, map_block_t **map,
if (!isdigit(*c))
parse_error();
- (*map)[i].size = strtol(c, &c, 0);
+ (*map)[i].size = (int)strtol(c, &c, 0);
expect_and_skip_c(c, ')');
skip_space(c);
diff --git a/src/mpid/ch3/src/mpidi_isend_self.c b/src/mpid/ch3/src/mpidi_isend_self.c
index 9460c8e..0658630 100644
--- a/src/mpid/ch3/src/mpidi_isend_self.c
+++ b/src/mpid/ch3/src/mpidi_isend_self.c
@@ -85,7 +85,7 @@ int MPIDI_Isend_self(const void * buf, int count, MPI_Datatype datatype, int ran
{
if (type != MPIDI_REQUEST_TYPE_RSEND)
{
- int dt_sz;
+ MPI_Aint dt_sz;
/* FIXME: Insert code here to buffer small sends in a temporary buffer? */
diff --git a/src/mpid/common/datatype/dataloop/segment_packunpack.c b/src/mpid/common/datatype/dataloop/segment_packunpack.c
index 32c4689..7446b59 100644
--- a/src/mpid/common/datatype/dataloop/segment_packunpack.c
+++ b/src/mpid/common/datatype/dataloop/segment_packunpack.c
@@ -166,8 +166,8 @@ int PREPEND_PREFIX(Segment_vector_m2m)(DLOOP_Offset *blocks_p,
cbufp = (char*) paramp->userbuf + rel_off;
DLOOP_Handle_get_size_macro(el_type, el_size);
- whole_count = (blksz > 0) ? (*blocks_p / (DLOOP_Offset) blksz) : 0;
- blocks_left = (blksz > 0) ? (*blocks_p % (DLOOP_Offset) blksz) : 0;
+ whole_count = (DLOOP_Count)((blksz > 0) ? (*blocks_p / (DLOOP_Offset) blksz) : 0);
+ blocks_left = (DLOOP_Count)((blksz > 0) ? (*blocks_p % (DLOOP_Offset) blksz) : 0);
if (paramp->direction == DLOOP_M2M_TO_USERBUF) {
if (el_size == 8
diff --git a/src/mpid/common/datatype/dataloop/veccpy.h b/src/mpid/common/datatype/dataloop/veccpy.h
index 687320c..7ee6592 100644
--- a/src/mpid/common/datatype/dataloop/veccpy.h
+++ b/src/mpid/common/datatype/dataloop/veccpy.h
@@ -57,23 +57,26 @@
register int k; \
register unsigned long _i, j; \
unsigned long total_count = count * nelms; \
- const DLOOP_Offset l_stride = stride; \
+ const DLOOP_Offset l_stride = stride; \
\
+ DLOOP_Assert(stride <= INT_MAX); \
+ DLOOP_Assert(total_count <= INT_MAX); \
+ DLOOP_Assert(nelms <= INT_MAX); \
if (nelms == 1) { \
- for (_i = total_count; _i; _i--) { \
+ for (_i = (int)total_count; _i; _i--) { \
*l_dest++ = *l_src; \
l_src += l_stride; \
} \
} \
else if (nelms == 2) { \
- for (_i = total_count; _i; _i -= 2) { \
+ for (_i = (int)total_count; _i; _i -= 2) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
l_src += l_stride; \
} \
} \
else if (nelms == 3) { \
- for (_i = total_count; _i; _i -= 3) { \
+ for (_i = (int)total_count; _i; _i -= 3) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
*l_dest++ = l_src[2]; \
@@ -81,7 +84,7 @@
} \
} \
else if (nelms == 4) { \
- for (_i = total_count; _i; _i -= 4) { \
+ for (_i = (int)total_count; _i; _i -= 4) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
*l_dest++ = l_src[2]; \
@@ -90,7 +93,7 @@
} \
} \
else if (nelms == 5) { \
- for (_i = total_count; _i; _i -= 5) { \
+ for (_i = (int)total_count; _i; _i -= 5) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
*l_dest++ = l_src[2]; \
@@ -100,7 +103,7 @@
} \
} \
else if (nelms == 6) { \
- for (_i = total_count; _i; _i -= 6) { \
+ for (_i = (int)total_count; _i; _i -= 6) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
*l_dest++ = l_src[2]; \
@@ -111,7 +114,7 @@
} \
} \
else if (nelms == 7) { \
- for (_i = total_count; _i; _i -= 7) { \
+ for (_i = (int)total_count; _i; _i -= 7) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
*l_dest++ = l_src[2]; \
@@ -123,7 +126,7 @@
} \
} \
else if (nelms == 8) { \
- for (_i = total_count; _i; _i -= 8) { \
+ for (_i = (int)total_count; _i; _i -= 8) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
*l_dest++ = l_src[2]; \
@@ -136,10 +139,10 @@
} \
} \
else { \
- _i = total_count; \
+ _i = (int)total_count; \
while (_i) { \
tmp_src = l_src; \
- j = nelms; \
+ j = (int)nelms; \
while (j >= 8) { \
*l_dest++ = tmp_src[0]; \
*l_dest++ = tmp_src[1]; \
@@ -171,21 +174,24 @@
register unsigned long _i, j, total_count = count * nelms; \
const DLOOP_Offset l_stride = stride; \
\
+ DLOOP_Assert(stride <= INT_MAX); \
+ DLOOP_Assert(total_count <= INT_MAX); \
+ DLOOP_Assert(nelms <= INT_MAX); \
if (nelms == 1) { \
- for (_i = total_count; _i; _i--) { \
+ for (_i = (int)total_count; _i; _i--) { \
*l_dest++ = *l_src; \
l_src = (type *) ((char *) l_src + l_stride); \
} \
} \
else if (nelms == 2) { \
- for (_i = total_count; _i; _i -= 2) { \
+ for (_i = (int)total_count; _i; _i -= 2) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
l_src = (type *) ((char *) l_src + l_stride); \
} \
} \
else if (nelms == 3) { \
- for (_i = total_count; _i; _i -= 3) { \
+ for (_i = (int)total_count; _i; _i -= 3) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
*l_dest++ = l_src[2]; \
@@ -193,7 +199,7 @@
} \
} \
else if (nelms == 4) { \
- for (_i = total_count; _i; _i -= 4) { \
+ for (_i = (int)total_count; _i; _i -= 4) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
*l_dest++ = l_src[2]; \
@@ -202,7 +208,7 @@
} \
} \
else if (nelms == 5) { \
- for (_i = total_count; _i; _i -= 5) { \
+ for (_i = (int)total_count; _i; _i -= 5) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
*l_dest++ = l_src[2]; \
@@ -212,7 +218,7 @@
} \
} \
else if (nelms == 6) { \
- for (_i = total_count; _i; _i -= 6) { \
+ for (_i = (int)total_count; _i; _i -= 6) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
*l_dest++ = l_src[2]; \
@@ -223,7 +229,7 @@
} \
} \
else if (nelms == 7) { \
- for (_i = total_count; _i; _i -= 7) { \
+ for (_i = (int)total_count; _i; _i -= 7) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
*l_dest++ = l_src[2]; \
@@ -235,7 +241,7 @@
} \
} \
else if (nelms == 8) { \
- for (_i = total_count; _i; _i -= 8) { \
+ for (_i = (int)total_count; _i; _i -= 8) { \
*l_dest++ = l_src[0]; \
*l_dest++ = l_src[1]; \
*l_dest++ = l_src[2]; \
@@ -248,10 +254,10 @@
} \
} \
else { \
- _i = total_count; \
+ _i = (int)total_count; \
while (_i) { \
tmp_src = l_src; \
- j = nelms; \
+ j = (int)nelms; \
while (j >= 8) { \
*l_dest++ = tmp_src[0]; \
*l_dest++ = tmp_src[1]; \
@@ -284,21 +290,24 @@
unsigned long total_count = count * nelms; \
const DLOOP_Offset l_stride = stride; \
\
+ DLOOP_Assert(stride <= INT_MAX); \
+ DLOOP_Assert(total_count <= INT_MAX); \
+ DLOOP_Assert(nelms <= INT_MAX); \
if (nelms == 1) { \
- for (_i = total_count; _i; _i--) { \
+ for (_i = (int)total_count; _i; _i--) { \
*l_dest = *l_src++; \
l_dest += l_stride; \
} \
} \
else if (nelms == 2) { \
- for (_i = total_count; _i; _i -= 2) { \
+ for (_i = (int)total_count; _i; _i -= 2) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest += l_stride; \
} \
} \
else if (nelms == 3) { \
- for (_i = total_count; _i; _i -= 3) { \
+ for (_i = (int)total_count; _i; _i -= 3) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest[2] = *l_src++; \
@@ -306,7 +315,7 @@
} \
} \
else if (nelms == 4) { \
- for (_i = total_count; _i; _i -= 4) { \
+ for (_i = (int)total_count; _i; _i -= 4) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest[2] = *l_src++; \
@@ -315,7 +324,7 @@
} \
} \
else if (nelms == 5) { \
- for (_i = total_count; _i; _i -= 5) { \
+ for (_i = (int)total_count; _i; _i -= 5) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest[2] = *l_src++; \
@@ -325,7 +334,7 @@
} \
} \
else if (nelms == 6) { \
- for (_i = total_count; _i; _i -= 6) { \
+ for (_i = (int)total_count; _i; _i -= 6) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest[2] = *l_src++; \
@@ -336,7 +345,7 @@
} \
} \
else if (nelms == 7) { \
- for (_i = total_count; _i; _i -= 7) { \
+ for (_i = (int)total_count; _i; _i -= 7) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest[2] = *l_src++; \
@@ -348,7 +357,7 @@
} \
} \
else if (nelms == 8) { \
- for (_i = total_count; _i; _i -= 8) { \
+ for (_i = (int)total_count; _i; _i -= 8) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest[2] = *l_src++; \
@@ -361,10 +370,10 @@
} \
} \
else { \
- _i = total_count; \
+ _i = (int)total_count; \
while (_i) { \
tmp_dest = l_dest; \
- j = nelms; \
+ j = (int)nelms; \
while (j >= 8) { \
tmp_dest[0] = *l_src++; \
tmp_dest[1] = *l_src++; \
@@ -395,23 +404,26 @@
register int k; \
register unsigned long _i, j; \
unsigned long total_count = count * nelms; \
- const DLOOP_Offset l_stride = stride; \
+ const DLOOP_Offset l_stride = stride; \
\
+ DLOOP_Assert(stride <= INT_MAX); \
+ DLOOP_Assert(total_count <= INT_MAX); \
+ DLOOP_Assert(nelms <= INT_MAX); \
if (nelms == 1) { \
- for (_i = total_count; _i; _i--) { \
+ for (_i = (int)total_count; _i; _i--) { \
*l_dest = *l_src++; \
l_dest = (type *) ((char *) l_dest + l_stride); \
} \
} \
else if (nelms == 2) { \
- for (_i = total_count; _i; _i -= 2) { \
+ for (_i = (int)total_count; _i; _i -= 2) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest = (type *) ((char *) l_dest + l_stride); \
} \
} \
else if (nelms == 3) { \
- for (_i = total_count; _i; _i -= 3) { \
+ for (_i = (int)total_count; _i; _i -= 3) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest[2] = *l_src++; \
@@ -419,7 +431,7 @@
} \
} \
else if (nelms == 4) { \
- for (_i = total_count; _i; _i -= 4) { \
+ for (_i = (int)total_count; _i; _i -= 4) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest[2] = *l_src++; \
@@ -428,7 +440,7 @@
} \
} \
else if (nelms == 5) { \
- for (_i = total_count; _i; _i -= 5) { \
+ for (_i = (int)total_count; _i; _i -= 5) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest[2] = *l_src++; \
@@ -438,7 +450,7 @@
} \
} \
else if (nelms == 6) { \
- for (_i = total_count; _i; _i -= 6) { \
+ for (_i = (int)total_count; _i; _i -= 6) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest[2] = *l_src++; \
@@ -449,7 +461,7 @@
} \
} \
else if (nelms == 7) { \
- for (_i = total_count; _i; _i -= 7) { \
+ for (_i = (int)total_count; _i; _i -= 7) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest[2] = *l_src++; \
@@ -461,7 +473,7 @@
} \
} \
else if (nelms == 8) { \
- for (_i = total_count; _i; _i -= 8) { \
+ for (_i = (int)total_count; _i; _i -= 8) { \
l_dest[0] = *l_src++; \
l_dest[1] = *l_src++; \
l_dest[2] = *l_src++; \
@@ -474,10 +486,10 @@
} \
} \
else { \
- _i = total_count; \
+ _i = (int)total_count; \
while (_i) { \
tmp_dest = l_dest; \
- j = nelms; \
+ j = (int)nelms; \
while (j >= 8) { \
tmp_dest[0] = *l_src++; \
tmp_dest[1] = *l_src++; \
diff --git a/src/mpid/common/datatype/mpid_datatype.h b/src/mpid/common/datatype/mpid_datatype.h
index 22041b2..84ad551 100644
--- a/src/mpid/common/datatype/mpid_datatype.h
+++ b/src/mpid/common/datatype/mpid_datatype.h
@@ -358,7 +358,7 @@ typedef struct MPID_Datatype {
MPIU_OBJECT_HEADER; /* adds handle and ref_count fields */
/* basic parameters for datatype, accessible via MPI calls */
- int size;
+ MPI_Aint size;
MPI_Aint extent, ub, lb, true_ub, true_lb;
/* chars affecting subsequent datatype processing and creation */
diff --git a/src/mpid/common/datatype/mpid_type_indexed.c b/src/mpid/common/datatype/mpid_type_indexed.c
index 48d4642..0e3e259 100644
--- a/src/mpid/common/datatype/mpid_type_indexed.c
+++ b/src/mpid/common/datatype/mpid_type_indexed.c
@@ -41,7 +41,8 @@ int MPID_Type_indexed(int count,
int mpi_errno = MPI_SUCCESS;
int is_builtin, old_is_contig;
int i, contig_count;
- int el_sz, el_ct, old_ct, old_sz;
+ int el_ct, old_ct;
+ MPI_Aint el_sz, old_sz;
MPI_Aint old_lb, old_ub, old_extent, old_true_lb, old_true_ub;
MPI_Aint min_lb = 0, max_ub = 0, eff_disp;
MPI_Datatype el_type;
@@ -109,8 +110,8 @@ int MPID_Type_indexed(int count,
new_dtp->has_sticky_ub = 0;
new_dtp->has_sticky_lb = 0;
- new_dtp->alignsize = el_sz; /* ??? */
- new_dtp->element_size = (MPI_Aint) el_sz;
+ MPIU_Assign_trunc(new_dtp->alignsize, el_sz, int);
+ new_dtp->element_size = el_sz;
new_dtp->eltype = el_type;
new_dtp->max_contig_blocks = count;
diff --git a/src/mpid/common/sched/mpid_sched.c b/src/mpid/common/sched/mpid_sched.c
index a07e8e1..d44412a 100644
--- a/src/mpid/common/sched/mpid_sched.c
+++ b/src/mpid/common/sched/mpid_sched.c
@@ -122,7 +122,7 @@ fn_fail:
/* initiates the schedule entry "e" in the NBC described by "s", where
* "e" is at "idx" in "s". This means posting nonblocking sends/recvs,
* performing reductions, calling callbacks, etc. */
-static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, int idx, struct MPIDU_Sched_entry *e)
+static int MPIDU_Sched_start_entry(struct MPIDU_Sched *s, size_t idx, struct MPIDU_Sched_entry *e)
{
int mpi_errno = MPI_SUCCESS;
int context_offset;
@@ -237,7 +237,7 @@ fn_fail:
static int MPIDU_Sched_continue(struct MPIDU_Sched *s)
{
int mpi_errno = MPI_SUCCESS;
- int i;
+ size_t i;
for (i = s->idx; i < s->num_entries; ++i) {
struct MPIDU_Sched_entry *e = &s->entries[i];
@@ -680,12 +680,12 @@ int MPID_Sched_copy(const void *inbuf, int incount, MPI_Datatype intype,
/* some sanity checking up front */
#if defined(HAVE_ERROR_CHECKING) && !defined(NDEBUG)
{
- int intype_size, outtype_size;
+ MPI_Aint intype_size, outtype_size;
MPID_Datatype_get_size_macro(intype, intype_size);
MPID_Datatype_get_size_macro(outtype, outtype_size);
if (incount * intype_size > outcount * outtype_size) {
- MPIU_Error_printf("truncation: intype=%#x, intype_size=%d, incount=%d, outtype=%#x, outtype_size=%d outcount=%d\n",
- intype, intype_size, incount, outtype, outtype_size, outcount);
+ MPIU_Error_printf("truncation: intype=%#x, intype_size=%lld, incount=%d, outtype=%#x, outtype_size=%lld outcount=%d\n",
+ intype, (long long)intype_size, incount, outtype, (long long)outtype_size, outcount);
}
}
#endif
@@ -787,7 +787,7 @@ fn_fail:
static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made_progress)
{
int mpi_errno = MPI_SUCCESS;
- int i;
+ size_t i;
struct MPIDU_Sched *s;
struct MPIDU_Sched *tmp;
diff --git a/src/util/dbg/dbg_printf.c b/src/util/dbg/dbg_printf.c
index 0810ca0..dc674ee 100644
--- a/src/util/dbg/dbg_printf.c
+++ b/src/util/dbg/dbg_printf.c
@@ -625,7 +625,7 @@ static int MPIU_DBG_ProcessArgs( int *argc_p, char ***argv_p )
if (*p == '=' && p[1] != 0) {
char *sOut;
p++;
- whichRank = strtol( p, &sOut, 10 );
+ whichRank = (int)strtol( p, &sOut, 10 );
if (p == sOut) {
MPIU_DBG_Usage( "-mpich-dbg-rank", 0 );
whichRank = -1;
@@ -678,7 +678,7 @@ static int MPIU_DBG_ProcessEnv( void )
s = getenv( "MPICH_DBG_RANK" );
if (s) {
char *sOut;
- whichRank = strtol( s, &sOut, 10 );
+ whichRank = (int)strtol( s, &sOut, 10 );
if (s == sOut) {
MPIU_DBG_Usage( "MPICH_DBG_RANK", 0 );
whichRank = -1;
@@ -1129,17 +1129,17 @@ static int MPIU_DBG_OpenFile(FILE **dbg_fp)
static int setDBGClass( const char *s )
{
int i;
- int slen = 0;
- int len = 0;
-
+ size_t slen = 0;
+ size_t len = 0;
+
if (s && *s) slen = strlen(s);
while (s && *s) {
for (i=0; MPIU_Classnames[i].LCName; i++) {
/* The LCLen and UCLen *should* be the same, but
just in case, we separate them */
- int LClen = strlen(MPIU_Classnames[i].LCName);
- int UClen = strlen(MPIU_Classnames[i].UCName);
+ size_t LClen = strlen(MPIU_Classnames[i].LCName);
+ size_t UClen = strlen(MPIU_Classnames[i].UCName);
int matchClass = 0;
/* Allow the upper case and lower case in all cases */
diff --git a/src/util/instrm/instr.c b/src/util/instrm/instr.c
index cf94ed4..340cc3a 100644
--- a/src/util/instrm/instr.c
+++ b/src/util/instrm/instr.c
@@ -116,7 +116,7 @@ int MPIU_INSTR_ToStr_Duration_Count( char *buf, size_t maxBuf, void *ptr )
snprintf( buf, maxBuf, "%-40s:\t%d\t%e", dPtr->desc, dPtr->count, ttime );
if (dPtr->nitems) {
char *p;
- int len = strlen(buf);
+ size_t len = strlen(buf);
int i;
/* Add each integer value, separated by a tab. */
maxBuf -= len;
diff --git a/src/util/wrappers/mpiu_shm_wrappers.h b/src/util/wrappers/mpiu_shm_wrappers.h
index 5e6335b..0e132c0 100644
--- a/src/util/wrappers/mpiu_shm_wrappers.h
+++ b/src/util/wrappers/mpiu_shm_wrappers.h
@@ -301,7 +301,7 @@ fn_fail:
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
static inline int MPIU_SHMW_Hnd_deserialize(
- MPIU_SHMW_Hnd_t hnd, const char *str_hnd, int str_hnd_len)
+ MPIU_SHMW_Hnd_t hnd, const char *str_hnd, size_t str_hnd_len)
{
int mpi_errno = MPI_SUCCESS;
int rc = -1;
@@ -615,7 +615,7 @@ static inline int MPIU_SHMW_Seg_create_attach_templ(
MPI_ERR_OTHER, "**lseek", "**lseek %s",
MPIU_OSW_Strerror(MPIU_OSW_Get_errno()));
- MPIU_OSW_RETRYON_INTR((rc == -1), (rc = write(lhnd, "", 1)));
+ MPIU_OSW_RETRYON_INTR((rc == -1), (rc = (int)write(lhnd, "", 1)));
MPIU_ERR_CHKANDJUMP((rc == -1), mpi_errno, MPI_ERR_OTHER,
"**write");
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 48 +++++-----
src/include/mpibsend.h | 2 +-
src/include/mpierrs.h | 2 +-
src/include/mpiimpl.h | 6 +-
src/include/mpiutil.h | 37 +++++---
src/mpi/coll/allred_group.c | 2 +-
src/mpi/coll/allreduce.c | 3 +-
src/mpi/coll/alltoall.c | 3 +-
src/mpi/coll/bcast.c | 26 +++---
src/mpi/coll/helper_fns.c | 4 +-
src/mpi/coll/ibcast.c | 10 ++-
src/mpi/datatype/pack.c | 9 ++-
src/mpi/datatype/pack_size.c | 10 ++-
src/mpi/datatype/type_match_size.c | 3 +-
src/mpi/datatype/unpack.c | 7 +-
src/mpi/pt2pt/bsendutil.c | 7 +-
src/mpi/pt2pt/sendrecv_rep.c | 4 +-
src/mpi/romio/adio/ad_bg/ad_bg.h | 2 +-
src/mpi/romio/adio/ad_bg/ad_bg_getsh.c | 2 +-
src/mpi/romio/adio/ad_bgl/ad_bgl.h | 2 +-
src/mpi/romio/adio/ad_bgl/ad_bgl_getsh.c | 2 +-
src/mpi/romio/adio/ad_nfs/ad_nfs.h | 2 +-
src/mpi/romio/adio/ad_nfs/ad_nfs_getsh.c | 4 +-
src/mpi/romio/adio/ad_nfs/ad_nfs_setsh.c | 2 +-
src/mpi/romio/adio/ad_testfs/ad_testfs_seek.c | 4 +-
src/mpi/romio/adio/common/ad_coll_exch_new.c | 6 +-
src/mpi/romio/adio/common/ad_fstype.c | 2 +-
src/mpi/romio/adio/common/ad_get_sh_fp.c | 4 +-
src/mpi/romio/adio/common/ad_io_coll.c | 4 +-
src/mpi/romio/adio/common/ad_iwrite.c | 7 +-
src/mpi/romio/adio/common/ad_prealloc.c | 10 +-
src/mpi/romio/adio/common/ad_read.c | 6 +-
src/mpi/romio/adio/common/ad_read_coll.c | 10 +-
src/mpi/romio/adio/common/ad_read_str.c | 6 +-
src/mpi/romio/adio/common/ad_read_str_naive.c | 2 +-
src/mpi/romio/adio/common/ad_set_view.c | 2 +-
src/mpi/romio/adio/common/ad_write.c | 4 +-
src/mpi/romio/adio/common/ad_write_coll.c | 9 ++-
src/mpi/romio/adio/common/ad_write_nolock.c | 9 +-
src/mpi/romio/adio/common/ad_write_str.c | 19 +++--
src/mpi/romio/adio/common/ad_write_str_naive.c | 8 +-
src/mpi/romio/adio/common/byte_offset.c | 4 +-
src/mpi/romio/adio/common/cb_config_list.c | 2 +-
src/mpi/romio/adio/common/eof_offset.c | 4 +-
src/mpi/romio/adio/common/flatten.c | 59 ++++++-------
src/mpi/romio/adio/common/get_fp_posn.c | 6 +-
src/mpi/romio/adio/common/hint_fns.c | 3 +-
src/mpi/romio/adio/common/shfp_fname.c | 6 +-
src/mpi/romio/adio/common/status_setb.c | 6 +-
src/mpi/romio/adio/common/system_hints.c | 3 +-
src/mpi/romio/adio/include/adio.h | 4 +-
src/mpi/romio/adio/include/adioi.h | 8 +-
src/mpi/romio/adio/include/adioi_error.h | 2 +-
src/mpi/romio/mpi-io/iread.c | 8 +-
src/mpi/romio/mpi-io/iread_sh.c | 7 +-
src/mpi/romio/mpi-io/iwrite.c | 8 +-
src/mpi/romio/mpi-io/iwrite_sh.c | 7 +-
src/mpi/romio/mpi-io/read.c | 8 +-
src/mpi/romio/mpi-io/read_all.c | 5 +-
src/mpi/romio/mpi-io/read_allb.c | 5 +-
src/mpi/romio/mpi-io/read_ord.c | 6 +-
src/mpi/romio/mpi-io/read_ordb.c | 7 +-
src/mpi/romio/mpi-io/read_sh.c | 8 +-
src/mpi/romio/mpi-io/set_view.c | 7 +-
src/mpi/romio/mpi-io/write.c | 8 +-
src/mpi/romio/mpi-io/write_all.c | 5 +-
src/mpi/romio/mpi-io/write_allb.c | 5 +-
src/mpi/romio/mpi-io/write_ord.c | 6 +-
src/mpi/romio/mpi-io/write_ordb.c | 6 +-
src/mpi/romio/mpi-io/write_sh.c | 7 +-
src/mpi_t/mpit.c | 2 +-
.../channels/nemesis/include/mpid_nem_datatypes.h | 14 +--
.../ch3/channels/nemesis/include/mpid_nem_inline.h | 4 +-
.../channels/nemesis/include/mpid_nem_pkt_header.h | 25 +++++
src/mpid/ch3/channels/nemesis/netmod/mx/mx_poll.c | 2 +-
.../channels/nemesis/netmod/newmad/newmad_poll.c | 2 +-
src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c | 27 ++++--
src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.h | 2 +-
.../ch3/channels/nemesis/netmod/tcp/tcp_utility.c | 3 +-
src/mpid/ch3/channels/nemesis/src/ch3_isend.c | 3 +-
src/mpid/ch3/channels/nemesis/src/ch3_istartmsg.c | 3 +-
src/mpid/ch3/channels/nemesis/src/ch3_progress.c | 4 +-
src/mpid/ch3/channels/nemesis/src/ch3_win_fns.c | 2 +-
src/mpid/ch3/channels/nemesis/src/mpid_nem_debug.c | 2 +-
src/mpid/ch3/channels/nemesis/src/mpid_nem_init.c | 2 +-
.../ch3/channels/nemesis/src/mpid_nem_lmt_shm.c | 2 +-
src/mpid/ch3/channels/nemesis/subconfigure.m4 | 17 ++++
src/mpid/ch3/include/mpidpre.h | 2 +-
src/mpid/ch3/include/mpidrma.h | 13 ++-
src/mpid/ch3/src/ch3u_buffer.c | 2 +-
src/mpid/ch3/src/ch3u_eager.c | 2 +-
src/mpid/ch3/src/ch3u_handle_connection.c | 2 +-
src/mpid/ch3/src/ch3u_handle_recv_pkt.c | 2 +-
src/mpid/ch3/src/ch3u_handle_recv_req.c | 13 ++-
src/mpid/ch3/src/ch3u_request.c | 14 ++--
src/mpid/ch3/src/ch3u_rma_sync.c | 47 ++++++-----
src/mpid/ch3/src/mpid_vc.c | 6 +-
src/mpid/ch3/src/mpidi_isend_self.c | 4 +-
src/mpid/common/datatype/Makefile.mk | 3 +-
src/mpid/common/datatype/dataloop/dataloop.c | 34 ++++----
.../common/datatype/dataloop/dataloop_create.c | 22 ++++--
.../common/datatype/dataloop/dataloop_create.h | 35 ++++----
.../dataloop/dataloop_create_blockindexed.c | 13 ++--
.../datatype/dataloop/dataloop_create_contig.c | 11 ++-
.../datatype/dataloop/dataloop_create_indexed.c | 24 +++---
.../datatype/dataloop/dataloop_create_pairtype.c | 2 +-
.../datatype/dataloop/dataloop_create_struct.c | 56 +++++++-----
.../datatype/dataloop/dataloop_create_vector.c | 14 ++--
src/mpid/common/datatype/dataloop/dataloop_parts.h | 22 +++--
src/mpid/common/datatype/dataloop/segment.c | 4 +-
.../common/datatype/dataloop/segment_flatten.c | 39 +++++----
.../common/datatype/dataloop/segment_packunpack.c | 4 +-
src/mpid/common/datatype/dataloop/veccpy.h | 96 +++++++++++---------
src/mpid/common/datatype/mpid_dataloop.h | 3 +-
src/mpid/common/datatype/mpid_datatype.h | 42 +++++----
src/mpid/common/datatype/mpid_segment.c | 31 ++++---
src/mpid/common/datatype/mpid_type_blockindexed.c | 3 +-
src/mpid/common/datatype/mpid_type_contiguous.c | 2 +-
.../common/datatype/mpid_type_create_resized.c | 2 +
src/mpid/common/datatype/mpid_type_debug.c | 6 +-
src/mpid/common/datatype/mpid_type_indexed.c | 15 ++-
src/mpid/common/datatype/mpid_type_struct.c | 9 +-
src/mpid/common/datatype/mpir_type_flatten.c | 2 +-
.../common/datatype/mpir_type_get_contig_blocks.c | 41 ---------
src/mpid/common/sched/mpid_sched.c | 12 ++--
src/mpl/src/mplstr.c | 6 +-
src/pm/hydra/ui/mpich/utils.c | 7 +-
src/util/dbg/dbg_printf.c | 14 ++--
src/util/instrm/instr.c | 2 +-
src/util/wrappers/mpiu_shm_wrappers.h | 4 +-
130 files changed, 730 insertions(+), 604 deletions(-)
create mode 100644 src/mpid/ch3/channels/nemesis/include/mpid_nem_pkt_header.h
delete mode 100644 src/mpid/common/datatype/mpir_type_get_contig_blocks.c
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1b1-148-g4f691ba
by noreply@mpich.org 29 Oct '13
by noreply@mpich.org 29 Oct '13
29 Oct '13
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 4f691ba86f15151b51ec808943a2b940887c5e22 (commit)
via cf03be909bc5067634adc0b64b3ce7b53d42e629 (commit)
from 0489e27f0dd49aa48662af99fa7c651cb23a5c87 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/4f691ba86f15151b51ec808943a2b9408…
commit 4f691ba86f15151b51ec808943a2b940887c5e22
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Tue Oct 29 20:18:05 2013 -0500
Updated git link.
No reviewer.
diff --git a/CHANGES b/CHANGES
index 3dce3f9..d6c8a61 100644
--- a/CHANGES
+++ b/CHANGES
@@ -38,7 +38,7 @@
A full list of changes is available at the following link:
- http://git.mpich.org/mpich.git/shortlog/v3.0.4..v3.1b2
+ http://git.mpich.org/mpich.git/shortlog/v3.0.4..v3.1rc1
A full list of bugs that have been fixed is available at the
following link:
http://git.mpich.org/mpich.git/commitdiff/cf03be909bc5067634adc0b64b3ce7b53…
commit cf03be909bc5067634adc0b64b3ce7b53d42e629
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Tue Oct 29 20:17:34 2013 -0500
Added MPICH ABI information to CHANGES.
No reviewer.
diff --git a/CHANGES b/CHANGES
index 2aff5eb..3dce3f9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,11 @@
Changes in 3.1
===============================================================================
+ # MPICH ABI Consortium: Starting this release, MPICH is ABI
+ compatible with several MPICH derivatives including Intel MPI, IBM
+ MPI and Cray MPI (supported only on select platform/compiler
+ combinations).
+
# Integrated MPICH-PAMI code base for Blue Gene/Q and other IBM
platforms.
-----------------------------------------------------------------------
Summary of changes:
CHANGES | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1b1-146-g0489e27
by noreply@mpich.org 29 Oct '13
by noreply@mpich.org 29 Oct '13
29 Oct '13
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 0489e27f0dd49aa48662af99fa7c651cb23a5c87 (commit)
via 6814cb866308a6919b4699a9fdc6ad8e5a18d501 (commit)
via 66865358993027ea794e0aeadc40dbc1bf016cc5 (commit)
via 27d2a8295e2c27a4a7a7bcb55bc28b4d8fe94d9a (commit)
via 4b516e886aa3aa51379e0c3806c911c9333c2cc3 (commit)
via a214d50071c2b53b077f865922f2d9bf6ce6f89e (commit)
via fc20de53bea92d4997439c807acf3ca7f31d09f7 (commit)
via db07b81b46f186ab353482e9208dc4e5c4be05c0 (commit)
via 098844117410cecab7d9a1c2e6295541076c7376 (commit)
via 5f8c172b612112266264c8444a12ceea62393d31 (commit)
via 756f1cd656ebe029e819c9abf67c0b53fe960336 (commit)
via da9e5e5a428535b39dff43fcf9d431f0d2bd4ab1 (commit)
from 88580cc2ca27e3bc43774f4243d5ee43189d49ff (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/0489e27f0dd49aa48662af99fa7c651cb…
commit 0489e27f0dd49aa48662af99fa7c651cb23a5c87
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sat Oct 26 22:33:31 2013 -0500
Fix to buildiface when Fint != int.
We were downgrading void * content to int and then upgrading it back
to an MPIR_Pint, losing bits in the process. This worked fine when
Fint was just 4 bytes, but not when Fint was 8 bytes.
Signed-off-by: William Gropp <wgropp(a)illinois.edu>
diff --git a/src/binding/f77/buildiface b/src/binding/f77/buildiface
index a353031..1b48294 100755
--- a/src/binding/f77/buildiface
+++ b/src/binding/f77/buildiface
@@ -2386,7 +2386,7 @@ sub addrint_in_decl {
}
sub addrint_in_arg {
my $count = $_[0];
- print $OUTFD "(void *)(MPIR_Pint)((int)*(int *)v$count)";
+ print $OUTFD "(void *)(*(MPIR_Pint *)v$count)";
}
sub attrint_ctof {
http://git.mpich.org/mpich.git/commitdiff/6814cb866308a6919b4699a9fdc6ad8e5…
commit 6814cb866308a6919b4699a9fdc6ad8e5a18d501
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sat Oct 26 15:19:12 2013 -0500
Bug fix for MPI_WEIGHTS_EMPTY.
When freeing arrays, we were not checking for the case where the array
might be set to MPI_WEIGHTS_EMPTY.
Signed-off-by: William Gropp <wgropp(a)illinois.edu>
diff --git a/src/binding/f77/buildiface b/src/binding/f77/buildiface
index a3cb65c..a353031 100755
--- a/src/binding/f77/buildiface
+++ b/src/binding/f77/buildiface
@@ -1841,7 +1841,7 @@ sub unweighted_in_ftoc {
for (li=0; li<$Array_size; li++) l$count\[li\] = (int)v$count\[li\];
}
EOT
- $clean_up .= " if (l$count != MPI_UNWEIGHTED) {$free(l$count);}\n";
+ $clean_up .= " if (l$count != MPI_UNWEIGHTED && l$count != MPI_WEIGHTS_EMPTY) {$free(l$count);}\n";
}
else {
print $OUTFD " if (v$count == MPIR_F_MPI_UNWEIGHTED) v$count = MPI_UNWEIGHTED;\n";
http://git.mpich.org/mpich.git/commitdiff/66865358993027ea794e0aeadc40dbc1b…
commit 66865358993027ea794e0aeadc40dbc1bf016cc5
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Thu Oct 24 22:16:53 2013 -0500
Remove bogus checks for MPIF_STATUS size.
When MPI_Count was added to the status field, a bunch of bogus checks
got added into configure and MPI_Init. This patch cleans up these
checks.
Signed-off-by: William Gropp <wgropp(a)illinois.edu>
diff --git a/configure.ac b/configure.ac
index 1a050da..5d7bf15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5812,22 +5812,10 @@ AC_SUBST([SIZEOF_MPI_STATUS])
if test "$enable_f77" = yes -a -z "$MPI_STATUS_SIZE" ; then
if test -n "$SIZEOF_MPI_STATUS" ; then
# compute from the C sizeof
- # Note that these *must* use the size of a Fortran INTEGER,
- # not a C int - as those two types might not be the same size.
- if test -z "$pac_cv_f77_sizeof_integer" ; then
- AC_MSG_ERROR([Sizeof Fortran INTEGER (MPI_Fint) is not available])
- fi
- AS_VAR_ARITH([MPI_STATUS_SIZE],[$SIZEOF_MPI_STATUS / $pac_cv_f77_sizeof_integer])
+ AS_VAR_ARITH([MPI_STATUS_SIZE],[$SIZEOF_MPI_STATUS / $ac_cv_sizeof_int])
if test "$MPI_STATUS_SIZE" = "0" ; then
AC_MSG_ERROR([Could not compute the size of MPI_Status])
fi
-
- # sanity: otherwise we have a problem in Fortran where we must implement
- # MPI_STATUS as an array of INTEGERs with MPI_STATUS_SIZE elements
- AS_VAR_ARITH([status_int_rem],[$SIZEOF_MPI_STATUS '%' $ac_cv_sizeof_int])
- AS_IF([test "$status_int_rem" -gt 0],
- [AC_MSG_ERROR([status size does not divide evenly by the integer size])])
- AS_UNSET([status_int_rem])
else
AC_MSG_ERROR([MPI_STATUS_SIZE was not defined!])
fi
diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index cd9f159..74a0033 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -439,11 +439,6 @@ int MPIR_Init_thread(int * argc, char ***argv, int required, int * provided)
/* Assert: tag_ub is at least the minimum asked for in the MPI spec */
MPIU_Assert( MPIR_Process.attrs.tag_ub >= 32767 );
- /* very nasty bugs will occur if this does not hold */
-#if defined(HAVE_FORTRAN_BINDING)
- MPIU_Assert(sizeof(MPI_Status) == MPIF_STATUS_SIZE*sizeof(MPI_Fint));
-#endif
-
/* Capture the level of thread support provided */
MPIR_ThreadInfo.thread_provided = thread_provided;
if (provided) *provided = thread_provided;
http://git.mpich.org/mpich.git/commitdiff/27d2a8295e2c27a4a7a7bcb55bc28b4d8…
commit 27d2a8295e2c27a4a7a7bcb55bc28b4d8fe94d9a
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun Oct 13 14:23:38 2013 -0500
Fortran updates for MPI_Status.
An initial version of this patch was provided by Intel.
Signed-off-by: William Gropp <wgropp(a)illinois.edu>
diff --git a/src/binding/f77/buildiface b/src/binding/f77/buildiface
index f1e9b50..a3cb65c 100755
--- a/src/binding/f77/buildiface
+++ b/src/binding/f77/buildiface
@@ -2503,7 +2503,7 @@ sub status_out_fnulltoc {
if ($within_fint) {
print $OUTFD "\
if (v$count == MPI_F_STATUS_IGNORE) { l$count = MPI_STATUS_IGNORE; }
- else { l$count->MPI_ERROR = (int)(v$count\[2\]); }\n";
+ else { l$count->MPI_ERROR = (int)(v$count\[4\]); }\n";
}
else {
print $OUTFD "\
@@ -3775,7 +3775,7 @@ if ($write_mpif) {
# FIXME: The offsets for the status elements are hardwired. If they
# change in mpi.h.in, they need to change here as well.
print MPIFFD " INTEGER MPI_SOURCE, MPI_TAG, MPI_ERROR\n";
- print MPIFFD " PARAMETER (MPI_SOURCE=1,MPI_TAG=2,MPI_ERROR=3)\n";
+ print MPIFFD " PARAMETER (MPI_SOURCE=3,MPI_TAG=4,MPI_ERROR=5)\n";
print MPIFFD " INTEGER MPI_STATUS_SIZE\n";
print MPIFFD " PARAMETER (MPI_STATUS_SIZE=\@MPI_STATUS_SIZE\@)\n";
# Temporary until configure handles these. Define as arrays to keep
@@ -4582,11 +4582,11 @@ print $OUTFD "\
#ifdef HAVE_FINT_IS_INT
*c_status = *(MPI_Status *) f_status;
#else
- c_status->MPI_SOURCE = (int)f_status\[0\];
- c_status->MPI_TAG = (int)f_status\[1\];
- c_status->MPI_ERROR = (int)f_status\[2\];
- c_status->count = *(MPI_Count *)(f_status+3);
- c_status->cancelled = (int)f_status\[3+(sizeof(MPI_Count)+sizeof(MPI_Fint)-1)/sizeof(MPI_Fint)\];
+ c_status->count_lo = (int)f_status\[0\];
+ c_status->count_hi_and_cancelled = (int)f_status\[1\];
+ c_status->MPI_SOURCE = (int)f_status\[2\];
+ c_status->MPI_TAG = (int)f_status\[3\];
+ c_status->MPI_ERROR = (int)f_status\[4\];
/* no need to copy abi_slush_fund field */
#endif\n";
}
@@ -4656,11 +4656,11 @@ int MPI_Status_c2f( const MPI_Status *c_status, MPI_Fint *f_status )
#ifdef HAVE_FINT_IS_INT
*(MPI_Status *)f_status = *c_status;
#else
- f_status\[0\] = (MPI_Fint)c_status->MPI_SOURCE;
- f_status\[1\] = (MPI_Fint)c_status->MPI_TAG;
- f_status\[2\] = (MPI_Fint)c_status->MPI_ERROR;
- *(MPI_Count*)(f_status+3) = c_status->count;
- f_status\[3+(sizeof(MPI_Count)+sizeof(MPI_Fint)-1)/sizeof(MPI_Fint)\] = (MPI_Fint)c_status->cancelled;
+ f_status\[0\] = (MPI_Fint)c_status->count_lo;
+ f_status\[1\] = (MPI_Fint)c_status->count_hi_and_cancelled;
+ f_status\[2\] = (MPI_Fint)c_status->MPI_SOURCE;
+ f_status\[3\] = (MPI_Fint)c_status->MPI_TAG;
+ f_status\[4\] = (MPI_Fint)c_status->MPI_ERROR;
#endif\n";
}
else {
diff --git a/src/binding/f90/buildiface b/src/binding/f90/buildiface
index 038c6a4..8965956 100755
--- a/src/binding/f90/buildiface
+++ b/src/binding/f90/buildiface
@@ -650,11 +650,8 @@ print MPIFD <<EOT;
TYPE$BINDACCESS :: MPI_Status
$BINDDEF
INTEGER$PUBLICVAR :: MPI_SOURCE, MPI_TAG, MPI_ERROR
- \@FC_STATUS_PAD1\@
- INTEGER$PRIVATEVAR(KIND=MPI_COUNT_KIND) :: count
- INTEGER$PRIVATEVAR :: cancelled
- INTEGER$PRIVATEVAR(2) :: abi_slush_fund
- \@FC_STATUS_PAD2\@
+ INTEGER$PRIVATEVAR :: count_lo
+ INTEGER$PRIVATEVAR :: count_hi_and_cancelled
END TYPE MPI_Status
EOT
http://git.mpich.org/mpich.git/commitdiff/4b516e886aa3aa51379e0c3806c911c93…
commit 4b516e886aa3aa51379e0c3806c911c9333c2cc3
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun Sep 22 22:55:46 2013 -0500
MPI_Status updates for ABI.
Based on an Intel contributed patch. The idea is to use the bits from
the cancelled field to extend the count, rather than increasing the
count datatype itself.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
Fixes to the bit manipulation based on feedback from Artem Yalozo @
Intel.
Fixes to the naming convention based on feedback from Bill Gropp.
Signed-off-by: William Gropp <wgropp(a)illinois.edu>
diff --git a/configure.ac b/configure.ac
index 6d6af8e..1a050da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,8 +46,6 @@ dnl MPID_NO_PM - If yes, the device does not require any
dnl PM implementation.
dnl MPID_NO_PMI - If yes, the device does not require any
dnl PMI implementation.
-dnl EXTRA_STATUS_DECL - Any extra declarations that the device
-dnl needs added to the definition of MPI_Status.
dnl MPID_MAX_PROCESSOR_NAME - The maximum number of character in a processor
dnl name. If not set, 128 will be used.
dnl MPID_MAX_ERROR_STRING - The maximum number of character in an error
@@ -5777,8 +5775,6 @@ AC_SUBST([MPI_F77_COUNT])
#
# The size of MPI_Status is needed for the Fortran interface.
-# This is not quite right unless the device prereq macro, expanded above,
-# sets the EXTRA_STATUS_DECL that will be used in defining a status.
#
# WARNING!!! this is a spot where we duplicate code from mpi.h.in and it *must*
# be kept in sync in order to make a proper computation
@@ -5789,13 +5785,11 @@ dnl the array subscripting below
rm -f pac_mpi_status.h
cat > pac_mpi_status.h <<_EOF
typedef struct {
+ int count_lo;
+ int count_hi_and_cancelled;
int MPI_SOURCE;
int MPI_TAG;
int MPI_ERROR;
- $MPI_COUNT count;
- int cancelled;
- int abi_slush_fund[2];
- $EXTRA_STATUS_DECL
} MPI_Status;
_EOF
]
@@ -5865,10 +5859,6 @@ fi
# ----------------------------------------------------------------------------
-dnl Extra status information, from device subsystem, to be included in the
-dnl declaration of MPI_Status in mpi.h.in
-AC_SUBST(EXTRA_STATUS_DECL)
-
dnl FIXME XXX DJG does this need to actually be conditional on something?
dnl previously it was conditional on the successful execution of
dnl "src/binding/f90/configure" but that would only fail if FC couldn't be
diff --git a/src/binding/f90/buildiface b/src/binding/f90/buildiface
index 7ae05be..038c6a4 100755
--- a/src/binding/f90/buildiface
+++ b/src/binding/f90/buildiface
@@ -612,8 +612,6 @@ print MPIFD "! -*- Mode: Fortran; -*-
INCLUDE 'mpifnoext.h'\n";
# MPI-3 Requires that even the MPI module (not just mpi_f08) include
# the MPI_Status type, as well as handle types
-# WARNING: If there is and "EXTRA_STATUS_DECL", this declaration is
-# erroneous
# WARNING: INTEGER is incorrect; it should be INTEGER(C_INT) if this
# is to be used directly by a C routine. That may also require using
# USE ISO_C_BINDING, ONLY :: C_INT
diff --git a/src/include/mpi.h.in b/src/include/mpi.h.in
index 6ccd9d8..1b9ad19 100644
--- a/src/include/mpi.h.in
+++ b/src/include/mpi.h.in
@@ -559,13 +559,11 @@ static const MPI_Datatype mpich_mpi_offset MPICH_ATTR_TYPE_TAG(MPI_Offset) = MPI
/* The order of these elements must match that in mpif.h */
typedef struct MPI_Status {
+ int count_lo;
+ int count_hi_and_cancelled;
int MPI_SOURCE;
int MPI_TAG;
int MPI_ERROR;
- MPI_Count count;
- int cancelled;
- int abi_slush_fund[2];
- @EXTRA_STATUS_DECL@
} MPI_Status;
/* types for the MPI_T_ interface */
diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h
index d06f492..4eb398d 100644
--- a/src/include/mpiimpl.h
+++ b/src/include/mpiimpl.h
@@ -2298,29 +2298,63 @@ void MPIR_Err_print_stack(FILE *, int);
src/mpi/pt2pt? */
/* ------------------------------------------------------------------------- */
+
+/* MPI_Status manipulation macros */
+#define MPIR_BITS_IN_INT (8 * SIZEOF_INT)
+
+/* We use bits from the "count_lo" and "count_hi_and_cancelled" fields
+ * to represent the 'count' and 'cancelled' objects. The LSB of the
+ * "count_hi_and_cancelled" field represents the 'cancelled' object.
+ * The 'count' object is split between the "count_lo" and
+ * "count_hi_and_cancelled" fields, with the lower order bits going
+ * into the "count_lo" field, and the higher order bits goin into the
+ * "count_hi_and_cancelled" field. This gives us 2N-1 bits for the
+ * 'count' object, where N is the size of int. However, the value
+ * returned to the user is bounded by the definition on MPI_Count. */
+/* NOTE: The below code assumes that the count value is never
+ * negative. For negative values, right-shifting can have weird
+ * implementation specific consequences. */
+#define MPIR_STATUS_SET_COUNT(status_, count_) \
+ { \
+ (status_).count_lo = ((int) count_); \
+ (status_).count_hi_and_cancelled &= 1; \
+ (status_).count_hi_and_cancelled |= (int) ((MPI_Count) count_ >> MPIR_BITS_IN_INT << 1); \
+ }
+
+#define MPIR_STATUS_GET_COUNT(status_) \
+ ((MPI_Count) ((((MPI_Count) (status_).count_hi_and_cancelled) >> 1 << MPIR_BITS_IN_INT) + (status_).count_lo))
+
+#define MPIR_STATUS_SET_CANCEL_BIT(status_, cancelled_) \
+ { \
+ (status_).count_hi_and_cancelled &= ~1; \
+ (status_).count_hi_and_cancelled |= cancelled_; \
+ }
+
+#define MPIR_STATUS_GET_CANCEL_BIT(status_) ((status_).count_hi_and_cancelled & 1)
+
/* Do not set MPI_ERROR (only set if ERR_IN_STATUS is returned */
-#define MPIR_Status_set_empty(status_) \
-{ \
- if ((status_) != MPI_STATUS_IGNORE) \
- { \
- (status_)->MPI_SOURCE = MPI_ANY_SOURCE; \
- (status_)->MPI_TAG = MPI_ANY_TAG; \
- (status_)->count = 0; \
- (status_)->cancelled = FALSE; \
- } \
-}
+#define MPIR_Status_set_empty(status_) \
+ { \
+ if ((status_) != MPI_STATUS_IGNORE) \
+ { \
+ (status_)->MPI_SOURCE = MPI_ANY_SOURCE; \
+ (status_)->MPI_TAG = MPI_ANY_TAG; \
+ MPIR_STATUS_SET_COUNT(*(status_), 0); \
+ MPIR_STATUS_SET_CANCEL_BIT(*(status_), FALSE); \
+ } \
+ }
/* See MPI 1.1, section 3.11, Null Processes */
/* Do not set MPI_ERROR (only set if ERR_IN_STATUS is returned */
-#define MPIR_Status_set_procnull(status_) \
-{ \
- if ((status_) != MPI_STATUS_IGNORE) \
- { \
- (status_)->MPI_SOURCE = MPI_PROC_NULL; \
- (status_)->MPI_TAG = MPI_ANY_TAG; \
- (status_)->count = 0; \
- (status_)->cancelled = FALSE; \
- } \
-}
+#define MPIR_Status_set_procnull(status_) \
+ { \
+ if ((status_) != MPI_STATUS_IGNORE) \
+ { \
+ (status_)->MPI_SOURCE = MPI_PROC_NULL; \
+ (status_)->MPI_TAG = MPI_ANY_TAG; \
+ MPIR_STATUS_SET_COUNT(*(status_), 0); \
+ MPIR_STATUS_SET_CANCEL_BIT(*(status_), FALSE); \
+ } \
+ }
#define MPIR_Request_extract_status(request_ptr_, status_) \
{ \
@@ -4241,7 +4275,7 @@ int MPIU_Get_intranode_rank(MPID_Comm *comm_ptr, int r);
#define MPIR_Comm_size(comm_ptr) ((comm_ptr)->local_size)
#define MPIR_Type_extent_impl(datatype, extent_ptr) MPID_Datatype_get_extent_macro(datatype, *(extent_ptr))
#define MPIR_Type_size_impl(datatype, size) MPID_Datatype_get_size_macro(datatype, *(size))
-#define MPIR_Test_cancelled_impl(status, flag) *(flag) = (status)->cancelled
+#define MPIR_Test_cancelled_impl(status, flag) *(flag) = MPIR_STATUS_GET_CANCEL_BIT(*(status))
/* MPIR_ functions. These are versions of MPI_ functions appropriate for calling within MPI */
int MPIR_Cancel_impl(MPID_Request *request_ptr);
diff --git a/src/mpi/datatype/get_count.c b/src/mpi/datatype/get_count.c
index c6c4167..130f7ac 100644
--- a/src/mpi/datatype/get_count.c
+++ b/src/mpi/datatype/get_count.c
@@ -31,15 +31,15 @@ void MPIR_Get_count_impl(const MPI_Status *status, MPI_Datatype datatype, int *c
MPI_Count size;
MPID_Datatype_get_size_macro(datatype, size);
- MPIU_Assert(size >= 0 && status->count >= 0);
+ MPIU_Assert(size >= 0 && MPIR_STATUS_GET_COUNT(*status) >= 0);
if (size != 0) {
/* MPI-3 says return MPI_UNDEFINED if too large for an int */
- if ((status->count % size) != 0 || ((status->count / size) > INT_MAX))
+ if ((MPIR_STATUS_GET_COUNT(*status) % size) != 0 || ((MPIR_STATUS_GET_COUNT(*status) / size) > INT_MAX))
(*count) = MPI_UNDEFINED;
else
- (*count) = (int)(status->count / size);
+ (*count) = (int)(MPIR_STATUS_GET_COUNT(*status) / size);
} else {
- if (status->count > 0) {
+ if (MPIR_STATUS_GET_COUNT(*status) > 0) {
/* --BEGIN ERROR HANDLING-- */
/* case where datatype size is 0 and count is > 0 should
diff --git a/src/mpi/datatype/get_elements_x.c b/src/mpi/datatype/get_elements_x.c
index a511452..df4be1f 100644
--- a/src/mpi/datatype/get_elements_x.c
+++ b/src/mpi/datatype/get_elements_x.c
@@ -297,7 +297,7 @@ int MPIR_Get_elements_x_impl(const MPI_Status *status, MPI_Datatype datatype, MP
if (HANDLE_GET_KIND(datatype) == HANDLE_KIND_BUILTIN ||
(datatype_ptr->element_size != -1 && datatype_ptr->size > 0))
{
- byte_count = status->count;
+ byte_count = MPIR_STATUS_GET_COUNT(*status);
/* QUESTION: WHAT IF SOMEONE GAVE US AN MPI_UB OR MPI_LB???
*/
@@ -324,7 +324,7 @@ int MPIR_Get_elements_x_impl(const MPI_Status *status, MPI_Datatype datatype, MP
MPIU_Assert(byte_count >= 0);
}
else if (datatype_ptr->size == 0) {
- if (status->count > 0) {
+ if (MPIR_STATUS_GET_COUNT(*status) > 0) {
/* --BEGIN ERROR HANDLING-- */
/* datatype size of zero and count > 0 should never happen. */
@@ -343,7 +343,7 @@ int MPIR_Get_elements_x_impl(const MPI_Status *status, MPI_Datatype datatype, MP
else /* derived type with weird element type or weird size */ {
MPIU_Assert(datatype_ptr->element_size == -1);
- byte_count = status->count;
+ byte_count = MPIR_STATUS_GET_COUNT(*status);
*elements = MPIR_Type_get_elements(&byte_count, -1, datatype);
}
diff --git a/src/mpi/datatype/status_set_elements_x.c b/src/mpi/datatype/status_set_elements_x.c
index 5936060..7e9082c 100644
--- a/src/mpi/datatype/status_set_elements_x.c
+++ b/src/mpi/datatype/status_set_elements_x.c
@@ -41,7 +41,7 @@ int MPIR_Status_set_elements_x_impl(MPI_Status *status, MPI_Datatype datatype, M
MPIU_Assert(size_x < MPIR_COUNT_MAX / count);
}
- status->count = size_x * count;
+ MPIR_STATUS_SET_COUNT(*status, size_x * count);
fn_exit:
return mpi_errno;
diff --git a/src/mpi/pt2pt/ibsend.c b/src/mpi/pt2pt/ibsend.c
index 4b35e55..3c92016 100644
--- a/src/mpi/pt2pt/ibsend.c
+++ b/src/mpi/pt2pt/ibsend.c
@@ -36,7 +36,7 @@ PMPI_LOCAL int MPIR_Ibsend_cancel( void *extra, int complete );
PMPI_LOCAL int MPIR_Ibsend_query( void *extra, MPI_Status *status )
{
ibsend_req_info *ibsend_info = (ibsend_req_info *)extra;
- status->cancelled = ibsend_info->cancelled;
+ MPIR_STATUS_SET_CANCEL_BIT(*status, ibsend_info->cancelled);
return MPI_SUCCESS;
}
PMPI_LOCAL int MPIR_Ibsend_free( void *extra )
diff --git a/src/mpi/pt2pt/mpir_request.c b/src/mpi/pt2pt/mpir_request.c
index 1518417..0a195ce 100644
--- a/src/mpi/pt2pt/mpir_request.c
+++ b/src/mpi/pt2pt/mpir_request.c
@@ -70,7 +70,7 @@ int MPIR_Request_complete(MPI_Request * request, MPID_Request * request_ptr,
{
if (status != MPI_STATUS_IGNORE)
{
- status->cancelled = request_ptr->status.cancelled;
+ MPIR_STATUS_SET_CANCEL_BIT(*status, MPIR_STATUS_GET_CANCEL_BIT(request_ptr->status));
}
mpi_errno = request_ptr->status.MPI_ERROR;
/* FIXME: are Ibsend requests added to the send queue? */
@@ -103,7 +103,7 @@ int MPIR_Request_complete(MPI_Request * request, MPID_Request * request_ptr,
{
if (status != MPI_STATUS_IGNORE)
{
- status->cancelled = prequest_ptr->status.cancelled;
+ MPIR_STATUS_SET_CANCEL_BIT(*status, MPIR_STATUS_GET_CANCEL_BIT(prequest_ptr->status));
}
mpi_errno = prequest_ptr->status.MPI_ERROR;
}
@@ -119,7 +119,7 @@ int MPIR_Request_complete(MPI_Request * request, MPID_Request * request_ptr,
}
if (status != MPI_STATUS_IGNORE)
{
- status->cancelled = prequest_ptr->status.cancelled;
+ MPIR_STATUS_SET_CANCEL_BIT(*status, MPIR_STATUS_GET_CANCEL_BIT(prequest_ptr->status));
}
if (mpi_errno == MPI_SUCCESS)
{
@@ -146,7 +146,7 @@ int MPIR_Request_complete(MPI_Request * request, MPID_Request * request_ptr,
error code available */
if (status != MPI_STATUS_IGNORE)
{
- status->cancelled = FALSE;
+ MPIR_STATUS_SET_CANCEL_BIT(*status, FALSE);
}
mpi_errno = request_ptr->status.MPI_ERROR;
}
diff --git a/src/mpi/pt2pt/request_get_status.c b/src/mpi/pt2pt/request_get_status.c
index ffe2808..ef67bb2 100644
--- a/src/mpi/pt2pt/request_get_status.c
+++ b/src/mpi/pt2pt/request_get_status.c
@@ -119,7 +119,7 @@ int MPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status)
{
if (status != MPI_STATUS_IGNORE)
{
- status->cancelled = request_ptr->status.cancelled;
+ MPIR_STATUS_SET_CANCEL_BIT(*status, MPIR_STATUS_GET_CANCEL_BIT(request_ptr->status));
}
mpi_errno = request_ptr->status.MPI_ERROR;
break;
@@ -142,7 +142,7 @@ int MPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status)
{
if (status != MPI_STATUS_IGNORE)
{
- status->cancelled = request_ptr->status.cancelled;
+ MPIR_STATUS_SET_CANCEL_BIT(*status, MPIR_STATUS_GET_CANCEL_BIT(request_ptr->status));
}
mpi_errno = prequest_ptr->status.MPI_ERROR;
}
@@ -158,7 +158,7 @@ int MPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status)
}
if (status != MPI_STATUS_IGNORE)
{
- status->cancelled = prequest_ptr->status.cancelled;
+ MPIR_STATUS_SET_CANCEL_BIT(*status, MPIR_STATUS_GET_CANCEL_BIT(prequest_ptr->status));
}
if (mpi_errno == MPI_SUCCESS)
{
@@ -174,7 +174,7 @@ int MPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status)
make the error code available */
if (status != MPI_STATUS_IGNORE)
{
- status->cancelled = request_ptr->status.cancelled;
+ MPIR_STATUS_SET_CANCEL_BIT(*status, MPIR_STATUS_GET_CANCEL_BIT(request_ptr->status));
}
mpi_errno = request_ptr->status.MPI_ERROR;
}
@@ -218,7 +218,7 @@ int MPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status)
}
if (status != MPI_STATUS_IGNORE)
{
- status->cancelled = request_ptr->status.cancelled;
+ MPIR_STATUS_SET_CANCEL_BIT(*status, MPIR_STATUS_GET_CANCEL_BIT(request_ptr->status));
}
MPIR_Request_extract_status(request_ptr, status);
diff --git a/src/mpi/pt2pt/status_set_cancelled.c b/src/mpi/pt2pt/status_set_cancelled.c
index bfb6879..db1cae0 100644
--- a/src/mpi/pt2pt/status_set_cancelled.c
+++ b/src/mpi/pt2pt/status_set_cancelled.c
@@ -68,7 +68,7 @@ int MPI_Status_set_cancelled(MPI_Status *status, int flag)
/* ... body of routine ... */
- status->cancelled = flag ? TRUE : FALSE;
+ MPIR_STATUS_SET_CANCEL_BIT(*status, flag ? TRUE : FALSE);
/* ... end of body of routine ... */
diff --git a/src/mpi/romio/mpi-io/iotestall.c b/src/mpi/romio/mpi-io/iotestall.c
index 03a7586..d88aeb7 100644
--- a/src/mpi/romio/mpi-io/iotestall.c
+++ b/src/mpi/romio/mpi-io/iotestall.c
@@ -58,8 +58,8 @@ int MPIO_Testall(int count, MPIO_Request requests[], int *flag,
if (statuses != MPI_STATUSES_IGNORE) {
statuses[i].MPI_SOURCE = MPI_ANY_SOURCE;
statuses[i].MPI_TAG = MPI_ANY_TAG;
- statuses[i].count = 0;
- statuses[i].cancelled = 0;
+ MPIR_STATUS_SET_COUNT(statuses[i], 0);
+ MPIR_STATUS_SET_CANCEL_BIT(statuses[i], 0);
}
#else
;
diff --git a/src/mpi/romio/mpi-io/iotestany.c b/src/mpi/romio/mpi-io/iotestany.c
index 7632064..56c1a5e 100644
--- a/src/mpi/romio/mpi-io/iotestany.c
+++ b/src/mpi/romio/mpi-io/iotestany.c
@@ -55,8 +55,8 @@ int MPIO_Testany(int count, MPIO_Request requests[], int *index,
if (status != MPI_STATUS_IGNORE) {
status->MPI_SOURCE = MPI_ANY_SOURCE;
status->MPI_TAG = MPI_ANY_TAG;
- status->count = 0;
- status->cancelled = 0;
+ MPIR_STATUS_SET_COUNT(*status, 0);
+ MPIR_STATUS_SET_CANCEL_BIT(*status, 0);
}
#endif
err = MPI_SUCCESS;
diff --git a/src/mpi/romio/mpi-io/iowaitall.c b/src/mpi/romio/mpi-io/iowaitall.c
index ef22ae8..84c15cd 100644
--- a/src/mpi/romio/mpi-io/iowaitall.c
+++ b/src/mpi/romio/mpi-io/iowaitall.c
@@ -55,8 +55,8 @@ int MPIO_Waitall( int count, MPIO_Request requests[], MPI_Status statuses[] )
if (statuses != MPI_STATUSES_IGNORE) {
statuses[i].MPI_SOURCE = MPI_ANY_SOURCE;
statuses[i].MPI_TAG = MPI_ANY_TAG;
- statuses[i].count = 0;
- statuses[i].cancelled = 0;
+ MPIR_STATUS_SET_COUNT(statuses[i], 0);
+ MPIR_STATUS_SET_CANCEL_BIT(statuses[i], 0);
}
#else
;
diff --git a/src/mpi/romio/mpi-io/iowaitany.c b/src/mpi/romio/mpi-io/iowaitany.c
index 101fc57..1f4779e 100644
--- a/src/mpi/romio/mpi-io/iowaitany.c
+++ b/src/mpi/romio/mpi-io/iowaitany.c
@@ -55,8 +55,8 @@ int MPIO_Waitany(int count, MPIO_Request requests[], int *index,
if (status != MPI_STATUS_IGNORE) {
status->MPI_SOURCE = MPI_ANY_SOURCE;
status->MPI_TAG = MPI_ANY_TAG;
- status->count = 0;
- status->cancelled = 0;
+ MPIR_STATUS_SET_COUNT(*status, 0);
+ MPIR_STATUS_SET_CANCEL_BIT(*status, 0);
}
#endif
err = MPI_SUCCESS;
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mx/mx_cancel.c b/src/mpid/ch3/channels/nemesis/netmod/mx/mx_cancel.c
index 7d58be0..e183cac 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mx/mx_cancel.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mx/mx_cancel.c
@@ -46,14 +46,14 @@ int MPID_nem_mx_cancel_send(MPIDI_VC_t *vc, MPID_Request *sreq)
if (result)
{
- sreq->status.cancelled = TRUE;
+ MPIR_STATUS_SET_CANCEL_BIT(sreq->status, TRUE);
sreq->cc = 0;
MPIU_Object_set_ref(sreq, 1);
(VC_FIELD(vc,pending_sends)) -= 1;
}
else
{
- sreq->status.cancelled = FALSE;
+ MPIR_STATUS_SET_CANCEL_BIT(sreq->status, FALSE);
}
handled = TRUE;
}
@@ -111,16 +111,16 @@ int MPID_nem_mx_cancel_recv(MPIDI_VC_t *vc, MPID_Request *rreq)
if (result)
{
int found;
- rreq->status.cancelled = TRUE;
+ MPIR_STATUS_SET_CANCEL_BIT(rreq->status, TRUE);
found = MPIDI_CH3U_Recvq_DP(rreq);
MPIU_Assert(found);
- rreq->status.count = 0;
+ MPIR_STATUS_SET_COUNT(rreq->status, 0);
MPID_REQUEST_SET_COMPLETED(rreq);
MPID_Request_release(rreq);
}
else
{
- rreq->status.cancelled = FALSE;
+ MPIR_STATUS_SET_CANCEL_BIT(rreq->status, FALSE);
MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,
"request 0x%08x already matched, unable to cancel", rreq->handle);
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mx/mx_poll.c b/src/mpid/ch3/channels/nemesis/netmod/mx/mx_poll.c
index 78bcb22..c4f79e7 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mx/mx_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mx/mx_poll.c
@@ -560,7 +560,7 @@ MPID_nem_mx_handle_rreq(MPID_Request *req, mx_status_t status)
NEM_MX_MATCH_GET_RANK(match_info,req->status.MPI_SOURCE);
NEM_MX_MATCH_GET_TAG(match_info,req->status.MPI_TAG);
- req->status.count = status.xfer_length;
+ MPIR_STATUS_SET_COUNT(req->status, status.xfer_length);
req->dev.recv_data_sz = status.xfer_length;
MPIDI_Datatype_get_info(req->dev.user_count, req->dev.datatype, dt_contig, userbuf_sz, dt_ptr, dt_true_lb);
@@ -596,7 +596,7 @@ MPID_nem_mx_handle_rreq(MPID_Request *req, mx_status_t status)
"**truncate", "**truncate %d %d %d %d",
req->status.MPI_SOURCE, req->status.MPI_TAG,
req->dev.recv_data_sz, userbuf_sz );
- req->status.count = userbuf_sz;
+ MPIR_STATUS_SET_COUNT(req->status, userbuf_sz);
data_sz = userbuf_sz;
}
@@ -607,7 +607,7 @@ MPID_nem_mx_handle_rreq(MPID_Request *req, mx_status_t status)
MPID_Segment_unpack( req->dev.segment_ptr, 0, &last, req->dev.tmpbuf );
MPIU_Free(req->dev.tmpbuf);
if (last != data_sz) {
- req->status.count = (int)last;
+ MPIR_STATUS_SET_COUNT(req->status, (int)last);
if (req->dev.recv_data_sz <= userbuf_sz) {
MPIU_ERR_SETSIMPLE(req->status.MPI_ERROR,MPI_ERR_TYPE,"**dtypemismatch");
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/mx/mx_probe.c b/src/mpid/ch3/channels/nemesis/netmod/mx/mx_probe.c
index b8022b3..237f7e2 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/mx/mx_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/mx/mx_probe.c
@@ -43,7 +43,7 @@ int MPID_nem_mx_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int
NEM_MX_MATCH_GET_RANK(mx_status.match_info,status->MPI_SOURCE);
NEM_MX_MATCH_GET_TAG(mx_status.match_info,status->MPI_TAG);
- status->count = mx_status.xfer_length;
+ MPIR_STATUS_SET_COUNT(*status, mx_status.xfer_length);
fn_exit:
return mpi_errno;
@@ -89,7 +89,7 @@ int MPID_nem_mx_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, in
{
NEM_MX_MATCH_GET_RANK(mx_status.match_info,status->MPI_SOURCE);
NEM_MX_MATCH_GET_TAG(mx_status.match_info,status->MPI_TAG);
- status->count = mx_status.xfer_length;
+ MPIR_STATUS_SET_COUNT(*status, mx_status.xfer_length);
*flag = TRUE;
}
else
diff --git a/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_cancel.c b/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_cancel.c
index 35d31af..7e479b9 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_cancel.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_cancel.c
@@ -26,12 +26,12 @@ int MPID_nem_newmad_cancel_send(MPIDI_VC_t *vc, MPID_Request *sreq)
if (ret == NM_ESUCCESS)
{
- sreq->status.cancelled = TRUE;
+ MPIR_STATUS_SET_CANCEL_BIT(sreq->status, TRUE);
(VC_FIELD(vc,pending_sends)) -= 1;
}
else
{
- sreq->status.cancelled = FALSE;
+ MPIR_STATUS_SET_CANCEL_BIT(sreq->status, FALSE);
}
fn_exit:
@@ -56,11 +56,11 @@ int MPID_nem_newmad_cancel_recv(MPIDI_VC_t *vc, MPID_Request *rreq)
if (ret == NM_ESUCCESS)
{
- rreq->status.cancelled = TRUE;
+ MPIR_STATUS_SET_CANCEL_BIT(rreq->status, TRUE);
}
else
{
- rreq->status.cancelled = FALSE;
+ MPIR_STATUS_SET_CANCEL_BIT(rreq->status, FALSE);
}
fn_exit:
diff --git a/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_poll.c b/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_poll.c
index b3cba3d..0346378 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_poll.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_poll.c
@@ -342,7 +342,7 @@ MPID_nem_newmad_handle_rreq(MPID_Request *req, nm_tag_t match_info, size_t size)
NEM_NMAD_MATCH_GET_RANK(match_info,req->status.MPI_SOURCE);
NEM_NMAD_MATCH_GET_TAG(match_info,req->status.MPI_TAG);
- req->status.count = size;
+ MPIR_STATUS_SET_COUNT(req->status, size);
req->dev.recv_data_sz = size;
MPIDI_Datatype_get_info(req->dev.user_count, req->dev.datatype, dt_contig, userbuf_sz, dt_ptr, dt_true_lb);
@@ -362,7 +362,7 @@ MPID_nem_newmad_handle_rreq(MPID_Request *req, nm_tag_t match_info, size_t size)
"**truncate", "**truncate %d %d %d %d",
req->status.MPI_SOURCE, req->status.MPI_TAG,
req->dev.recv_data_sz, userbuf_sz );
- req->status.count = userbuf_sz;
+ MPIR_STATUS_SET_COUNT(req->status, userbuf_sz);
data_sz = userbuf_sz;
}
@@ -373,7 +373,7 @@ MPID_nem_newmad_handle_rreq(MPID_Request *req, nm_tag_t match_info, size_t size)
MPID_Segment_unpack( req->dev.segment_ptr, 0, &last, req->dev.tmpbuf);
MPIU_Free(req->dev.tmpbuf);
if (last != data_sz) {
- req->status.count = (int)last;
+ MPIR_STATUS_SET_COUNT(req->status, (int)last);
if (req->dev.recv_data_sz <= userbuf_sz) {
MPIU_ERR_SETSIMPLE(req->status.MPI_ERROR,MPI_ERR_TYPE,"**dtypemismatch");
}
diff --git a/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_probe.c b/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_probe.c
index 0336764..d275264 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/newmad/newmad_probe.c
@@ -74,7 +74,7 @@ int MPID_nem_newmad_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm,
else
NEM_NMAD_MATCH_GET_TAG(out_tag,status->MPI_TAG);
- status->count = size;
+ MPIR_STATUS_SET_COUNT(*status, size);
fn_exit:
return mpi_errno;
@@ -144,7 +144,7 @@ int MPID_nem_newmad_iprobe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm
else
NEM_NMAD_MATCH_GET_TAG(out_tag,status->MPI_TAG);
- status->count = size;
+ MPIR_STATUS_SET_COUNT(*status, size);
*flag = TRUE;
}
else
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
index 62f0c64..43c1c1d 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
@@ -73,7 +73,7 @@ typedef struct {
MPID_cc_set(&(sreq_)->cc, 1); \
(sreq_)->cc_ptr = &(sreq_)->cc; \
(sreq_)->status.MPI_ERROR = MPI_SUCCESS; \
- (sreq_)->status.cancelled = FALSE; \
+ MPIR_STATUS_SET_CANCEL_BIT((sreq_)->status, FALSE); \
(sreq_)->dev.cancel_pending = FALSE; \
(sreq_)->dev.state = 0; \
(sreq_)->dev.datatype_ptr = NULL; \
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c
index 521b6e1..0dbfc7e 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_probe.c
@@ -26,7 +26,7 @@ static int handle_probe(const ptl_event_t *e)
REQ_PTL(req)->found = TRUE;
req->status.MPI_SOURCE = NPTL_MATCH_GET_RANK(e->match_bits);
req->status.MPI_TAG = NPTL_MATCH_GET_TAG(e->match_bits);
- req->status.count = NPTL_HEADER_GET_LENGTH(e->match_bits);
+ MPIR_STATUS_SET_COUNT(req->status, NPTL_HEADER_GET_LENGTH(e->match_bits));
MPIDI_CH3U_Request_complete(req);
diff --git a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
index 88f6b9e..0ccb937 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_recv.c
@@ -30,11 +30,11 @@ static void dequeue_req(const ptl_event_t *e)
if (s_len > r_len) {
/* truncated data */
- rreq->status.count = r_len;
+ MPIR_STATUS_SET_COUNT(rreq->status, r_len);
MPIU_ERR_SET2(rreq->status.MPI_ERROR, MPI_ERR_TRUNCATE, "**truncate", "**truncate %d %d", s_len, r_len);
}
- rreq->status.count = s_len;
+ MPIR_STATUS_SET_COUNT(rreq->status, s_len);
}
#undef FUNCNAME
diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
index cbabb05..e26658a 100644
--- a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
+++ b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c
@@ -798,7 +798,7 @@ int MPID_nem_handle_pkt(MPIDI_VC_t *vc, char *buf, MPIDI_msg_sz_t buflen)
{ \
(rreq_)->status.MPI_SOURCE = (pkt_)->match.rank; \
(rreq_)->status.MPI_TAG = (pkt_)->match.tag; \
- (rreq_)->status.count = (pkt_)->data_sz; \
+ MPIR_STATUS_SET_COUNT((rreq_)->status, (pkt_)->data_sz); \
(rreq_)->dev.sender_req_id = (pkt_)->sender_req_id; \
(rreq_)->dev.recv_data_sz = (pkt_)->data_sz; \
MPIDI_Request_set_seqnum((rreq_), (pkt_)->seqnum); \
diff --git a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
index 55c6909..3b3aec9 100644
--- a/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
+++ b/src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c
@@ -10,7 +10,7 @@
{ \
(rreq_)->status.MPI_SOURCE = (pkt_)->match.parts.rank; \
(rreq_)->status.MPI_TAG = (pkt_)->match.parts.tag; \
- (rreq_)->status.count = (pkt_)->data_sz; \
+ MPIR_STATUS_SET_COUNT((rreq_)->status, (pkt_)->data_sz); \
(rreq_)->dev.sender_req_id = (pkt_)->sender_req_id; \
(rreq_)->dev.recv_data_sz = (pkt_)->data_sz; \
MPIDI_Request_set_seqnum((rreq_), (pkt_)->seqnum); \
diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h
index cb7b954..5b5eadc 100644
--- a/src/mpid/ch3/include/mpidimpl.h
+++ b/src/mpid/ch3/include/mpidimpl.h
@@ -329,7 +329,7 @@ extern MPIDI_Process_t MPIDI_Process;
(sreq_)->partner_request = NULL; \
MPIR_Comm_add_ref(comm); \
(sreq_)->status.MPI_ERROR = MPI_SUCCESS; \
- (sreq_)->status.cancelled = FALSE; \
+ MPIR_STATUS_SET_CANCEL_BIT((sreq_)->status, FALSE); \
(sreq_)->dev.state = 0; \
(sreq_)->dev.cancel_pending = FALSE; \
(sreq_)->dev.match.parts.rank = rank; \
@@ -366,7 +366,7 @@ extern MPIDI_Process_t MPIDI_Process;
MPID_cc_set(&(rreq_)->cc, 1); \
(rreq_)->cc_ptr = &(rreq_)->cc; \
(rreq_)->status.MPI_ERROR = MPI_SUCCESS; \
- (rreq_)->status.cancelled = FALSE; \
+ MPIR_STATUS_SET_CANCEL_BIT((rreq_)->status, FALSE); \
(rreq_)->partner_request = NULL; \
(rreq_)->dev.state = 0; \
(rreq_)->dev.cancel_pending = FALSE; \
diff --git a/src/mpid/ch3/src/ch3u_buffer.c b/src/mpid/ch3/src/ch3u_buffer.c
index 49f9829..2d271c2 100644
--- a/src/mpid/ch3/src/ch3u_buffer.c
+++ b/src/mpid/ch3/src/ch3u_buffer.c
@@ -239,7 +239,7 @@ int MPIDI_CH3_RecvFromSelf( MPID_Request *rreq, void *buf, int count,
sreq->dev.datatype, &sreq->status.MPI_ERROR,
buf, count, datatype, &data_sz,
&rreq->status.MPI_ERROR);
- rreq->status.count = (int)data_sz;
+ MPIR_STATUS_SET_COUNT(rreq->status, (int)data_sz);
MPID_REQUEST_SET_COMPLETED(sreq);
MPID_Request_release(sreq);
}
diff --git a/src/mpid/ch3/src/ch3u_eager.c b/src/mpid/ch3/src/ch3u_eager.c
index 80f1acb..1890b2c 100644
--- a/src/mpid/ch3/src/ch3u_eager.c
+++ b/src/mpid/ch3/src/ch3u_eager.c
@@ -309,7 +309,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
(rreq)->status.MPI_SOURCE = (eagershort_pkt)->match.parts.rank;
(rreq)->status.MPI_TAG = (eagershort_pkt)->match.parts.tag;
- (rreq)->status.count = (eagershort_pkt)->data_sz;
+ MPIR_STATUS_SET_COUNT((rreq)->status, (eagershort_pkt)->data_sz);
(rreq)->dev.recv_data_sz = (eagershort_pkt)->data_sz;
MPIDI_Request_set_seqnum((rreq), (eagershort_pkt)->seqnum);
/* FIXME: Why do we set the message type? */
@@ -351,7 +351,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
"**truncate", "**truncate %d %d %d %d",
rreq->status.MPI_SOURCE, rreq->status.MPI_TAG,
rreq->dev.recv_data_sz, userbuf_sz );
- rreq->status.count = userbuf_sz;
+ MPIR_STATUS_SET_COUNT(rreq->status, userbuf_sz);
data_sz = userbuf_sz;
}
@@ -405,7 +405,7 @@ int MPIDI_CH3_PktHandler_EagerShortSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
/* There are two cases: a datatype mismatch (could
not consume all data) or a too-short buffer. We
need to distinguish between these two types. */
- rreq->status.count = (int)last;
+ MPIR_STATUS_SET_COUNT(rreq->status, (int)last);
if (rreq->dev.recv_data_sz <= userbuf_sz) {
MPIU_ERR_SETSIMPLE(rreq->status.MPI_ERROR,MPI_ERR_TYPE,
"**dtypemismatch");
@@ -575,7 +575,7 @@ int MPIDI_CH3_EagerContigIsend( MPID_Request **sreq_p,
{ \
(rreq_)->status.MPI_SOURCE = (pkt_)->match.parts.rank; \
(rreq_)->status.MPI_TAG = (pkt_)->match.parts.tag; \
- (rreq_)->status.count = (pkt_)->data_sz; \
+ MPIR_STATUS_SET_COUNT((rreq_)->status, (pkt_)->data_sz); \
(rreq_)->dev.sender_req_id = (pkt_)->sender_req_id; \
(rreq_)->dev.recv_data_sz = (pkt_)->data_sz; \
MPIDI_Request_set_seqnum((rreq_), (pkt_)->seqnum); \
@@ -744,7 +744,7 @@ int MPIDI_CH3_PktHandler_ReadySend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
"**rsendnomatch %d %d",
ready_pkt->match.parts.rank,
ready_pkt->match.parts.tag);
- rreq->status.count = 0;
+ MPIR_STATUS_SET_COUNT(rreq->status, 0);
if (rreq->dev.recv_data_sz > 0)
{
/* force read of extra data */
diff --git a/src/mpid/ch3/src/ch3u_eagersync.c b/src/mpid/ch3/src/ch3u_eagersync.c
index 3c59a86..109a3cf 100644
--- a/src/mpid/ch3/src/ch3u_eagersync.c
+++ b/src/mpid/ch3/src/ch3u_eagersync.c
@@ -201,7 +201,7 @@ int MPIDI_CH3_EagerSyncAck( MPIDI_VC_t *vc, MPID_Request *rreq )
{ \
(rreq_)->status.MPI_SOURCE = (pkt_)->match.parts.rank; \
(rreq_)->status.MPI_TAG = (pkt_)->match.parts.tag; \
- (rreq_)->status.count = (pkt_)->data_sz; \
+ MPIR_STATUS_SET_COUNT((rreq_)->status, (pkt_)->data_sz); \
(rreq_)->dev.sender_req_id = (pkt_)->sender_req_id; \
(rreq_)->dev.recv_data_sz = (pkt_)->data_sz; \
MPIDI_Request_set_seqnum((rreq_), (pkt_)->seqnum); \
diff --git a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
index 30a84fe..426429c 100644
--- a/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
+++ b/src/mpid/ch3/src/ch3u_handle_recv_pkt.c
@@ -26,7 +26,7 @@
{ \
(rreq_)->status.MPI_SOURCE = (pkt_)->match.parts.rank; \
(rreq_)->status.MPI_TAG = (pkt_)->match.parts.tag; \
- (rreq_)->status.count = (pkt_)->data_sz; \
+ MPIR_STATUS_SET_COUNT((rreq_)->status, (pkt_)->data_sz); \
(rreq_)->dev.sender_req_id = (pkt_)->sender_req_id; \
(rreq_)->dev.recv_data_sz = (pkt_)->data_sz; \
MPIDI_Request_set_seqnum((rreq_), (pkt_)->seqnum); \
@@ -132,7 +132,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
"**truncate", "**truncate %d %d %d %d",
rreq->status.MPI_SOURCE, rreq->status.MPI_TAG,
rreq->dev.recv_data_sz, userbuf_sz );
- rreq->status.count = userbuf_sz;
+ MPIR_STATUS_SET_COUNT(rreq->status, userbuf_sz);
data_sz = userbuf_sz;
}
@@ -198,7 +198,7 @@ int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t
mismatch between the datatype and the amount of
data received. Throw away received data. */
MPIU_ERR_SET(rreq->status.MPI_ERROR, MPI_ERR_TYPE, "**dtypemismatch");
- rreq->status.count = (int)rreq->dev.segment_first;
+ MPIR_STATUS_SET_COUNT(rreq->status, (int)rreq->dev.segment_first);
*buflen = data_sz;
*complete = TRUE;
/* FIXME: Set OnDataAvail to 0? If not, why not? */
@@ -322,7 +322,7 @@ int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreq)
"**truncate", "**truncate %d %d %d %d",
rreq->status.MPI_SOURCE, rreq->status.MPI_TAG,
rreq->dev.recv_data_sz, userbuf_sz );
- rreq->status.count = userbuf_sz;
+ MPIR_STATUS_SET_COUNT(rreq->status, userbuf_sz);
data_sz = userbuf_sz;
}
diff --git a/src/mpid/ch3/src/ch3u_recvq.c b/src/mpid/ch3/src/ch3u_recvq.c
index c2ab01f..1cbd413 100644
--- a/src/mpid/ch3/src/ch3u_recvq.c
+++ b/src/mpid/ch3/src/ch3u_recvq.c
@@ -266,8 +266,8 @@ int MPIDI_CH3U_Recvq_FU(int source, int tag, int context_id, MPI_Status *s)
/* Avoid setting "extra" fields like MPI_ERROR */
s->MPI_SOURCE = rreq->status.MPI_SOURCE;
s->MPI_TAG = rreq->status.MPI_TAG;
- s->count = rreq->status.count;
- s->cancelled = rreq->status.cancelled;
+ MPIR_STATUS_SET_COUNT(*s, MPIR_STATUS_GET_COUNT(rreq->status));
+ MPIR_STATUS_SET_CANCEL_BIT(*s, MPIR_STATUS_GET_CANCEL_BIT(rreq->status));
}
found = 1;
}
diff --git a/src/mpid/ch3/src/ch3u_request.c b/src/mpid/ch3/src/ch3u_request.c
index 5842b7b..86dff27 100644
--- a/src/mpid/ch3/src/ch3u_request.c
+++ b/src/mpid/ch3/src/ch3u_request.c
@@ -69,8 +69,8 @@ MPID_Request * MPID_Request_create(void)
req->status.MPI_SOURCE = MPI_UNDEFINED;
req->status.MPI_TAG = MPI_UNDEFINED;
req->status.MPI_ERROR = MPI_SUCCESS;
- req->status.count = 0;
- req->status.cancelled = FALSE;
+ MPIR_STATUS_SET_COUNT(req->status, 0);
+ MPIR_STATUS_SET_CANCEL_BIT(req->status, FALSE);
req->comm = NULL;
req->greq_fns = NULL;
req->dev.datatype_ptr = NULL;
@@ -381,7 +381,7 @@ int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq)
rreq->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_TYPE,
"**dtypemismatch", 0);
- rreq->status.count = (int)rreq->dev.segment_first;
+ MPIR_STATUS_SET_COUNT(rreq->status, (int)rreq->dev.segment_first);
rreq->dev.segment_size = rreq->dev.segment_first;
mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq);
goto fn_exit;
@@ -518,7 +518,7 @@ int MPIDI_CH3U_Request_unpack_srbuf(MPID_Request * rreq)
/* If no data can be unpacked, then we have a datatype processing
problem. Adjust the segment info so that the remaining
data is received and thrown away. */
- rreq->status.count = (int)rreq->dev.segment_first;
+ MPIR_STATUS_SET_COUNT(rreq->status, (int)rreq->dev.segment_first);
rreq->dev.segment_size = rreq->dev.segment_first;
rreq->dev.segment_first += tmpbuf_last;
rreq->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS,
@@ -536,7 +536,7 @@ int MPIDI_CH3U_Request_unpack_srbuf(MPID_Request * rreq)
Note: the segment_first field is set to segment_last so that if
this is a truncated message, extra data will be read
off the pipe. */
- rreq->status.count = (int)last;
+ MPIR_STATUS_SET_COUNT(rreq->status, (int)last);
rreq->dev.segment_size = last;
rreq->dev.segment_first = tmpbuf_last;
rreq->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS,
@@ -600,7 +600,7 @@ int MPIDI_CH3U_Request_unpack_uebuf(MPID_Request * rreq)
", buf_sz=" MPIDI_MSG_SZ_FMT,
rreq->dev.recv_data_sz, userbuf_sz));
unpack_sz = userbuf_sz;
- rreq->status.count = (int)userbuf_sz;
+ MPIR_STATUS_SET_COUNT(rreq->status, (int)userbuf_sz);
rreq->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_TRUNCATE,
"**truncate", "**truncate %d %d",
@@ -636,7 +636,7 @@ int MPIDI_CH3U_Request_unpack_uebuf(MPID_Request * rreq)
/* received data was not entirely consumed by unpack()
because too few bytes remained to fill the next basic
datatype */
- rreq->status.count = (int)last;
+ MPIR_STATUS_SET_COUNT(rreq->status, (int)last);
rreq->status.MPI_ERROR = MPIR_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_TYPE,
"**dtypemismatch", 0);
diff --git a/src/mpid/ch3/src/ch3u_rma_reqops.c b/src/mpid/ch3/src/ch3u_rma_reqops.c
index e0af215..f83f893 100644
--- a/src/mpid/ch3/src/ch3u_rma_reqops.c
+++ b/src/mpid/ch3/src/ch3u_rma_reqops.c
@@ -86,8 +86,8 @@ static int MPIDI_CH3I_Rma_req_query(void *state, MPI_Status *status)
MPIU_UNREFERENCED_ARG(state);
/* All status fields, except the error code, are undefined */
- status->count = 0;
- status->cancelled = FALSE;
+ MPIR_STATUS_SET_COUNT(*status, 0);
+ MPIR_STATUS_SET_CANCEL_BIT(*status, FALSE);
status->MPI_SOURCE = MPI_UNDEFINED;
status->MPI_TAG = MPI_UNDEFINED;
diff --git a/src/mpid/ch3/src/ch3u_rndv.c b/src/mpid/ch3/src/ch3u_rndv.c
index 69f517d..080cc90 100644
--- a/src/mpid/ch3/src/ch3u_rndv.c
+++ b/src/mpid/ch3/src/ch3u_rndv.c
@@ -98,7 +98,7 @@ int MPIDI_CH3_RndvSend( MPID_Request **sreq_p, const void * buf, int count,
{ \
(rreq_)->status.MPI_SOURCE = (pkt_)->match.parts.rank; \
(rreq_)->status.MPI_TAG = (pkt_)->match.parts.tag; \
- (rreq_)->status.count = (pkt_)->data_sz; \
+ MPIR_STATUS_SET_COUNT((rreq_)->status, (pkt_)->data_sz); \
(rreq_)->dev.sender_req_id = (pkt_)->sender_req_id; \
(rreq_)->dev.recv_data_sz = (pkt_)->data_sz; \
MPIDI_Request_set_seqnum((rreq_), (pkt_)->seqnum); \
diff --git a/src/mpid/ch3/src/mpid_cancel_recv.c b/src/mpid/ch3/src/mpid_cancel_recv.c
index 9cbdfce..24a04f6 100644
--- a/src/mpid/ch3/src/mpid_cancel_recv.c
+++ b/src/mpid/ch3/src/mpid_cancel_recv.c
@@ -22,8 +22,8 @@ int MPID_Cancel_recv(MPID_Request * rreq)
{
MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,
"request 0x%08x cancelled", rreq->handle);
- rreq->status.cancelled = TRUE;
- rreq->status.count = 0;
+ MPIR_STATUS_SET_CANCEL_BIT(rreq->status, TRUE);
+ MPIR_STATUS_SET_COUNT(rreq->status, 0);
MPID_REQUEST_SET_COMPLETED(rreq);
MPID_Request_release(rreq);
}
diff --git a/src/mpid/ch3/src/mpid_cancel_send.c b/src/mpid/ch3/src/mpid_cancel_send.c
index 0f731d1..df0c57b 100644
--- a/src/mpid/ch3/src/mpid_cancel_send.c
+++ b/src/mpid/ch3/src/mpid_cancel_send.c
@@ -70,7 +70,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
MPIU_Object_set_ref(rreq, 0);
MPIDI_CH3_Request_destroy(rreq);
- sreq->status.cancelled = TRUE;
+ MPIR_STATUS_SET_CANCEL_BIT(sreq->status, TRUE);
/* no other thread should be waiting on sreq, so it is safe to
reset ref_count and cc */
MPID_cc_set(&sreq->cc, 0);
@@ -79,7 +79,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
}
else
{
- sreq->status.cancelled = FALSE;
+ MPIR_STATUS_SET_CANCEL_BIT(sreq->status, FALSE);
MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
"send-to-self cancellation failed, sreq=0x%08x, rreq=0x%08x",
sreq->handle, rreq->handle));
@@ -125,7 +125,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
if (cancelled)
{
- sreq->status.cancelled = TRUE;
+ MPIR_STATUS_SET_CANCEL_BIT(sreq->status, TRUE);
/* no other thread should be waiting on sreq, so it is
safe to reset ref_count and cc */
MPID_cc_set(&sreq->cc, 0);
@@ -140,7 +140,7 @@ int MPID_Cancel_send(MPID_Request * sreq)
cancelled = FALSE;
if (cancelled)
{
- sreq->status.cancelled = TRUE;
+ MPIR_STATUS_SET_CANCEL_BIT(sreq->status, TRUE);
/* no other thread should be waiting on sreq, so it is safe to
reset ref_count and cc */
MPID_cc_set(&sreq->cc, 0);
@@ -288,7 +288,7 @@ int MPIDI_CH3_PktHandler_CancelSendResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
if (resp_pkt->ack)
{
- sreq->status.cancelled = TRUE;
+ MPIR_STATUS_SET_CANCEL_BIT(sreq->status, TRUE);
if (MPIDI_Request_get_msg_type(sreq) == MPIDI_REQUEST_RNDV_MSG ||
MPIDI_Request_get_type(sreq) == MPIDI_REQUEST_TYPE_SSEND)
@@ -304,7 +304,7 @@ int MPIDI_CH3_PktHandler_CancelSendResp( MPIDI_VC_t *vc ATTRIBUTE((unused)),
}
else
{
- sreq->status.cancelled = FALSE;
+ MPIR_STATUS_SET_CANCEL_BIT(sreq->status, FALSE);
MPIU_DBG_MSG(CH3_OTHER,TYPICAL,"unable to cancel message");
}
diff --git a/src/mpid/ch3/src/mpidi_isend_self.c b/src/mpid/ch3/src/mpidi_isend_self.c
index 8ec7f82..9460c8e 100644
--- a/src/mpid/ch3/src/mpidi_isend_self.c
+++ b/src/mpid/ch3/src/mpidi_isend_self.c
@@ -74,7 +74,7 @@ int MPIDI_Isend_self(const void * buf, int count, MPI_Datatype datatype, int ran
MPIDI_CH3U_Buffer_copy(buf, count, datatype, &sreq->status.MPI_ERROR,
rreq->dev.user_buf, rreq->dev.user_count, rreq->dev.datatype, &data_sz, &rreq->status.MPI_ERROR);
- rreq->status.count = (int)data_sz;
+ MPIR_STATUS_SET_COUNT(rreq->status, (int)data_sz);
MPID_REQUEST_SET_COMPLETED(rreq);
MPID_Request_release(rreq);
/* sreq has never been seen by the user or outside this thread, so it is safe to reset ref_count and cc */
@@ -99,7 +99,7 @@ int MPIDI_Isend_self(const void * buf, int count, MPI_Datatype datatype, int ran
rreq->partner_request = sreq;
rreq->dev.sender_req_id = sreq->handle;
MPID_Datatype_get_size_macro(datatype, dt_sz);
- rreq->status.count = count * dt_sz;
+ MPIR_STATUS_SET_COUNT(rreq->status, count * dt_sz);
}
else
{
@@ -112,7 +112,7 @@ int MPIDI_Isend_self(const void * buf, int count, MPI_Datatype datatype, int ran
rreq->partner_request = NULL;
rreq->dev.sender_req_id = MPI_REQUEST_NULL;
- rreq->status.count = 0;
+ MPIR_STATUS_SET_COUNT(rreq->status, 0);
/* sreq has never been seen by the user or outside this thread, so it is safe to reset ref_count and cc */
MPIU_Object_set_ref(sreq, 1);
diff --git a/src/mpid/pamid/src/mpid_request.h b/src/mpid/pamid/src/mpid_request.h
index ba17b78..1a233f0 100644
--- a/src/mpid/pamid/src/mpid_request.h
+++ b/src/mpid/pamid/src/mpid_request.h
@@ -184,8 +184,8 @@ MPIDI_Request_initialize(MPID_Request * req)
{
req->greq_fns = NULL;
- req->status.count = 0;
- req->status.cancelled = FALSE;
+ MPIR_STATUS_SET_COUNT(req->status, 0);
+ MPIR_STATUS_SET_CANCEL_BIT(req->status, FALSE);
req->status.MPI_SOURCE = MPI_UNDEFINED;
req->status.MPI_TAG = MPI_UNDEFINED;
req->status.MPI_ERROR = MPI_SUCCESS;
diff --git a/src/mpid/pamid/src/pt2pt/mpid_cancel.c b/src/mpid/pamid/src/pt2pt/mpid_cancel.c
index 27cfe86..1ca2f87 100644
--- a/src/mpid/pamid/src/pt2pt/mpid_cancel.c
+++ b/src/mpid/pamid/src/pt2pt/mpid_cancel.c
@@ -28,8 +28,8 @@ MPID_Cancel_recv(MPID_Request * rreq)
MPID_assert(rreq->kind == MPID_REQUEST_RECV);
if (MPIDI_Recvq_FDPR(rreq))
{
- rreq->status.cancelled = TRUE;
- rreq->status.count = 0;
+ MPIR_STATUS_SET_CANCEL_BIT(rreq->status, TRUE);
+ MPIR_STATUS_SET_COUNT(rreq->status, 0);
MPIDI_Request_complete(rreq);
}
/* This is successful, even if the recv isn't cancelled */
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c b/src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c
index 8b8c774..9484e43 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c
@@ -197,7 +197,7 @@ MPIDI_RecvCB(pami_context_t context,
/* ---------------------- */
rreq->status.MPI_SOURCE = rank;
rreq->status.MPI_TAG = tag;
- rreq->status.count = sndlen;
+ MPIR_STATUS_SET_COUNT(rreq->status, sndlen);
MPIDI_Request_setCA (rreq, MPIDI_CA_COMPLETE);
MPIDI_Request_cpyPeerRequestH(rreq, msginfo);
MPIDI_Request_setSync (rreq, msginfo->isSync);
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_callback_rzv.c b/src/mpid/pamid/src/pt2pt/mpidi_callback_rzv.c
index 8b00c48..b0922fe 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_callback_rzv.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_callback_rzv.c
@@ -77,7 +77,7 @@ MPIDI_RecvRzvCB_impl(pami_context_t context,
/* ---------------------- */
rreq->status.MPI_SOURCE = rank;
rreq->status.MPI_TAG = tag;
- rreq->status.count = envelope->length;
+ MPIR_STATUS_SET_COUNT(rreq->status, envelope->length);
MPIDI_Request_setPeerRank_comm(rreq, rank);
MPIDI_Request_setPeerRank_pami(rreq, source);
MPIDI_Request_cpyPeerRequestH (rreq, msginfo);
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_callback_short.c b/src/mpid/pamid/src/pt2pt/mpidi_callback_short.c
index 552c636..705d623 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_callback_short.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_callback_short.c
@@ -157,7 +157,7 @@ MPIDI_RecvShortCB(pami_context_t context,
/* ---------------------- */
rreq->status.MPI_SOURCE = rank;
rreq->status.MPI_TAG = tag;
- rreq->status.count = sndlen;
+ MPIR_STATUS_SET_COUNT(rreq->status, sndlen);
MPIDI_Request_setCA (rreq, MPIDI_CA_COMPLETE);
MPIDI_Request_cpyPeerRequestH(rreq, msginfo);
MPIDI_Request_setSync (rreq, isSync);
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_callback_util.c b/src/mpid/pamid/src/pt2pt/mpidi_callback_util.c
index 931404c..fa3b48b 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_callback_util.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_callback_util.c
@@ -56,7 +56,7 @@ MPIDI_Callback_process_unexp(MPID_Request *newreq,
/* ---------------------- */
rreq->status.MPI_SOURCE = rank;
rreq->status.MPI_TAG = tag;
- rreq->status.count = sndlen;
+ MPIR_STATUS_SET_COUNT(rreq->status, sndlen);
MPIDI_Request_setCA (rreq, MPIDI_CA_COMPLETE);
MPIDI_Request_cpyPeerRequestH(rreq, msginfo);
MPIDI_Request_setSync (rreq, isSync);
@@ -118,8 +118,8 @@ MPIDI_Callback_process_trunc(pami_context_t context,
if (recv)
{
MPIDI_Request_setCA(rreq, MPIDI_CA_UNPACK_UEBUF_AND_COMPLETE);
- rreq->mpid.uebuflen = rreq->status.count;
- rreq->mpid.uebuf = MPIU_Malloc(rreq->status.count);
+ rreq->mpid.uebuflen = MPIR_STATUS_GET_COUNT(rreq->status);
+ rreq->mpid.uebuf = MPIU_Malloc(MPIR_STATUS_GET_COUNT(rreq->status));
MPID_assert(rreq->mpid.uebuf != NULL);
rreq->mpid.uebuf_malloc = mpiuMalloc;
@@ -128,7 +128,7 @@ MPIDI_Callback_process_trunc(pami_context_t context,
else
{
MPIDI_Request_setCA(rreq, MPIDI_CA_UNPACK_UEBUF_AND_COMPLETE);
- rreq->mpid.uebuflen = rreq->status.count;
+ rreq->mpid.uebuflen = MPIR_STATUS_GET_COUNT(rreq->status);
rreq->mpid.uebuf = (void*)sndbuf;
MPIDI_RecvDoneCB(context, rreq, PAMI_SUCCESS);
MPID_Request_release(rreq);
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_control.c b/src/mpid/pamid/src/pt2pt/mpidi_control.c
index 39629fd..9710ca4 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_control.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_control.c
@@ -323,7 +323,7 @@ MPIDI_CancelAck_proc(pami_context_t context,
MPID_assert(info->control == MPIDI_CONTROL_CANCEL_ACKNOWLEDGE);
MPID_assert(req->mpid.cancel_pending == TRUE);
- req->status.cancelled = TRUE;
+ MPIR_STATUS_SET_CANCEL_BIT(req->status, TRUE);
/*
* Rendezvous-Sends wait until a rzv ack is received to complete
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_done.c b/src/mpid/pamid/src/pt2pt/mpidi_done.c
index 9f2e062..5979409 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_done.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_done.c
@@ -55,7 +55,7 @@ MPIDI_RecvDoneCB_copy(MPID_Request * rreq)
rreq->mpid.datatype, /* dest type */
&_count,
&rreq->status.MPI_ERROR);
- rreq->status.count = _count;
+ MPIR_STATUS_SET_COUNT(rreq->status, _count);
}
@@ -95,7 +95,7 @@ MPIDI_RecvDoneCB(pami_context_t context,
#ifdef OUT_OF_ORDER_HANDLING
MPID_Request * oo_peer = rreq->mpid.oo_peer;
if (oo_peer) {
- oo_peer->status.count = rreq->status.count;
+ MPIR_STATUS_SET_COUNT(oo_peer->status, MPIR_STATUS_GET_COUNT(rreq->status));
MPIDI_Request_complete(oo_peer);
}
#endif
@@ -191,7 +191,7 @@ void MPIDI_Recvq_process_out_of_order_msgs(pami_task_t src, pami_context_t conte
dt_true_lb);
if (unlikely(ooreq->mpid.uebuflen > dt_size))
{
- rreq->status.count = dt_size;
+ MPIR_STATUS_SET_COUNT(rreq->status, dt_size);
rreq->status.MPI_ERROR = MPI_ERR_TRUNCATE;
}
@@ -215,7 +215,7 @@ void MPIDI_Recvq_process_out_of_order_msgs(pami_task_t src, pami_context_t conte
MPIDI_RecvMsg_Unexp(ooreq, rreq->mpid.userbuf, rreq->mpid.userbufcount, rreq->mpid.datatype);
} else {
MPIDI_RecvMsg_Unexp(ooreq, rreq->mpid.userbuf, rreq->mpid.userbufcount, rreq->mpid.datatype);
- rreq->status.count = ooreq->status.count;
+ MPIR_STATUS_SET_COUNT(rreq->status, MPIR_STATUS_GET_COUNT(ooreq->status));
rreq->status.MPI_SOURCE = ooreq->status.MPI_SOURCE;
rreq->status.MPI_TAG = ooreq->status.MPI_TAG;
rreq->mpid.envelope.msginfo.MPIseqno = ooreq->mpid.envelope.msginfo.MPIseqno;
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c b/src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c
index 71191f9..41914fc 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c
@@ -82,7 +82,7 @@ MPIDI_RecvMsg_Unexp(MPID_Request * rreq,
/* -------------------------------- */
if (rreq->mpid.uebuf != NULL)
{
- if (likely(rreq->status.cancelled == FALSE))
+ if (likely(MPIR_STATUS_GET_CANCEL_BIT(rreq->status) == FALSE))
{
MPIDI_msg_sz_t _count=0;
MPIDI_Buffer_copy(rreq->mpid.uebuf,
@@ -94,13 +94,13 @@ MPIDI_RecvMsg_Unexp(MPID_Request * rreq,
datatype,
&_count,
&rreq->status.MPI_ERROR);
- rreq->status.count = _count;
+ MPIR_STATUS_SET_COUNT(rreq->status, _count);
}
}
else
{
MPID_assert(rreq->mpid.uebuflen == 0);
- rreq->status.count = 0;
+ MPIR_STATUS_SET_COUNT(rreq->status, 0);
}
}
else
@@ -121,7 +121,7 @@ MPIDI_RecvMsg_Unexp(MPID_Request * rreq,
MPIDI_Request_uncomplete(rreq);
MPIDI_Send_post(MPIDI_SyncAck_handoff, rreq);
}
- if(rreq->status.cancelled == FALSE)
+ if (MPIR_STATUS_GET_CANCEL_BIT(rreq->status) == FALSE)
{
MPIDI_Request_setCA(rreq, MPIDI_CA_UNPACK_UEBUF_AND_COMPLETE);
}
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_rendezvous.c b/src/mpid/pamid/src/pt2pt/mpidi_rendezvous.c
index 7a89023..e79e6a5 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_rendezvous.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_rendezvous.c
@@ -66,7 +66,7 @@ MPIDI_RendezvousTransfer(pami_context_t context,
{
rcvlen = dt_size;
rreq->status.MPI_ERROR = MPI_ERR_TRUNCATE;
- rreq->status.count = rcvlen;
+ MPIR_STATUS_SET_COUNT(rreq->status, rcvlen);
}
else
{
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c b/src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c
index 8904ddd..8c7f04b 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c
@@ -352,7 +352,7 @@ MPIDI_SendMsg_process_userdefined_dt(MPID_Request * sreq,
if (unlikely(sndbuf == NULL))
{
sreq->status.MPI_ERROR = MPI_ERR_NO_SPACE;
- sreq->status.count = 0;
+ MPIR_STATUS_SET_COUNT(sreq->status, 0);
MPID_Abort(NULL, MPI_ERR_NO_SPACE, -1,
"Unable to allocate non-contiguous buffer");
}
diff --git a/test/mpi/pt2pt/large_message.c b/test/mpi/pt2pt/large_message.c
index db3d275..f895936 100644
--- a/test/mpi/pt2pt/large_message.c
+++ b/test/mpi/pt2pt/large_message.c
@@ -55,7 +55,7 @@ int main(int argc, char *argv[])
for (i=0; i<cnt; i++) cols[i] = -1;
ierr = MPI_Recv(cols,cnt,MPI_LONG_LONG_INT,0,0,MPI_COMM_WORLD,&status);
/* ierr = MPI_Get_count(&status,MPI_LONG_LONG_INT,&cnt);
- Get_count still fails because status.count is not 64 bit */
+ Get_count still fails because count is not 64 bit */
for (i=0; i<cnt; i++) {
if (cols[i] != i) {
/*printf("Rank %d, cols[i]=%lld, should be %d\n", rank, cols[i], i);*/
http://git.mpich.org/mpich.git/commitdiff/a214d50071c2b53b077f865922f2d9bf6…
commit a214d50071c2b53b077f865922f2d9bf6ce6f89e
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sat Oct 19 10:08:03 2013 -0500
Revert "Fix for #1804 - Alignment issues in Fortran with MPI_Status"
This reverts commit 81ad170b491ba0bdfb7d0028b06835651adfd968.
Signed-off-by: William Gropp <wgropp(a)illinois.edu>
diff --git a/configure.ac b/configure.ac
index 2820478..6d6af8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5837,99 +5837,6 @@ if test "$enable_f77" = yes -a -z "$MPI_STATUS_SIZE" ; then
else
AC_MSG_ERROR([MPI_STATUS_SIZE was not defined!])
fi
-
- # Because MPI_Status may contain C integers of different sizes
- # and with different alignments, we determine the maximum element
- # size and then tell Fortran to enforce maximal alignment.
- # A more sophisticated test would determine the required alignment,
- # rather than assuming alignment to maximum size
- MPIR_COUNT_ALIGNMENT=0
- if test $MPI_SIZEOF_COUNT -gt $pac_cv_f77_sizeof_integer ; then
- # Alignment test looks at the low address bits, as long
- # as the sizeof(MPI_Count) is 2^j.
- # If we can't tell, pick a value that forces the Fortran
- # wrappers to use a local copy.
- case $MPI_SIZEOF_COUNT in
- 4) MPIR_COUNT_ALIGNMENT="0x3";;
- 8) MPIR_COUNT_ALIGNMENT="0x7";;
- 16) MPIR_COUNT_ALIGNMENT="0xF";;
- *) MPIR_COUNT_ALIGNMENT=-1 ;;
- esac
-
- # Compare the size of MPI_Status to the sizes of the individual
- # elements. If the sizeof(MPI_Status) > sum of the sizes, then
- # determine if simple padding will work.
- # FIXME: DETERMINED TO SEE IF THERE IS PROBLEM BUT NOT YET USED
- AC_MSG_CHECKING([whether MPI_Status contains padding])
- sum_of_status_element_sizes=`expr 6 \* $ac_cv_sizeof_int + $MPI_SIZEOF_COUNT`
- if test $sum_of_status_element_sizes -lt $pac_cv_sizeof_mpi_status ; then
- AC_MSG_RESULT([yes])
- if test "$enable_fc" = "yes" ; then
- # FIXME: We could compute the padding or delete the
- # status definition from mpi_constants
- AC_MSG_CHECKING([padding size before count field in MPI_Status])
- rm -f pac_mpi_status.h
-dnl quote with [] since otherwise m4 strips the array declaration out of this
-dnl structure
-[ cat > pac_mpi_status.h <<_EOF
-typedef struct {
- int MPI_SOURCE;
- int MPI_TAG;
- int MPI_ERROR;
- $MPI_COUNT count;
- int cancelled;
- int abi_slush_fund[2];
- $EXTRA_STATUS_DECL
-} MPI_Status;
-MPI_Status mya;
-_EOF
-]
- AC_COMPUTE_INT(pac_cv_fc_pad1,[((char*)&mya.count-(((char*)&mya)+3*sizeof(int)))],[AC_INCLUDES_DEFAULT()
-#include "pac_mpi_status.h"])
- AC_MSG_RESULT($pac_cv_fc_pad1)
- AC_MSG_CHECKING([padding at end of MPI_Status])
- AC_COMPUTE_INT(pac_cv_fc_pad2,[((char*)(&mya + 1) - ((char *)(mya.abi_slush_fund+1) + sizeof(int)))],[AC_INCLUDES_DEFAULT()
-#include "pac_mpi_status.h"])
- AC_MSG_RESULT($pac_cv_fc_pad2)
- rm -f pac_mpi_status.h
- pac_cv_pad1found=no
- pac_cv_pad2found=no
- FC_STATUS_PAD1=""
- FC_STATUS_PAD2=""
- AC_SUBST(FC_STATUS_PAD1)
- AC_SUBST(FC_STATUS_PAD2)
- if test $pac_cv_fc_pad1 -gt 0 ; then
- if test $pac_cv_fc_pad1 -eq $ac_cv_sizeof_int ; then
- pac_cv_pad1found=yes
- FC_STATUS_PAD1="INTEGER :: PAD1"
- fi
- else
- # No padding needed here, so successfully determined
- # padding
- pac_cv_pad1found=yes
- fi
- if test $pac_cv_fc_pad2 -gt 0 ; then
- if test $pac_cv_fc_pad2 -eq $ac_cv_sizeof_int ; then
- pac_cv_pad2found=yes
- FC_STATUS_PAD2="INTEGER :: PAD2"
- fi
- else
- # No padding needed here, so successfully determined
- # padding
- pac_cv_pad2found=yes
- fi
- if test $pac_cv_pad1found = "no" -o \
- $pac_cv_pad2found = "no" ; then
- AC_MSG_ERROR([INTERNAL ERROR: definition of MPI_Status in C and Fortran 90 is incompatible due to padding in the C definition])
- fi
- fi
- else
- AC_MSG_RESULT([no])
- fi
- fi
- # Define the alignment of count regardless of whether sizeof(MPI_Count)
- # is bigger than a Fortran integer
- AC_DEFINE_UNQUOTED([MPIR_COUNT_ALIGNMENT],[$MPIR_COUNT_ALIGNMENT],[Value that anded with an address will give 0 if the address is properly aligned for MPI_Count])
fi # enable_f77 and mpi_status_size not set
AC_SUBST([MPI_STATUS_SIZE])
MPIF_STATUS_SIZE=$MPI_STATUS_SIZE
diff --git a/src/binding/f77/buildiface b/src/binding/f77/buildiface
index 1d8cf1b..f1e9b50 100755
--- a/src/binding/f77/buildiface
+++ b/src/binding/f77/buildiface
@@ -46,10 +46,6 @@ $do_fint = 0; # Set to 1 to support C and Fortran integers of a
# different size
$within_fint = 0; # This is set to 1 while generating code for the
# do_fint branch
-$fixStatusAlignment = 1; # Set to 1 to generate code that
- # handles different alignment rules between
- # Fortran (INTEGER) and C (likely MPI_Count)
- # Note set by feature value do_fixstatus .
%fintToHandle = ( 'int' => 1, 'MPI_Request' => 1, 'MPI_Group' => 1,
'MPI_Win' => 1, 'MPI_Info' => 1, 'MPI_Errhandler' => 1,
'MPI_File' => 1, 'MPI_Op' => 1, 'MPI_Message' => 1 );
@@ -72,7 +68,6 @@ $do_logical = 1;
$do_weak = 1;
$do_subdecls = 1;
$do_bufptr = 1;
-$do_fixstatus = 1;
$prototype_file = "../../include/mpi.h.in";
# Global hashes used for definitions and to record the locations of the
@@ -112,8 +107,8 @@ $specialInitString = "\
# Process arguments
#
# Args
-# -feature={logical,fint,subdecls,weak,bufptr,fixstatus},
-# separated by :, value given by =on or =off, eg
+# -feature={logical,fint,subdecls,weak,bufptr}, separated by :, value given
+# by =on or =off, eg
# -feature=logical=on:fint=off
# The feature names mean:
# logical - Fortran logicals are converted to/from C
@@ -122,11 +117,6 @@ $specialInitString = "\
# weak - Use weak symbols
# bufptr - Check for MPI_BOTTOM as a special address. This is
# not needed if a POINTER declaration is available.
-# fixstatus - The alignment of a Fortran STATUS array may not always
-# be what is required in C (particularly with MPI_Count in
-# MPI_Status now). If set, generate code to handle this case.
-# Systems without alignment restrictions can set this to off,
-# which will remove some tests.
foreach $_ (@ARGV) {
if (/-noprototypes/) { $build_prototypes = 0; }
elsif (/-infile=(.*)/) {
@@ -171,8 +161,6 @@ foreach $_ (@ARGV) {
print STDERR "Unrecognized argument $_\n";
}
}
-# For now, make these equal.
-$fixStatusAlignment = $do_fixstatus;
# Note that the code that looks up values strips blanks out of the type name
# No blanks should be used in the key.
@@ -659,18 +647,18 @@ $fixStatusAlignment = $do_fixstatus;
'Testsome-2' => 'inout:handle_array:*v1:MPI_Request',
'Testsome-3' => 'out:fint2int',
'Testsome-4' => 'out:index_array:*v1:*v3',
- 'Testsome-5' => 'out:status_array:*v1:*v3:*v3>0',
+ 'Testsome-5' => 'out:status_array:*v1:*v3:l3>0',
'Get_count' => '1', 'Get_count-1' => 'in:status',
'Request_get_status' => '2:3',
'Request_get_status-2' => 'out:logical',
'Request_get_status-3' => 'out:status',
'Status_set_cancelled' => '1:2',
- 'Status_set_cancelled-1' => 'inout:status',
+ 'Status_set_cancelled-1' => 'in:status',
'Status_set_cancelled-2' => 'in:logical',
'Status_set_elements' => '1',
- 'Status_set_elements-1' => 'inout:status',
+ 'Status_set_elements-1' => 'out:status',
'Status_set_elements_x' => '1',
- 'Status_set_elements_x-1' => 'inout:status',
+ 'Status_set_elements_x-1' => 'out:status',
'Type_contiguous' => '2:3',
'Type_contiguous-2' => 'in:handle::MPI_Datatype',
'Type_contiguous-3' => 'out:handle::MPI_Datatype',
@@ -1812,7 +1800,6 @@ sub bufptr_in_arg {
sub bufptr_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
}
# --------------------------------------------------------------------------
# MPI_IN_PLACE buffer pointers
@@ -1832,7 +1819,6 @@ sub inplace_in_arg {
sub inplace_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
}
# --------------------------------------------------------------------------
# MPI_UNWEIGHTED pointers. Note that unweighted is only used to indicate
@@ -1909,7 +1895,6 @@ sub unweighted_out_arg {
sub unweighted_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
if ($within_fint) {
# MPI_WEIGHTS_EMPTY should never be an output value from the MPI library
@@ -1948,7 +1933,6 @@ sub logical_in_arg {
sub logical_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
if ($do_logical) {
print $OUTFD " if ($errparmlval == MPI_SUCCESS) *$outvar = MPIR_TO_FLOG($coutvar);\n";
}
@@ -2012,7 +1996,6 @@ sub logical_array_in_arg {
sub logical_array_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
# Special case if MPI_Fint == int: we use the input variable
# for space.
my $ActSize = $Array_size;
@@ -2057,7 +2040,6 @@ sub index_ftoc {
sub index_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
print $OUTFD " *$outvar = (MPI_Fint)$coutvar;\n";
print $OUTFD " if ($coutvar >= 0) *$outvar = *$outvar + 1;\n";
}
@@ -2084,7 +2066,6 @@ sub index_array_out_ftoc {
sub index_array_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
my $ActSize = $Array_size;
# In the case where the input and out sizes are not the same,
# the output size is in the fourth argument.
@@ -2157,7 +2138,6 @@ sub handle_inout_ftoc {
sub handle_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
if ($within_fint) {
print $OUTFD " if ($errparmlval==MPI_SUCCESS) *$outvar = (MPI_Fint)$coutvar;\n";
}
@@ -2280,8 +2260,7 @@ sub handle_array_out_ftoc {
sub handle_array_inout_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
- &handle_array_ctof( $coutvar, $outvar, $count );
+ &handle_array_ctof( $coutvar, $outvar );
}
# Make sure that there is no output processing (other than to free the
@@ -2289,14 +2268,12 @@ sub handle_array_inout_ctof {
sub handle_array_in_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
- #&handle_array_ctof( $coutvar, $outvar, $count );
+ #&handle_array_ctof( $coutvar, $outvar );
}
sub handle_array_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
if ($within_fint) {
my $basetype = $nativeType;
$basetype =~ s/MPI_//;
@@ -2307,7 +2284,7 @@ sub handle_array_ctof {
$asize = "_csize";
}
print $OUTFD "\
- /* handle_array_ctof( $coutvar, $outvar, $count ) */
+ /* handle_array_ctof( $coutvar, $outvar ) */
{int li;
for (li=0; li<$asize; li++) {
$outvar\[li\] = $convfunc( $coutvar\[li\] );
@@ -2415,7 +2392,6 @@ sub addrint_in_arg {
sub attrint_ctof {
my $fvar = $_[0];
my $cvar = $_[1];
- my $count = $_[2];
my $flagarg = 4; # get from option
# The strange cast is due to the following:
# The MPICH attribute code returns an int in the void *. In
@@ -2472,7 +2448,6 @@ sub addraint_in_arg {
sub attraint_ctof {
my $fvar = $_[0];
my $cvar = $_[1];
- my $count = $_[2];
my $flagarg = 4; # get from option
print $OUTFD "
if ((int)*ierr || !l$flagarg) {
@@ -2510,7 +2485,6 @@ sub bufaddr_out_arg {
sub bufaddr_ctof {
my $fvar = $_[0];
my $cvar = $_[1];
- my $count = $_[2];
}
# --------------------------------------------------------------------------
#
@@ -2531,10 +2505,6 @@ sub status_out_fnulltoc {
if (v$count == MPI_F_STATUS_IGNORE) { l$count = MPI_STATUS_IGNORE; }
else { l$count->MPI_ERROR = (int)(v$count\[2\]); }\n";
}
- elsif ($fixStatusAlignment) {
- print $OUTFD "\
- if (v$count == MPI_F_STATUS_IGNORE) { l$count = MPI_STATUS_IGNORE; }\n";
- }
else {
print $OUTFD "\
if (v$count == MPI_F_STATUS_IGNORE) { v$count = (MPI_Fint*)MPI_STATUS_IGNORE; }\n";
@@ -2546,26 +2516,11 @@ sub status_in_ftoc {
if ($within_fint) {
print $OUTFD " MPI_Status_f2c( v$count, l$count );\n";
}
- elsif ($fixStatusAlignment) {
- print $OUTFD "\
- if ( l$count != MPI_STATUS_IGNORE &&
- (((MPI_Aint)v$count) & MPIR_COUNT_ALIGNMENT) == 0 )
- l$count = (MPI_Status *)(void*)v$count;
- else {
- MPI_Status_f2c( v$count, l$count );
- }
-";
- }
-}
-sub status_inout_ftoc {
- my $count = $_[0];
- status_in_ftoc( $count );
}
sub status_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
if ($within_fint) {
my $testFlag = "";
if (defined($condition) && $condition ne "") {
@@ -2574,58 +2529,24 @@ sub status_out_ctof {
print $OUTFD
" if ($testFlag$coutvar != MPI_STATUS_IGNORE && $errparmlval == MPI_SUCCESS) {
MPI_Status_c2f($coutvar,$outvar);
- }\n";
- }
- elsif ($fixStatusAlignment) {
- # only copy if Fortran is not properly aligned
- print $OUTFD "\
- if ($coutvar != MPI_STATUS_IGNORE && $errparmlval == MPI_SUCCESS && $outvar != (MPI_Fint*)$coutvar) {
- MPI_Status_c2f($coutvar,$outvar);
- }\n";
+ }\n"
}
}
sub status_in_decl {
my $count = $_[0];
- if ($within_fint || $fixStatusAlignment) {
+ if ($within_fint) {
print $OUTFD " MPI_Status vtmp$count, *l$count = &vtmp$count;\n";
}
}
sub status_out_decl {
my $count = $_[0];
- if ($within_fint || $fixStatusAlignment) {
- print $OUTFD " MPI_Status vtmp$count, *l$count = &vtmp$count;\n";
- }
-}
-sub status_inout_decl {
- my $count = $_[0];
- if ($within_fint || $fixStatusAlignment) {
+ if ($within_fint) {
print $OUTFD " MPI_Status vtmp$count, *l$count = &vtmp$count;\n";
}
}
-sub status_out_ftoc {
- my $count = $_[0];
- if ($fixStatusAlignment) {
- # The first (void *) cast helps suppress compiler warnings about
- # casting to a pointer with greater alignment (and which the
- # specific runtime check is used to ensure the alignments are
- # ok).
- # Horrible requirement: MPI Standard (see MPI-3, Section 3.2.5,
- # page 30, lines 39-43) implies that the MPI_ERROR field needs
- # to be *preserved*. Thus, if we have a temp status, we need to
- # either copy it to the temp status (as here) or *not* copy over
- # it when storing the result. This is simpler.
- print $OUTFD "\
- if (l$count != MPI_STATUS_IGNORE) {
- if ((((MPI_Aint)v$count) & MPIR_COUNT_ALIGNMENT) == 0)
- l$count = (MPI_Status*)(void *)v$count;
- else
- l$count->MPI_ERROR = ((MPI_Status*)(void*)v$count)->MPI_ERROR;
- }\n";
- }
-}
sub status_out_arg {
my $count = $_[0];
- if ($within_fint|| $fixStatusAlignment) {
+ if ($within_fint) {
print $OUTFD "l$count";
}
else {
@@ -2634,16 +2555,7 @@ sub status_out_arg {
}
sub status_in_arg {
my $count = $_[0];
- if ($within_fint || $fixStatusAlignment) {
- print $OUTFD "l$count";
- }
- else {
- print $OUTFD "(MPI_Status *)(v$count)";
- }
-}
-sub status_inout_arg {
- my $count = $_[0];
- if ($within_fint || $fixStatusAlignment) {
+ if ($within_fint) {
print $OUTFD "l$count";
}
else {
@@ -2693,7 +2605,6 @@ sub errcodesignore_out_ftoc {
sub errcodesignore_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
if ($within_fint) {
$asize = $Array_size;
@@ -2737,7 +2648,7 @@ sub status_array_out_fnulltoc {
&specialInitStatement( $OUTFD );
my $varname = "v";
my $varcast = "(MPI_Fint *)";
- if ($within_fint || $fixStatusAlignment) { $varname = "l"; $varcast = ""; }
+ if ($within_fint) { $varname = "l"; $varcast = ""; }
print $OUTFD "\
if (v$count == MPI_F_STATUSES_IGNORE) { $varname$count = ${varcast}MPI_STATUSES_IGNORE; }\n";
}
@@ -2755,26 +2666,11 @@ sub status_array_out_ftoc {
l$count\[li].MPI_ERROR = ((MPI_Status*)(void*)v$count)[li].MPI_ERROR;
}\n";
}
- elsif ($fixStatusAlignment) {
- print $OUTFD "\
- if (l$count != MPI_STATUSES_IGNORE) {
- if( (((MPI_Aint)v$count) & MPIR_COUNT_ALIGNMENT) == 0)
- l$count = (MPI_Status*)(void *)v$count;
- else {
- int li;
- lalloc$count = 1;
- l$count = (MPI_Status*)$malloc($Array_size * sizeof(MPI_Status));
- for (li=0; li<$Array_size; li++)
- l$count\[li].MPI_ERROR = ((MPI_Status*)(void*)v$count)[li].MPI_ERROR;
- }
- }\n";
- }
}
sub status_array_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
if ($within_fint) {
my $ActSize = $Array_size;
@@ -2794,38 +2690,17 @@ sub status_array_ctof {
}\n";
$clean_up .= " if ($coutvar != MPI_STATUSES_IGNORE) { $free($coutvar); }\n";
}
- elsif ($fixStatusAlignment) {
- my $ActSize = $Array_size;
- if (defined($nativeType) && $nativeType ne "") {
- $ActSize = $nativeType;
- }
- my $testFlag = "";
- if (defined($condition) && $condition ne "") {
- $testFlag = "$condition && "
- }
- print $OUTFD
-" if (${testFlag}lalloc$count) {
- int li;
- for (li=0; li<$ActSize; li++) {
- MPI_Status_c2f($coutvar+li,$outvar+li*MPIF_STATUS_SIZE);
- }
- }\n";
- $clean_up .= " if (lalloc$count) { $free($coutvar); }\n";
- }
}
sub status_array_out_decl {
my $count = $_[0];
if ($within_fint) {
print $OUTFD " MPI_Status *l$count=0;\n";
- }
- elsif ($fixStatusAlignment) {
- print $OUTFD " MPI_Status *l$count=0;\n int lalloc$count=0;\n";
}
}
sub status_array_out_arg {
my $count = $_[0];
- if ($within_fint || $fixStatusAlignment) {
+ if ($within_fint) {
print $OUTFD "l$count";
}
else {
@@ -2837,7 +2712,6 @@ sub status_array_out_arg {
sub aintToInt_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
print $OUTFD " if ($errparmlval == MPI_SUCCESS) *$outvar = (MPI_Fint)($coutvar);\n";
}
sub aintToInt_out_decl {
@@ -2875,7 +2749,6 @@ sub fint2int_ftoc {
sub fint2int_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
if ($within_fint) {
print $OUTFD " if ($errparmlval == MPI_SUCCESS) *$outvar = (MPI_Fint)$coutvar;\n";
}
@@ -2991,7 +2864,6 @@ sub fint2int_array_out_ftoc {
sub fint2int_array_out_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
if ($within_fint) {
my $asize = $Array_size;
if ($Array_size =~ /_commsize/) {
@@ -3225,16 +3097,16 @@ sub print_post_call {
$processing_routine = "${method}_${direction}_ctof";
# Prefer a specific choice matching the direction
if (defined(&$processing_routine)) {
- &$processing_routine( "l$count", "v$count", $count );
+ &$processing_routine( "l$count", "v$count" );
}
elsif ($direction eq "inout" &&
defined(&$processing_out_routine)) {
- &$processing_out_routine( "l$count", "v$count", $count );
+ &$processing_out_routine( "l$count", "v$count" );
}
else {
$processing_routine = "${method}_ctof";
if (defined(&$processing_routine)) {
- &$processing_routine( "l$count", "v$count", $count );
+ &$processing_routine( "l$count", "v$count" );
}
elsif ($direction ne "in") {
print STDERR "Missing $processing_routine for $routine_name\n";
@@ -3282,7 +3154,6 @@ sub blankpad_out_ftoc {
sub blankpad_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
# find the null character. Replace with blanks from there to the
# end of the string. The declared lenght is given by a variable
@@ -3325,7 +3196,6 @@ sub blankpadonflag_out_ftoc {
sub blankpadonflag_ctof {
my $coutvar = $_[0];
my $outvar = $_[1];
- my $count = $_[2];
# find the null character. Replace with blanks from there to the
# end of the string. The declared lenght is given by a variable
@@ -3649,7 +3519,6 @@ sub intToAintArr_in_arg {
sub intToAintArr_in_ctof {
my $lname = $_[0];
my $vname = $_[1];
- my $count = $_[2];
print $OUTFD "
#ifdef HAVE_AINT_LARGER_THAN_FINT
if ($lname) { $free($lname); }
@@ -3695,7 +3564,6 @@ sub FileToFint_out_decl {
sub FileToFint_ctof {
my $lvar = $_[0];
my $gvar = $_[1];
- my $count = $_[2];
print $OUTFD " *$gvar = MPI_File_c2f($lvar);\n";
}
sub FileToFint_out_arg {
@@ -4710,7 +4578,6 @@ print $OUTFD "\
return MPIR_Err_return_comm( 0, \"MPI_Status_f2c\", mpi_errno );
}\n";
if ($do_fint) {
- #FIXME: Invalid alignment assumptions on MPI_Count field.
print $OUTFD "\
#ifdef HAVE_FINT_IS_INT
*c_status = *(MPI_Status *) f_status;
@@ -4749,11 +4616,7 @@ print $OUTFD "\
#include \"mpi_fortimpl.h\"
/* mpierrs.h and mpierror.h for the error code creation */
#include \"mpierrs.h\"
-#include <stdio.h>\n";
- if ($fixStatusAlignment) {
- print $OUTFD "#include <string.h>\n";
- }
- print $OUTFD "\
+#include <stdio.h>
#include \"mpierror.h\"
/* -- Begin Profiling Symbol Block for routine MPI_Status_c2f */
@@ -4789,8 +4652,6 @@ int MPI_Status_c2f( const MPI_Status *c_status, MPI_Fint *f_status )
return MPIR_Err_return_comm( 0, \"MPI_Status_c2f\", mpi_errno );
}\n";
if ($do_fint) {
- #FIXME: Copy to f_status of MPI_Count data makes invalid alignment
- # data.
print $OUTFD "\
#ifdef HAVE_FINT_IS_INT
*(MPI_Status *)f_status = *c_status;
@@ -4803,24 +4664,14 @@ int MPI_Status_c2f( const MPI_Status *c_status, MPI_Fint *f_status )
#endif\n";
}
else {
- if ($fixStatusAlignment) {
- # Within this routine, MPI_STATUS_IGNORE is invalid
- print $OUTFD "\
- if ( (((MPI_Aint)f_status) & MPIR_COUNT_ALIGNMENT) == 0 )
- *(MPI_Status*)(void *)f_status = *c_status;
- else
- memcpy(f_status,c_status,sizeof(MPI_Status));
- \n";
- }
- else {
- print $OUTFD " *(MPI_Status *)f_status = *c_status;\n";
- }
+ print $OUTFD " *(MPI_Status *)f_status = *c_status;\n";
}
print $OUTFD "
return MPI_SUCCESS;
}\n";
close ($OUTFD);
&ReplaceIfDifferent( $filename, $filename . ".new" );
+
}
sub print_mpif_int {
http://git.mpich.org/mpich.git/commitdiff/fc20de53bea92d4997439c807acf3ca7f…
commit fc20de53bea92d4997439c807acf3ca7f31d09f7
Author: William Gropp <wgropp(a)illinois.edu>
Date: Wed Oct 23 16:53:33 2013 -0500
Force ordering of functions in C++ binding
This selects the buildiface option that specifies a specific ordering
of the routines in mpicxx.h(.in) in order to provide ABI consistency.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/autogen.sh b/autogen.sh
index fc36562..97b84cb 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -722,7 +722,7 @@ if [ $do_bindings = "yes" ] ; then
if [ $build_cxx = "yes" ] ; then
echo_n "Building C++ interface... "
( cd src/binding/cxx && chmod a+x ./buildiface &&
- ./buildiface -nosep $otherarg )
+ ./buildiface -nosep -initfile=cxx.vlist $otherarg )
echo "done"
fi
fi
http://git.mpich.org/mpich.git/commitdiff/db07b81b46f186ab353482e9208dc4e5c…
commit db07b81b46f186ab353482e9208dc4e5c4be05c0
Author: William Gropp <wgropp(a)illinois.edu>
Date: Wed Oct 23 15:00:32 2013 -0500
Eliminate test for C++ Distgraphcomm routines
For MPICH builds, eliminate the C++ distgraphcomm test. In other cases
test for presense of MPI::Distgraphcomm and only include the test if
available.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/test/mpi/.gitignore b/test/mpi/.gitignore
index 0a49c65..30a5864 100644
--- a/test/mpi/.gitignore
+++ b/test/mpi/.gitignore
@@ -122,6 +122,7 @@
/comm/dupic
/comm/ctxalloc
/cxx/testlist
+/cxx/topo/testlist
/cxx/coll/uallreduce
/cxx/coll/ureduce
/cxx/coll/uscan
diff --git a/test/mpi/configure.ac b/test/mpi/configure.ac
index ed5e4e7..b800b14 100644
--- a/test/mpi/configure.ac
+++ b/test/mpi/configure.ac
@@ -1148,11 +1148,18 @@ if test "$enable_cxx" = yes ; then
fi
# Simple tests for which other languages we can handle
cxxdir="#"
+# The C++ interface added support for the Distgraph routines in MPI-2.2,
+# but not all MPI implementations support that. nocxxdistgraph allows
+# us to detect that and to skip the test when it is not supported.
+nocxxdistgraph="#"
AC_SUBST(cxxdir)
if test "$FROM_MPICH" = yes ; then
if test "$enable_cxx" = yes ; then
otherlangs="$otherlangs cxx"
cxxdir=cxx
+ # MPICH ABI removed support for MPI::Distgraphcomm, so
+ # nocxxdistgraph is left as #, which comments out the test
+ # in cxx/topol/testlist.in
fi
elif test "$enable_cxx" = yes ; then
AC_MSG_CHECKING([that we can build MPI programs with C++])
@@ -1171,8 +1178,29 @@ elif test "$enable_cxx" = yes ; then
],[
AC_MSG_RESULT(no)
])
+ # Check for support of the Distgraphcomm, added in MPI 2.2.
+ # Some MPI implementations may support MPI 2.2 or MPI 3.x, but not
+ # support the Distgraphcomm C++ interface
+ AC_MSG_CHECKING([whether MPI C++ includes Distgraphcomm])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([
+#include "mpi.h"
+ ],[
+ MPI::Distgraphcomm dcomm;
+ MPI::Init();
+ MPI::Finalize();
+ ])
+ ],[
+ AC_MSG_RESULT(yes)
+ nocxxdistgraph=""
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
AC_LANG_POP([C++])
fi
+AC_SUBST(nocxxdistgraph)
+
if test "$enable_cxx" = yes ; then
AC_CACHE_CHECK([whether <iostream> available],pac_cv_cxx_has_iostream,[
AC_LANG_PUSH([C++])
@@ -1520,6 +1548,7 @@ AC_OUTPUT(maint/testmerge \
perf/Makefile \
testlist \
cxx/testlist \
+ cxx/topo/testlist \
f77/testlist \
f90/testlist \
threads/testlist \
diff --git a/test/mpi/cxx/topo/testlist b/test/mpi/cxx/topo/testlist
deleted file mode 100644
index 5f2f4cb..0000000
--- a/test/mpi/cxx/topo/testlist
+++ /dev/null
@@ -1 +0,0 @@
-distgraphcxx 8
diff --git a/test/mpi/cxx/topo/testlist.in b/test/mpi/cxx/topo/testlist.in
new file mode 100644
index 0000000..330e3d9
--- /dev/null
+++ b/test/mpi/cxx/topo/testlist.in
@@ -0,0 +1 @@
+@nocxxdistgraph@distgraphcxx 8
http://git.mpich.org/mpich.git/commitdiff/098844117410cecab7d9a1c2e62955410…
commit 098844117410cecab7d9a1c2e6295541076c7376
Author: William Gropp <wgropp(a)illinois.edu>
Date: Wed Oct 23 14:58:28 2013 -0500
Remove support for MPI::Distgraphcomm
Enhanced cxx/buildiface to output support for Distgraphcomm only if
requested through the feature interface. Distgraphcomm was added
only in MPI 2.2 and for historical reasons is not part of the
MPICH ABI.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/binding/cxx/buildiface b/src/binding/cxx/buildiface
index 2c4b24d..3be7c08 100755
--- a/src/binding/cxx/buildiface
+++ b/src/binding/cxx/buildiface
@@ -1178,12 +1178,10 @@ class Intracomm;
class Cartcomm;
class Graphcomm;\n";
if ($do_DistGraphComm) {
- print $OUTFD "class Distgraphcomm;\n"
+ print $OUTFD "class Distgraphcomm;\n";
}
print $OUTFD "class File;\n\n";
-
-
#
# Add the base routines. Since these are not in any class, we
# place only their prototype in the header file. The
@@ -1310,7 +1308,7 @@ typedef int MPI_File;\
# Add a few more external functions (some require the above definitions)
@routines = keys(%class_mpi2base);
- if (defined(@routinesMpi2base)) {
+ if (defined(@routinesMpi2base)) {
@routines = @routinesMpi2base;
}
if ($outputRoutineLists) {
@@ -1965,7 +1963,7 @@ extern Datatype TWOINTEGER;
}
# Predefined integers
- foreach $int (BSEND_OVERHEAD, KEYVAL_INVALID, CART, GRAPH, DIST_GRAPH,
+ foreach $int (BSEND_OVERHEAD, KEYVAL_INVALID, CART, GRAPH,
IDENT, SIMILAR, CONGRUENT, UNEQUAL, PROC_NULL,
ANY_TAG, ANY_SOURCE, ROOT, TAG_UB, IO, HOST, WTIME_IS_GLOBAL,
UNIVERSE_SIZE, LASTUSEDCODE, APPNUM,
@@ -1977,6 +1975,11 @@ extern Datatype TWOINTEGER;
@errclasses, @typeclasses ) {
print $OUTFD "${extern}const int $int";
if ($giveValue) { print $OUTFD "= MPI_$int;\n"; }
+ else { print $OUTFD ";\n"; }
+ }
+ if ($do_DistGraphComm) {
+ print $OUTFD "${extern}const int DIST_GRAPH";
+ if ($giveValue) { print $OUTFD "= MPI_$int;\n"; }
else { print $OUTFD ";\n"; }
}
# Handle seek as a special case
@@ -2380,15 +2383,20 @@ MPIR_Comm_delete_attr_cxx_proxy(
MPI::Graphcomm c = comm;
return f( c, keyval, value, extra_state );
}
-#ifdef HAVE_CXX_DISTGRAPH_COMM
+EOT
+
+if ($do_DistGraphComm) {
+ print $OUTFD <<EOT;
else
{
MPI::Distgraphcomm c = comm;
return f( c, keyval, value, extra_state );
}
-#endif
+EOT
}
+ print $OUTFD <<EOT;
+}
static
int
MPIR_Comm_copy_attr_cxx_proxy(
@@ -2440,15 +2448,19 @@ MPIR_Comm_copy_attr_cxx_proxy(
MPI::Graphcomm c = comm;
return f( c, keyval, extra_state, value, new_value, *(bool*)flag );
}
-#ifdef HAVE_CXX_DISTGRAPH_COMM
- else
+EOT
+
+if ($do_DistGraphComm) {
+ print $OUTFD <<EOT;
+else
{
MPI::Distgraphcomm c = comm;
return f( c, keyval, extra_state, value, new_value, *(bool*)flag );
}
-#endif
+EOT
+}
+ print $OUTFD <<EOT;
}
-
int Comm::Create_keyval( Copy_attr_function *cf, Delete_attr_function *df, void *extra_state )
{
@@ -3875,8 +3887,8 @@ sub PrintRoutineDef {
# Hideous hack. To preserve ABI compatibility, for one particular
# case for Create struct, remove the const values
- if ($routine eq "Create_struct" && $arginfo eq "static:5:4") {
- print "$cArgs\n";
+ if ($routine eq "Create_struct" && $arginfo eq "static:5:4") {
+ #print "$cArgs\n";
$cDefArgs = $cArgs;
$cDefArgs =~ s/const\s+//g;
}
@@ -3884,7 +3896,7 @@ sub PrintRoutineDef {
$cDefArgs = $cArgs;
}
- &PrintMethodDef( $OUTFD, $class, $routine, $arginfo, $cDefArgs );
+ &PrintMethodDef( $OUTFD, $class, $routine, $arginfo, $cDefArgs );
# This inserts a modifier, such as const or =0 (for pure virtual)
if (defined($funcAttributes{$fnchash})) {
http://git.mpich.org/mpich.git/commitdiff/5f8c172b612112266264c8444a12ceea6…
commit 5f8c172b612112266264c8444a12ceea62393d31
Author: William Gropp <wgropp(a)illinois.edu>
Date: Mon Oct 21 14:27:47 2013 -0500
Detect unknown feature request
Improve buildiface for C++ to detect an unknown feature request with
the -feature= option and abort.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/binding/cxx/buildiface b/src/binding/cxx/buildiface
index 5e2d20a..2c4b24d 100755
--- a/src/binding/cxx/buildiface
+++ b/src/binding/cxx/buildiface
@@ -127,6 +127,9 @@ foreach $_ (@ARGV) {
elsif ($value eq "off") { $value = 0; }
# Set the variable based on the string
$varname = "do_$name";
+ if (!defined($$varname)) {
+ die "Feature $name is unknown!\n";
+ }
$$varname = $value;
}
}
http://git.mpich.org/mpich.git/commitdiff/756f1cd656ebe029e819c9abf67c0b53f…
commit 756f1cd656ebe029e819c9abf67c0b53fe960336
Author: William Gropp <wgropp(a)illinois.edu>
Date: Mon Oct 21 11:39:59 2013 -0500
Add option to remove distgraph support in C++
In support of the standard ABI, this change allows us to provide the
Distgraphcomm support defined in MPI 2.2, as well as support the ABI,
which only supports MPI 2.1. This change is not complete in itself;
another commit is needed to select the ABI level in configure.
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/binding/cxx/buildiface b/src/binding/cxx/buildiface
index 2ef0cae..5e2d20a 100755
--- a/src/binding/cxx/buildiface
+++ b/src/binding/cxx/buildiface
@@ -85,10 +85,13 @@ $print_line_len = 0;
$gDebug = 0;
$gDebugRoutine = "NONE";
@mpilevels = ( 'mpi1' , 'mpi2' );
-#feature variables
+# feature variables (for the -feature commandline option)
$do_subdecls = 1;
+
+# Other features
$doCoverage = 0;
$doFuncspec = 1;
+$do_DistGraphComm = 0;
$outputRoutineLists = 0;
# Process environment variables
@@ -100,9 +103,9 @@ if (defined($ENV{"CXX_COVERAGE"}) && $ENV{"CXX_COVERAGE"} eq "yes") {
# Process arguments
#
# Args
-# -feature={logical,fint,subdecls,weak,bufptr}, separated by :, value given
+# -feature={subdecls}, separated by :, value given
# by =on or =off, eg
-# -feature=logical=on:fint=off
+# -feature=subdecls=on:fint=off
# The feature names mean:
# subdecls - Declarations for PC-C++ compilers added
# -routines=name - provide a list of routines or a file that
@@ -338,9 +341,10 @@ $specialReturnType{"cart-Split"} = "Cartcomm";
);
$specialReturnType{"graph-Dup"} = "Graphcomm";
$specialReturnType{"graph-Split"} = "Graphcomm";
-$specialReturnType{"distgraph-Dup"} = "Distgraphcomm";
-$specialReturnType{"distgraph-Split"} = "Distgraphcomm";
-
+if ($do_DistGraphComm) {
+ $specialReturnType{"distgraph-Dup"} = "Distgraphcomm";
+ $specialReturnType{"distgraph-Split"} = "Distgraphcomm";
+}
# Range routines will require special handling
# The Translate_ranks, Union, Intersect, Difference, and Compare routines are
@@ -689,9 +693,13 @@ if ($build_io) {
'win',
'file',
'graph',
- 'distgraph',
+# 'distgraph',
'cart',
);
+if ($do_DistGraphComm) {
+ $classes[$#classes+1] = 'distgraph';
+}
+
#
# Some classes have additional methods. This hash on the classes (by
@@ -705,7 +713,7 @@ if ($build_io) {
'inter' => 'Intercomm_methods',
'intra' => 'Intracomm_methods',
'graph' => 'Graphcomm_methods',
- 'distgraph' => 'Distgraphcomm_methods',
+# 'distgraph' => 'Distgraphcomm_methods',
'cart' => 'Cartcomm_methods',
'dtype' => 'Datatype_methods',
'op' => 'Op_methods',
@@ -713,6 +721,9 @@ if ($build_io) {
'win' => 'Win_methods',
'greq' => 'Grequest_methods',
);
+if ($do_DistGraphComm) {
+ $class_extra_fnc{'distgraph'} = 'Distgraphcomm_methods';
+}
# ----------------------------------------------------------------------------
# If there is a specific list of routines, replace the list with this
@@ -837,7 +848,7 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
'errh' => MPI_Errhandler,
'null' => MPI_Comm,
'graph' => MPI_Comm,
- 'distgraph' => MPI_Comm,
+# 'distgraph' => MPI_Comm,
'group' => MPI_Group,
'inter' => MPI_Comm,
'intra' => MPI_Comm,
@@ -851,6 +862,10 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
'file' => MPI_File,
'except' => 'int',
);
+if ($do_DistGraphComm) {
+ $class_type{'distgraph'} = 'MPI_Comm';
+}
+
#
# fullclassname gives the C++ binding class name for each shorthand version
%fullclassname = ( 'comm' => 'Comm',
@@ -858,7 +873,7 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
'dtype' => 'Datatype',
'errh' => 'Errhandler',
'graph' => 'Graphcomm',
- 'distgraph' => 'Distgraphcomm',
+# 'distgraph' => 'Distgraphcomm',
'group' => 'Group',
'null' => 'Nullcomm',
'inter' => 'Intercomm',
@@ -873,7 +888,9 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
'file' => 'File',
'except' => 'Exception',
);
-
+if ($do_DistGraphComm) {
+ $fullclassname{'distgraph'} = 'Distgraphcomm';
+}
#
# Each class may need to access internal elements of another class.
# This has gives the list of friends for each class (i.e., the
@@ -898,12 +915,16 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
'win' => '',
'file' => '',
);
-
+if (!$do_DistGraphComm) {
+ # Remove Distgraphcomm from the friends list
+ $class_friends{'comm'} = 'Cartcomm,Intercomm,Intracomm,Graphcomm,Nullcomm,Datatype,Win,File';
+ $class_friends{'intra'} = 'Cartcomm,Graphcomm,Datatype';
+}
#
# We also need to know the derived classes. This gives the class that
# a class is derived from. Base classes are not included here.
%derived_class = ( 'graph' => 'Intracomm',
- 'distgraph' => 'Intracomm',
+ # 'distgraph' => 'Intracomm',
'preq' => 'Request',
'greq' => 'Request',
'null' => 'Comm',
@@ -911,6 +932,9 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
'intra' => 'Comm',
'cart' => 'Intracomm',
);
+if ($do_DistGraphComm) {
+ $derived_class{'distgraph'} = 'Intracomm';
+}
#
# Maps all of the derived classes to their ultimate parent. This is
@@ -918,8 +942,8 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
# used to store the C version of the class handle.
%mytopclass = ( 'graph' => 'comm',
'graphcomm' => 'comm',
- 'distgraph' => 'comm',
- 'distgraphcomm' => 'comm',
+# 'distgraph' => 'comm',
+# 'distgraphcomm' => 'comm',
'nullcomm' => 'comm',
'intracomm' => 'comm',
'intercomm' => 'comm',
@@ -931,6 +955,10 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
'prequest' => 'request',
'greq' => 'request',
'preq' => 'request' );
+if ($do_DistGraphComm) {
+ $mytopclass{'distgraph'} = 'comm';
+ $mytopclass{'distgraphcomm'} = 'comm';
+}
#
# Many of the C++ binding names are easily derived from the C name.
@@ -1026,12 +1054,18 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
'graph-Get_neighbors_count' => 'Graph_neighbors_count',
'graph-Get_dims' => 'Graphdims_get',
'graph-Dup' => 'Comm_dup',
- 'distgraph-Dup' => 'Comm_dup',
- 'distgraph-Get_dist_neighbors' => 'Dist_graph_neighbors',
- 'distgraph-Get_dist_neighbors_count' => 'Dist_graph_neighbors_count',
+# 'distgraph-Dup' => 'Comm_dup',
+# 'distgraph-Get_dist_neighbors' => 'Dist_graph_neighbors',
+# 'distgraph-Get_dist_neighbors_count' => 'Dist_graph_neighbors_count',
'op-Is_commutative' => 'Op_commutative',
'op-Reduce_local' => 'Reduce_local',
);
+if ($do_DistGraphComm) {
+ $altname{'distgraph-Dup'} = 'Comm_dup';
+ $altname{'distgraph-Get_dist_neighbors'} = 'Dist_graph_neighbors';
+ $altname{'distgraph-Get_dist_neighbors_count'} =
+ 'Dist_graph_neighbors_count';
+}
# These routines must be defered because their implementations need
# definitions of classes that must be made later than the class that they
@@ -1050,9 +1084,13 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
'Nullcomm' => 1,
'Cartcomm' => 1,
'Graphcomm' => 1,
- 'Distgraphcomm' => 1,
+# 'Distgraphcomm' => 1,
'Prequest' => 1,
);
+if ($do_DistGraphComm) {
+ $class_has_no_compare{'Distgraphcomm'} = 1;
+}
+
# These classes do not have a default intialization
# These use the Full class name
%class_has_no_default = ( 'Status' => 1 );
@@ -1135,10 +1173,12 @@ class Nullcomm;
class Intercomm;
class Intracomm;
class Cartcomm;
-class Graphcomm;
-class Distgraphcomm;
-class File;
-\n";
+class Graphcomm;\n";
+if ($do_DistGraphComm) {
+ print $OUTFD "class Distgraphcomm;\n"
+}
+print $OUTFD "class File;\n\n";
+
#
@@ -2337,11 +2377,13 @@ MPIR_Comm_delete_attr_cxx_proxy(
MPI::Graphcomm c = comm;
return f( c, keyval, value, extra_state );
}
+#ifdef HAVE_CXX_DISTGRAPH_COMM
else
{
MPI::Distgraphcomm c = comm;
return f( c, keyval, value, extra_state );
}
+#endif
}
static
@@ -2395,11 +2437,13 @@ MPIR_Comm_copy_attr_cxx_proxy(
MPI::Graphcomm c = comm;
return f( c, keyval, extra_state, value, new_value, *(bool*)flag );
}
+#ifdef HAVE_CXX_DISTGRAPH_COMM
else
{
MPI::Distgraphcomm c = comm;
return f( c, keyval, extra_state, value, new_value, *(bool*)flag );
}
+#endif
}
@@ -2869,6 +2913,7 @@ void Datatype::Unpack( const void *inbuf, int insize, void *outbuf,
return v6;
}\n";
+ if ($do_DistGraphComm) {
print $OUTFD "\
Distgraphcomm Intracomm::Dist_graph_create( int v2, const int v3[], const int v4[], const int v5[], const int v6[], const MPI::Info &v7, bool v8 ) const
{
@@ -2934,6 +2979,7 @@ void Datatype::Unpack( const void *inbuf, int insize, void *outbuf,
return v10;
}\n";
+ } # check on distgraphcomm implemented
print $OUTFD "\
Intracomm Intercomm::Merge( bool v2 ) const
@@ -3671,6 +3717,7 @@ Intercomm Spawn_multiple(int count, const char* array_of_commands[], const char*
";
+ if ($do_DistGraphComm) {
# Because there are two versions of each of the dist graph
# create routines (fewer arguments for the case that uses
# MPI_UNWEIGHTED in C or Fortran), we must define these explicitly
@@ -3684,7 +3731,7 @@ Intercomm Spawn_multiple(int count, const char* array_of_commands[], const char*
virtual Distgraphcomm Dist_graph_create_adjacent( int v2, const int v3[], int v5, const int v6[], const MPI::Info &v8, bool v9 ) const;
\n";
-
+ }
}
sub Op_methods {
@@ -4165,6 +4212,11 @@ sub PrintRoutineCall {
my $useThis = 0;
my $TYPE = "OBJ", $obj = "COMM_WORLD";
+ if (!$do_DistGraphComm) {
+ if ($class eq "distgraph") {
+ die "PANIC: unexpected distgraph class when distgraph support disabled";
+ }
+ }
if ($class eq "comm" || $class eq "inter" || $class eq "intra" ||
$class eq "cart" || $class eq "graph" || $class eq "distgraph") {
$useThis = 1;
http://git.mpich.org/mpich.git/commitdiff/da9e5e5a428535b39dff43fcf9d431f0d…
commit da9e5e5a428535b39dff43fcf9d431f0d2bd4ab1
Author: William Gropp <wgropp(a)illinois.edu>
Date: Tue Oct 8 15:51:38 2013 -0500
Change buildiface for C++ to control output order
Add a way to output the order of function output in mpicxx.h.in file
and a way to read in a file specifying the order. This is used to
meet ABI needs. Also fixed some old MPI_xxx vs MPI::xxx cases, and
the almost duplicated Create_struct call. All in a single commit
because the test was against the proposed ABI mpicxx.h.in file
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/binding/cxx/buildiface b/src/binding/cxx/buildiface
index bd112f0..2ef0cae 100755
--- a/src/binding/cxx/buildiface
+++ b/src/binding/cxx/buildiface
@@ -55,6 +55,13 @@
# will have the correct type and some C++ compilers don't recognize NULL
# unless you include header files that needed it and are otherwise unneeded
# by the C++ interface)
+#
+# To fix the order of virtual methods, the arrays
+# @routinesMpi1base
+# @routinesMpi2base
+# @routines<classname>
+# may be defined. If these are not defined, then the order will be determined
+# by the perl implementation of the "keys" function.
#
# TODO:
# The derived classes (such as Intracomm) must *not* have their own
@@ -82,6 +89,8 @@ $gDebugRoutine = "NONE";
$do_subdecls = 1;
$doCoverage = 0;
$doFuncspec = 1;
+$outputRoutineLists = 0;
+
# Process environment variables
# CXX_COVERAGE - yes : turn on coverage code
if (defined($ENV{"CXX_COVERAGE"}) && $ENV{"CXX_COVERAGE"} eq "yes") {
@@ -99,7 +108,12 @@ if (defined($ENV{"CXX_COVERAGE"}) && $ENV{"CXX_COVERAGE"} eq "yes") {
# -routines=name - provide a list of routines or a file that
# lists the routines to use. The names must be in the same form as the
# the class_xxx variables. E.g., comm-Send, dtype-Commit.
+# -routinelist - output files containing the routines to output in the
+# classes (mostly as virtual functions) and the order in which they are output
+# This can be used to change the output order if it is desired to specify
+# a particular order.
$routine_list = "";
+$initFile = "";
foreach $_ (@ARGV) {
if (/--?feature=(.*)/) {
foreach $feature (split(/:/,$1)) {
@@ -125,7 +139,9 @@ foreach $_ (@ARGV) {
elsif (/--?routines=(.*)/) {
$routine_list = $1;
}
- elsif (/--?coverage/) { &setCoverage( 1 ); }
+ elsif (/--?routinelist/) { $outputRoutineLists = 1; }
+ elsif (/--?initfile=(.*)/) { $initFile = $1; }
+ elsif (/--?coverage/) { &setCoverage( 1 ); }
elsif (/--?nocoverage/) { &setCoverage( 0 ); }
else {
print STDERR "Unrecognized argument $_\n";
@@ -133,6 +149,10 @@ foreach $_ (@ARGV) {
}
if (! -d "../../mpi/romio") { $build_io = 0; }
+
+if ($initFile ne "" && -f $initFile) {
+ do $initFile;
+}
# ----------------------------------------------------------------------------
#
# The following hashes define each of the methods that belongs to each class.
@@ -292,11 +312,14 @@ $specialReturnType{"cart-Dup"} = "Cartcomm";
$specialReturnType{"cart-Sub"} = "Cartcomm";
$specialReturnType{"cart-Split"} = "Cartcomm";
-# Create_struct, Pack, and Unpack are handled through definitions elsewhere
+# Pack, and Unpack are handled through definitions elsewhere
+# Create_struct is also handled through definitions elsewhere, but for
+# compatibility with some previous versions, a slightly different
+# declaration is generated for this class.
%class_mpi1dtype = ( 'Create_contiguous' => 'MPI_Datatype',
'Create_vector' => 'MPI_Datatype',
'Create_indexed' => 'MPI_Datatype',
-# 'Create_struct' => 'static:5:4',
+ 'Create_struct' => 'static:5:4',
'Get_size' => 2,
'Commit' => 0,
'Free' => 0,
@@ -1126,12 +1149,25 @@ class File;
# and we'll want to use a few of them in the implementations of the
# other functions.
print $OUTFD "// base (classless) routines\n";
-foreach $routine (keys(%class_mpi1base)) {
+@routines = keys(%class_mpi1base);
+if (defined(@routinesMpi1base)) {
+ @routines = @routinesMpi1base;
+}
+if ($outputRoutineLists) {
+ open (FD, ">order.mpi1base.txt" );
+ print FD "\@routinesMpi1base = (\n";
+}
+foreach $routine (@routines) {
+ print FD "\t\"$routine\",\n" if ($outputRoutineLists);
# These aren't really a class, so they don't use Begin/EndClass
$arginfo = $class_mpi1base{$routine};
print $OUTFD "extern ";
&PrintRoutineDef( $OUTFD, "base", $routine, $arginfo, 1 );
}
+if ($outputRoutineLists) {
+ print FD ");\n";
+ close (FD);
+}
# Forward references for externals, used in error handling
print $OUTFD "extern Intracomm COMM_WORLD;\n";
@@ -1178,13 +1214,23 @@ typedef int MPI_File;\
foreach $mpilevel (@mpilevels) {
$mpiclass = "$mpilevel$class";
$class_hash = "class_$mpiclass";
- foreach $routine (keys(%$class_hash)) {
- print "processing $routine\n" if $gDebug;
-
+ @routines = keys(%$class_hash);
+ $arrname = "routines$mpiclass";
+ if (defined(@$arrname)) {
+ @routines = @$arrname;
+ }
+ if ($#routines < 0) { next; }
+ if ($outputRoutineLists) {
+ open (FD, ">order.$arrname.txt" );
+ print FD "\@$arrname = (\n";
+ }
+ foreach $routine (@routines) {
+ print "processing $routine in $mpiclass\n" if $gDebug;
+ print FD "\t\"$routine\",\n" if ($outputRoutineLists);
# info describes the return parameter and any special
# processing for this routine.
$arginfo = $$class_hash{$routine};
-
+ print "Arginfo is $arginfo\n" if $gDebug;
&PrintRoutineDef( $OUTFD, $class, $routine, $arginfo, 0 );
# Check for Status as an arg (handle MPI_STATUS_IGNORE
@@ -1194,6 +1240,10 @@ typedef int MPI_File;\
$routine, $arginfo, 0 );
}
}
+ if ($outputRoutineLists) {
+ print FD ");\n";
+ close (FD);
+ }
}
if (defined($class_extra_fnc{$class})) {
$extrafnc = $class_extra_fnc{$class};
@@ -1216,13 +1266,26 @@ typedef int MPI_File;\
}
# Add a few more external functions (some require the above definitions)
- foreach $routine (keys(%class_mpi2base)) {
- # These aren't really a class, so they don't use Begin/EndClass
+ @routines = keys(%class_mpi2base);
+ if (defined(@routinesMpi2base)) {
+ @routines = @routinesMpi2base;
+ }
+ if ($outputRoutineLists) {
+ open (FD, ">order.$arrname.txt" );
+ print FD "\@routinesMpi2base = (\n";
+ }
+ foreach $routine (@routines) {
+ print FD "\t\"$routine\",\n" if ($outputRoutineLists);
+ # These aren't really a class, so they don't use Begin/EndClass
$arginfo = $class_mpi2base{$routine};
print $OUTFD "extern ";
#print "$routine - $arginfo\n";
&PrintRoutineDef( $OUTFD, "base", $routine, $arginfo, 1 );
}
+ if ($outputRoutineLists) {
+ print FD ");\n";
+ close (FD);
+ }
# Special case: the typedefs for the datarep function
# Only define these typedefs when MPI-IO is available (this is the same
# test as used for the rest of the I/O routines );
@@ -1531,10 +1594,13 @@ sub print_args {
print STDERR "Internal error. Could not find basetype\n";
print STDERR "This may be a bug in perl in the handling of certain expressions\n";
}
+ # Convert C to C++ types
+ $cxxtype = $basetype;
+ $cxxtype =~ s/MPI_//;
if ($extrabracks =~ /(\[[\d\s]*\])/) {
$otherdims = $1;
}
- print $OUTFD "$qualifier$basetype v$count\[\]$otherdims";
+ print $OUTFD "$qualifier$cxxtype v$count\[\]$otherdims";
}
elsif ($parm =~ /\.\.\./) {
# Special case for varargs. Only ints!
@@ -3757,7 +3823,18 @@ sub PrintRoutineDef {
($cArgs, $Croutine) = &GetCArgs( $class, $routine );
- &PrintMethodDef( $OUTFD, $class, $routine, $arginfo, $cArgs );
+ # Hideous hack. To preserve ABI compatibility, for one particular
+ # case for Create struct, remove the const values
+ if ($routine eq "Create_struct" && $arginfo eq "static:5:4") {
+ print "$cArgs\n";
+ $cDefArgs = $cArgs;
+ $cDefArgs =~ s/const\s+//g;
+ }
+ else {
+ $cDefArgs = $cArgs;
+ }
+
+ &PrintMethodDef( $OUTFD, $class, $routine, $arginfo, $cDefArgs );
# This inserts a modifier, such as const or =0 (for pure virtual)
if (defined($funcAttributes{$fnchash})) {
diff --git a/src/binding/cxx/cxx.vlist b/src/binding/cxx/cxx.vlist
new file mode 100644
index 0000000..1d436d3
--- /dev/null
+++ b/src/binding/cxx/cxx.vlist
@@ -0,0 +1,319 @@
+@routinesMpi1base = (
+ "Detach_buffer",
+ "Is_initialized",
+ "Get_processor_name",
+ "Get_error_string",
+ "Compute_dims",
+ "Get_version",
+ "Finalize",
+ "Pcontrol",
+ "Attach_buffer",
+ "Get_error_class",
+);
+@routinesmpi1cart = (
+ "Get_coords",
+ "Get_cart_rank",
+ "Get_dim",
+ "Dup",
+ "Get_topo",
+ "Map",
+ "Sub",
+ "Shift",
+);
+@routinesmpi1comm = (
+ "Get_group",
+ "Get_rank",
+ "Bsend_init",
+ "Ssend_init",
+ "Is_inter",
+ "Rsend_init",
+ "Ibsend",
+ "Abort",
+ "Free",
+ "Send_init",
+ "Recv",
+ "Sendrecv",
+ "Sendrecv_replace",
+ "Get_topology",
+ "Isend",
+ "Probe",
+ "Compare",
+ "Get_size",
+ "Issend",
+ "Set_errhandler",
+ "Send",
+ "Irsend",
+ "Ssend",
+ "Recv_init",
+ "Iprobe",
+ "Bsend",
+ "Irecv",
+ "Get_errhandler",
+ "Rsend",
+);
+@routinesmpi1distgraph = (
+ "Get_dist_neighbors_count",
+ "Dup",
+);
+@routinesmpi1dtype = (
+ "Commit",
+ "Free",
+ "Create_indexed",
+ "Create_contiguous",
+ "Create_vector",
+ "Create_struct",
+ "Pack_size",
+ "Pack",
+ "Get_size",
+);
+@routinesmpi1errh = (
+ "Free",
+);
+@routinesmpi1graph = (
+ "Get_dims",
+ "Get_topo",
+ "Map",
+ "Get_neighbors",
+ "Get_neighbors_count",
+ "Dup",
+);
+@routinesmpi1group = (
+ "Excl",
+ "Get_rank",
+ "Free",
+ "Union",
+ "Intersect",
+ "Range_excl",
+ "Range_incl",
+ "Difference",
+ "Translate_ranks",
+ "Incl",
+ "Get_size",
+ "Compare",
+);
+@routinesmpi1inter = (
+ "Merge",
+ "Get_remote_group",
+ "Get_remote_size",
+ "Dup",
+);
+@routinesmpi1intra = (
+ "Create_intercomm",
+ "Split",
+ "Create_graph",
+ "Create_cart",
+ "Create",
+ "Dup",
+ "Scan",
+);
+@routinesmpi1op = (
+ "Free",
+);
+@routinesmpi1preq = (
+ "Start",
+ "Startall",
+);
+@routinesmpi1req = (
+ "Testany",
+ "Waitsome",
+ "Free",
+ "Testall",
+ "Wait",
+ "Testsome",
+ "Waitall",
+ "Waitany",
+ "Test",
+ "Cancel",
+);
+@routinesmpi1st = (
+ "Is_cancelled",
+ "Get_elements",
+ "Get_count",
+);
+@routinesMpi2base = (
+ "Add_error_class",
+ "Alloc_mem",
+ "Lookup_name",
+ "Publish_name",
+ "Unpublish_name",
+ "Get_address",
+ "Add_error_string",
+ "Query_thread",
+ "Close_port",
+ "Add_error_code",
+ "Free_mem",
+ "Open_port",
+ "Is_finalized",
+ "Is_thread_main",
+);
+@routinesmpi2comm = (
+ "Reduce_scatter_block",
+ "Gatherv",
+ "Disconnect",
+ "Allreduce",
+ "Alltoallw",
+ "Join",
+ "Alltoall",
+ "Get_attr",
+ "Barrier",
+ "Bcast",
+ "Set_attr",
+ "Set_name",
+ "Get_parent",
+ "Alltoallv",
+ "Reduce_scatter",
+ "Scatter",
+ "Call_errhandler",
+ "Gather",
+ "Free_keyval",
+ "Reduce",
+ "Allgather",
+ "Delete_attr",
+ "Scatterv",
+ "Get_name",
+ "Allgatherv",
+);
+@routinesmpi2distgraph = (
+ "Get_dist_neighbors",
+);
+@routinesmpi2dtype = (
+ "Get_envelope",
+ "Create_hvector",
+ "Match_size",
+ "Create_resized",
+ "Create_indexed_block",
+ "Pack_external_size",
+ "Dup",
+ "Create_hindexed",
+ "Get_attr",
+ "Get_true_extent",
+ "Create_darray",
+ "Create_f90_real",
+ "Get_contents",
+ "Set_attr",
+ "Set_name",
+ "Create_f90_complex",
+ "Create_subarray",
+ "Unpack_external",
+ "Free_keyval",
+ "Create_struct",
+ "Create_f90_integer",
+ "Pack_external",
+ "Get_extent",
+ "Delete_attr",
+ "Get_name",
+);
+@routinesmpi2file = (
+ "Get_type_extent",
+ "Read_ordered_end",
+ "Seek_shared",
+ "Read_ordered",
+ "Iread_shared",
+ "Get_info",
+ "Write_ordered_begin",
+ "Set_info",
+ "Write_ordered",
+ "Sync",
+ "Read",
+ "Write_all",
+ "Get_size",
+ "Write_all_end",
+ "Delete",
+ "Read_ordered_begin",
+ "Iread_at",
+ "Write_at_all_end",
+ "Get_position_shared",
+ "Write_shared",
+ "Iwrite_at",
+ "Get_view",
+ "Call_errhandler",
+ "Write_all_begin",
+ "Read_all_end",
+ "Get_byte_offset",
+ "Iread",
+ "Read_at_all_end",
+ "Write_at",
+ "Write_at_all_begin",
+ "Get_errhandler",
+ "Get_amode",
+ "Set_atomicity",
+ "Get_group",
+ "Get_position",
+ "Open",
+ "Seek",
+ "Read_all_begin",
+ "Read_at_all_begin",
+ "Read_all",
+ "Preallocate",
+ "Read_at_all",
+ "Read_shared",
+ "Iwrite",
+ "Iwrite_shared",
+ "Set_errhandler",
+ "Write_at_all",
+ "Set_size",
+ "Set_view",
+ "Read_at",
+ "Close",
+ "Write_ordered_end",
+ "Write",
+ "Get_atomicity",
+);
+@routinesmpi2greq = (
+ "Complete",
+);
+@routinesmpi2info = (
+ "Delete",
+ "Get_nthkey",
+ "Free",
+ "Create",
+ "Set",
+ "Dup",
+ "Get_valuelen",
+ "Get",
+ "Get_nkeys",
+);
+@routinesmpi2inter = (
+ "Split",
+);
+@routinesmpi2intra = (
+ "Exscan",
+ "Accept",
+ "Connect",
+);
+@routinesmpi2op = (
+ "Is_commutative",
+ "Reduce_local",
+);
+@routinesmpi2req = (
+ "Get_status",
+);
+@routinesmpi2st = (
+ "Set_cancelled",
+ "Set_elements",
+);
+@routinesmpi2win = (
+ "Get_group",
+ "Fence",
+ "Start",
+ "Free",
+ "Put",
+ "Wait",
+ "Test",
+ "Get",
+ "Get_attr",
+ "Set_attr",
+ "Complete",
+ "Set_errhandler",
+ "Set_name",
+ "Accumulate",
+ "Create",
+ "Call_errhandler",
+ "Free_keyval",
+ "Post",
+ "Unlock",
+ "Delete_attr",
+ "Lock",
+ "Get_errhandler",
+ "Get_name",
+);
-----------------------------------------------------------------------
Summary of changes:
autogen.sh | 2 +-
configure.ac | 121 +-------
src/binding/cxx/buildiface | 224 +++++++++++---
src/binding/cxx/cxx.vlist | 319 ++++++++++++++++++++
src/binding/f77/buildiface | 221 +++-----------
src/binding/f90/buildiface | 9 +-
src/include/mpi.h.in | 6 +-
src/include/mpiimpl.h | 76 ++++--
src/mpi/datatype/get_count.c | 8 +-
src/mpi/datatype/get_elements_x.c | 6 +-
src/mpi/datatype/status_set_elements_x.c | 2 +-
src/mpi/init/initthread.c | 5 -
src/mpi/pt2pt/ibsend.c | 2 +-
src/mpi/pt2pt/mpir_request.c | 8 +-
src/mpi/pt2pt/request_get_status.c | 10 +-
src/mpi/pt2pt/status_set_cancelled.c | 2 +-
src/mpi/romio/mpi-io/iotestall.c | 4 +-
src/mpi/romio/mpi-io/iotestany.c | 4 +-
src/mpi/romio/mpi-io/iowaitall.c | 4 +-
src/mpi/romio/mpi-io/iowaitany.c | 4 +-
.../ch3/channels/nemesis/netmod/mx/mx_cancel.c | 10 +-
src/mpid/ch3/channels/nemesis/netmod/mx/mx_poll.c | 6 +-
src/mpid/ch3/channels/nemesis/netmod/mx/mx_probe.c | 4 +-
.../channels/nemesis/netmod/newmad/newmad_cancel.c | 8 +-
.../channels/nemesis/netmod/newmad/newmad_poll.c | 6 +-
.../channels/nemesis/netmod/newmad/newmad_probe.c | 4 +-
.../channels/nemesis/netmod/portals4/ptl_impl.h | 2 +-
.../channels/nemesis/netmod/portals4/ptl_probe.c | 2 +-
.../channels/nemesis/netmod/portals4/ptl_recv.c | 4 +-
src/mpid/ch3/channels/nemesis/src/ch3_progress.c | 2 +-
src/mpid/ch3/channels/nemesis/src/mpid_nem_lmt.c | 2 +-
src/mpid/ch3/include/mpidimpl.h | 4 +-
src/mpid/ch3/src/ch3u_buffer.c | 2 +-
src/mpid/ch3/src/ch3u_eager.c | 10 +-
src/mpid/ch3/src/ch3u_eagersync.c | 2 +-
src/mpid/ch3/src/ch3u_handle_recv_pkt.c | 8 +-
src/mpid/ch3/src/ch3u_recvq.c | 4 +-
src/mpid/ch3/src/ch3u_request.c | 14 +-
src/mpid/ch3/src/ch3u_rma_reqops.c | 4 +-
src/mpid/ch3/src/ch3u_rndv.c | 2 +-
src/mpid/ch3/src/mpid_cancel_recv.c | 4 +-
src/mpid/ch3/src/mpid_cancel_send.c | 12 +-
src/mpid/ch3/src/mpidi_isend_self.c | 6 +-
src/mpid/pamid/src/mpid_request.h | 4 +-
src/mpid/pamid/src/pt2pt/mpid_cancel.c | 4 +-
src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c | 2 +-
src/mpid/pamid/src/pt2pt/mpidi_callback_rzv.c | 2 +-
src/mpid/pamid/src/pt2pt/mpidi_callback_short.c | 2 +-
src/mpid/pamid/src/pt2pt/mpidi_callback_util.c | 8 +-
src/mpid/pamid/src/pt2pt/mpidi_control.c | 2 +-
src/mpid/pamid/src/pt2pt/mpidi_done.c | 8 +-
src/mpid/pamid/src/pt2pt/mpidi_recvmsg.c | 8 +-
src/mpid/pamid/src/pt2pt/mpidi_rendezvous.c | 2 +-
src/mpid/pamid/src/pt2pt/mpidi_sendmsg.c | 2 +-
test/mpi/.gitignore | 1 +
test/mpi/configure.ac | 29 ++
test/mpi/cxx/topo/testlist | 1 -
test/mpi/cxx/topo/testlist.in | 1 +
test/mpi/pt2pt/large_message.c | 2 +-
59 files changed, 744 insertions(+), 493 deletions(-)
create mode 100644 src/binding/cxx/cxx.vlist
delete mode 100644 test/mpi/cxx/topo/testlist
create mode 100644 test/mpi/cxx/topo/testlist.in
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1b1-134-g88580cc
by noreply@mpich.org 29 Oct '13
by noreply@mpich.org 29 Oct '13
29 Oct '13
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 88580cc2ca27e3bc43774f4243d5ee43189d49ff (commit)
via db4b0786a334a2ddd41db1cffbcc520c227752d7 (commit)
via d29a600e5c8a07b791a5a9d22abe0b19e4710db2 (commit)
from 4b06870d90f542ce559c45db844f7f4a3f709aa8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/88580cc2ca27e3bc43774f4243d5ee431…
commit 88580cc2ca27e3bc43774f4243d5ee43189d49ff
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Tue Oct 29 11:24:09 2013 -0500
Use the standard #ifndef/#include in mpitimpl.h
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/include/mpitimpl.h b/src/include/mpitimpl.h
index f84acd9..9f3120d 100644
--- a/src/include/mpitimpl.h
+++ b/src/include/mpitimpl.h
@@ -7,8 +7,8 @@
/* Types and interfaces in this file are internally used by MPIR_T itself.
* Other modules should call higher level interfaces in mpit.h instead.
*/
-#ifndef MPIT_INTERNAL_H_INCLUDED
-#define MPIT_INTERNAL_H_INCLUDED
+#ifndef MPITIMPL_H_INCLUDED
+#define MPITIMPL_H_INCLUDED
#include "mpi.h"
#include "mpiu_utarray.h"
http://git.mpich.org/mpich.git/commitdiff/db4b0786a334a2ddd41db1cffbcc520c2…
commit db4b0786a334a2ddd41db1cffbcc520c227752d7
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Mon Oct 28 23:22:07 2013 -0500
Include mpitimpl.h in mpich_cvars.h
Since in mpich_cvars.h, we used a type MPIR_T_cvar_range_value_t,
which is defined in mpitimpl.h.
Fix #1953
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/maint/gencvars b/maint/gencvars
index b3bb29e..0f7575c 100755
--- a/maint/gencvars
+++ b/maint/gencvars
@@ -133,6 +133,8 @@ print CVAR_HDR <<EOT;
#if !defined($hdr_guard)
#define $hdr_guard
+#include "mpitimpl.h" /* for MPIR_T_cvar_range_value_t */
+
EOT
print CVAR_C <<EOT;
http://git.mpich.org/mpich.git/commitdiff/d29a600e5c8a07b791a5a9d22abe0b19e…
commit d29a600e5c8a07b791a5a9d22abe0b19e4710db2
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Mon Oct 28 23:16:29 2013 -0500
Use the new MPI_T cvar name prefix MPIR_CVAR_
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/src/mpid/common/sock/poll/sock_post.i b/src/mpid/common/sock/poll/sock_post.i
index 9161ce1..f32ddd3 100644
--- a/src/mpid/common/sock/poll/sock_post.i
+++ b/src/mpid/common/sock/poll/sock_post.i
@@ -333,10 +333,10 @@ int MPIDU_Sock_listen(struct MPIDU_Sock_set * sock_set, void * user_ptr,
int portnum;
/* see if we actually want to find values within a range */
- MPIU_ERR_CHKANDJUMP(MPIR_PARAM_CH3_PORT_RANGE.low < 0 || MPIR_PARAM_CH3_PORT_RANGE.low > MPIR_PARAM_CH3_PORT_RANGE.high, mpi_errno, MPI_ERR_OTHER, "**badportrange");
+ MPIU_ERR_CHKANDJUMP(MPIR_CVAR_CH3_PORT_RANGE.low < 0 || MPIR_CVAR_CH3_PORT_RANGE.low > MPIR_CVAR_CH3_PORT_RANGE.high, mpi_errno, MPI_ERR_OTHER, "**badportrange");
/* default MPICH_PORT_RANGE is {0,0} so bind will use any available port */
- for (portnum = MPIR_PARAM_CH3_PORT_RANGE.low; portnum <= MPIR_PARAM_CH3_PORT_RANGE.high; ++portnum) {
+ for (portnum = MPIR_CVAR_CH3_PORT_RANGE.low; portnum <= MPIR_CVAR_CH3_PORT_RANGE.high; ++portnum) {
memset( (void *)&addr, 0, sizeof(addr) );
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(INADDR_ANY);
-----------------------------------------------------------------------
Summary of changes:
maint/gencvars | 2 ++
src/include/mpitimpl.h | 4 ++--
src/mpid/common/sock/poll/sock_post.i | 4 ++--
3 files changed, 6 insertions(+), 4 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1b1-131-g4b06870
by noreply@mpich.org 29 Oct '13
by noreply@mpich.org 29 Oct '13
29 Oct '13
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 4b06870d90f542ce559c45db844f7f4a3f709aa8 (commit)
from 7288ffe050337c7c2389f0270f671b98673dc350 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/4b06870d90f542ce559c45db844f7f4a3…
commit 4b06870d90f542ce559c45db844f7f4a3f709aa8
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Mon Oct 28 17:44:16 2013 -0500
Swap the priority between MPICH_* and MPIR_PARAM_*
The new init. priority order of MPICH cvars is
MPICH_* < MPIR_PARAM_* < MPIR_CVAR_*
Signed-off-by: Pavan Balaji <balaji(a)mcs.anl.gov>
diff --git a/maint/gencvars b/maint/gencvars
index fbd3ae5..b3bb29e 100755
--- a/maint/gencvars
+++ b/maint/gencvars
@@ -41,10 +41,10 @@ my $fn_ns = "MPIR_T_cvar";
my $ns = "MPIR_CVAR";
# an alternative namespace used for environment variables, unused if set
# to ""
-my $alt_ns = "MPICH";
+my $alt_ns = "MPIR_PARAM";
# deprecated prefix for backward compatibility
-my $dep_ns = "MPIR_PARAM";
+my $dep_ns = "MPICH";
# cvar description file
my $cvar_file = "src/util/cvar/cvars.yml";
@@ -409,8 +409,8 @@ foreach my $p (@{$cvars->{cvars}}) {
my $default;
# process extra envs first so the primary always wins
- push @env_names, "${dep_ns}_" . $p->{name};
push @env_names, "${alt_ns}_" . $p->{name};
+ push @env_names, "${dep_ns}_" . $p->{name};
push @env_names, map { "${uc_ns}_$_" } @{$p->{'alt-env'}};
push @env_names, map { "${alt_ns}_$_" } @{$p->{'alt-env'}};
push @env_names, map { "${dep_ns}_$_" } @{$p->{'alt-env'}};
-----------------------------------------------------------------------
Summary of changes:
maint/gencvars | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1b1-130-g7288ffe
by noreply@mpich.org 29 Oct '13
by noreply@mpich.org 29 Oct '13
29 Oct '13
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 7288ffe050337c7c2389f0270f671b98673dc350 (commit)
from 4bb837e86e260c85f0a3b5f93e0c609e582b4c9d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/7288ffe050337c7c2389f0270f671b986…
commit 7288ffe050337c7c2389f0270f671b98673dc350
Author: Junchao Zhang <jczhang(a)mcs.anl.gov>
Date: Tue Oct 29 11:15:19 2013 -0500
Fix a problem in passing thread id to a function
The old code used (void*)(intptr_t)i to pass the thread id i.
However intptr_t is C99, so I changed it to (void*)(long)i.
Direct usage of (void*)i will issue a compilation warning
saying it is dangerous to convert integer to pointer.
Fixes #1956
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/test/mpi/threads/mpi_t/mpit_threading.c b/test/mpi/threads/mpi_t/mpit_threading.c
index 9c08261..09998f7 100644
--- a/test/mpi/threads/mpi_t/mpit_threading.c
+++ b/test/mpi/threads/mpi_t/mpit_threading.c
@@ -42,7 +42,7 @@ int PrintCategories(FILE * fp, int myThreadId);
MTEST_THREAD_RETURN_TYPE RunTest(void *p)
{
- int myThreadId = (int)((intptr_t)p);
+ int myThreadId = (int)(long)p;
PrintControlVars(stdout, myThreadId);
if (DOPRINT)
@@ -79,8 +79,7 @@ int main(int argc, char *argv[])
/* Spawn threads */
for (i = 0; i < NTHREADS; i++) {
- intptr_t tid = (intptr_t)i;
- MTest_Start_thread(RunTest, (void *)tid);
+ MTest_Start_thread(RunTest, (void *)(long)i);
}
MTest_Join_threads();
-----------------------------------------------------------------------
Summary of changes:
test/mpi/threads/mpi_t/mpit_threading.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1b1-129-g4bb837e
by noreply@mpich.org 27 Oct '13
by noreply@mpich.org 27 Oct '13
27 Oct '13
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 4bb837e86e260c85f0a3b5f93e0c609e582b4c9d (commit)
from 17878cdf4859f2d92dcae56e05bdea8a9eeb9bed (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/4bb837e86e260c85f0a3b5f93e0c609e5…
commit 4bb837e86e260c85f0a3b5f93e0c609e582b4c9d
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun Oct 27 10:26:36 2013 -0500
Correct output format in the new impls/ test.
Signed-off-by: Ken Raffenetti <raffenet(a)mcs.anl.gov>
diff --git a/test/mpi/impls/mpich/mpi_t/collparmt.c b/test/mpi/impls/mpich/mpi_t/collparmt.c
index 588a3f2..4f3b7e9 100644
--- a/test/mpi/impls/mpich/mpi_t/collparmt.c
+++ b/test/mpi/impls/mpich/mpi_t/collparmt.c
@@ -138,7 +138,14 @@ int main( int argc, char *argv[] )
/* For full coverage, should address all parameters for collective
algorithm selection */
- if (wrank == 0) printf( "Errors = %d\n", errs );
+ if (wrank == 0) {
+ if (errs) {
+ printf("found %d errors\n", errs);
+ }
+ else {
+ printf(" No errors\n");
+ }
+ }
MPI_T_finalize();
MPI_Finalize();
-----------------------------------------------------------------------
Summary of changes:
test/mpi/impls/mpich/mpi_t/collparmt.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.1b1-128-g17878cd
by noreply@mpich.org 27 Oct '13
by noreply@mpich.org 27 Oct '13
27 Oct '13
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via 17878cdf4859f2d92dcae56e05bdea8a9eeb9bed (commit)
via 1aaea60437d9af14dfd14bb5bf06145e3f330e4c (commit)
from e53c0f3a2485069ad29f97be0ae8b4e68bbf71b4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/17878cdf4859f2d92dcae56e05bdea8a9…
commit 17878cdf4859f2d92dcae56e05bdea8a9eeb9bed
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun Oct 27 10:32:33 2013 -0500
Update version string.
We are calling the next release 3.1rc1. The ABI string has already
been updated.
No reviewer.
diff --git a/maint/version.m4 b/maint/version.m4
index a6fad3a..03f2acf 100644
--- a/maint/version.m4
+++ b/maint/version.m4
@@ -14,7 +14,7 @@
# changing this by playing with diversions, but then we would probably be
# playing with autotools-fire.
-m4_define([MPICH_VERSION_m4],[3.1b2])dnl
+m4_define([MPICH_VERSION_m4],[3.1rc1])dnl
m4_define([MPICH_RELEASE_DATE_m4],[unreleased development copy])dnl
# For libtool ABI versioning rules see:
http://git.mpich.org/mpich.git/commitdiff/1aaea60437d9af14dfd14bb5bf06145e3…
commit 1aaea60437d9af14dfd14bb5bf06145e3f330e4c
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun Oct 27 10:29:50 2013 -0500
Added information about MPI_T to the documentation.
No reviewer.
diff --git a/CHANGES b/CHANGES
index dd35039..2aff5eb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,8 @@
# Several improvements to the SCIF netmod. (code contribution from
Intel).
+ # Major revamp of the MPI_T interface added in MPI-3.
+
# Added environment variables to control a lot more capabilities for
collectives. See the README.envvar file for more information.
diff --git a/README.vin b/README.vin
index 2ef3aaf..5ddbc07 100644
--- a/README.vin
+++ b/README.vin
@@ -3,9 +3,8 @@
MPICH is a high-performance and widely portable implementation of the
MPI-3.0 standard from the Argonne National Laboratory. This release
has all MPI 3.0 functions and features required by the standard with
-the exception of support for the "external32" portable I/O format,
-user-defined data representations for I/O, and the MPI_T interface
-(some MPI_T functions are partially implemented).
+the exception of support for the "external32" portable I/O format and
+user-defined data representations for I/O.
This README file should contain enough information to get you started
with MPICH. More extensive installation and user guides can be found
-----------------------------------------------------------------------
Summary of changes:
CHANGES | 2 ++
README.vin | 5 ++---
maint/version.m4 | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0