[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.0.2-5-gd8eec54
mysql vizuser
noreply at mpich.org
Tue Feb 5 10:30:49 CST 2013
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 d8eec5491fa0929d43da3086230795a2fb1c6545 (commit)
from 0b3640682130339f69e5391560d39b771c04bad4 (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/d8eec5491fa0929d43da3086230795a2fb1c6545
commit d8eec5491fa0929d43da3086230795a2fb1c6545
Author: Dave Goodell <goodell at mcs.anl.gov>
Date: Mon Feb 4 23:14:50 2013 -0600
tt#1754: fix warnings in ROMIO external32 code
This doesn't fix any of the serious bugs or inefficiencies present in
the current external32 implementation. But it at least fixes some very
valid warnings related to const-ness and passing incorrect pointer
types.
References ticket #1754
Reviewed-by: robl
diff --git a/src/mpi/romio/adio/common/error.c b/src/mpi/romio/adio/common/error.c
index ddf78be..15f2376 100644
--- a/src/mpi/romio/adio/common/error.c
+++ b/src/mpi/romio/adio/common/error.c
@@ -38,7 +38,7 @@ int ADIOI_Error(ADIO_File fd, int error_code, char *string)
/* Returns an MPI error code corresponding to "my_errno", for function "myname"
* and the given file, "filename". */
-int ADIOI_Err_create_code(char *myname, char *filename, int my_errno)
+int ADIOI_Err_create_code(const char *myname, const char *filename, int my_errno)
{
int error_code = MPI_SUCCESS;
if(!my_errno) return MPI_SUCCESS;
diff --git a/src/mpi/romio/adio/include/adioi.h b/src/mpi/romio/adio/include/adioi.h
index d430da8..063b39c 100644
--- a/src/mpi/romio/adio/include/adioi.h
+++ b/src/mpi/romio/adio/include/adioi.h
@@ -561,7 +561,7 @@ int ADIOI_End_call(MPI_Comm comm, int keyval, void *attribute_val, void *extra_s
int MPIR_Status_set_bytes(MPI_Status *status, MPI_Datatype datatype, int nbytes);
int ADIOI_Uses_generic_read(ADIO_File fd);
int ADIOI_Uses_generic_write(ADIO_File fd);
-int ADIOI_Err_create_code(char *myname, char *filename, int my_errno);
+int ADIOI_Err_create_code(const char *myname, const char *filename, int my_errno);
int ADIOI_FAKE_IODone(ADIO_Request *request, ADIO_Status *status,
diff --git a/src/mpi/romio/adio/include/mpiu_external32.h b/src/mpi/romio/adio/include/mpiu_external32.h
index eb5eec7..4302373 100644
--- a/src/mpi/romio/adio/include/mpiu_external32.h
+++ b/src/mpi/romio/adio/include/mpiu_external32.h
@@ -8,7 +8,7 @@
#ifndef _MPIU_EXTERNAL32_H_
#define _MPIU_EXTERNAL32_H_
-int MPIU_write_external32_conversion_fn (void *userbuf, MPI_Datatype datatype,
+int MPIU_write_external32_conversion_fn (const void *userbuf, MPI_Datatype datatype,
int count, void *filebuf);
int MPIU_read_external32_conversion_fn(void *userbuf, MPI_Datatype datatype,
int count, void *filebuf);
@@ -17,6 +17,6 @@ int MPIU_datatype_full_size(MPI_Datatype datatype, MPI_Aint *size);
/* given a buffer, count, and datatype, return an apropriately sized and
* * external32-formatted buffer, suitable for handing off to a subsequent write
* * routine */
-int MPIU_external32_buffer_setup(void * buf, int count, MPI_Datatype type, void **newbuf);
+int MPIU_external32_buffer_setup(const void * buf, int count, MPI_Datatype type, void **newbuf);
#endif
diff --git a/src/mpi/romio/mpi-io/mpiu_external32.c b/src/mpi/romio/mpi-io/mpiu_external32.c
index 8e9d467..75b4c27 100644
--- a/src/mpi/romio/mpi-io/mpiu_external32.c
+++ b/src/mpi/romio/mpi-io/mpiu_external32.c
@@ -12,7 +12,7 @@
#include "mpioprof.h"
#endif
-int MPIU_write_external32_conversion_fn (void *userbuf, MPI_Datatype datatype,
+int MPIU_write_external32_conversion_fn (const void *userbuf, MPI_Datatype datatype,
int count, void *filebuf)
{
int position_i = 0;
@@ -136,7 +136,7 @@ fn_exit:
/* given a buffer, count, and datatype, return an apropriately allocated, sized
* and external32-formatted buffer, suitable for handing off to a subsequent
* write routine. Caller is responsible for freeing 'newbuf' */
-int MPIU_external32_buffer_setup(void * buf, int count, MPI_Datatype type, void **newbuf)
+int MPIU_external32_buffer_setup(const void * buf, int count, MPI_Datatype type, void **newbuf)
{
MPI_Aint datatype_size=0, bytes=0;
diff --git a/src/mpi/romio/mpi-io/read.c b/src/mpi/romio/mpi-io/read.c
index c7fb25d..029db3b 100644
--- a/src/mpi/romio/mpi-io/read.c
+++ b/src/mpi/romio/mpi-io/read.c
@@ -124,11 +124,12 @@ int MPIOI_File_read(MPI_File fh,
xbuf = buf;
if (adio_fh->is_external32)
{
- error_code = MPIU_datatype_full_size(datatype, &datatype_size);
+ MPI_Aint e32_size = 0;
+ error_code = MPIU_datatype_full_size(datatype, &e32_size);
if (error_code != MPI_SUCCESS)
goto fn_exit;
- e32_buf = ADIOI_Malloc(datatype_size*count);
+ e32_buf = ADIOI_Malloc(e32_size*count);
xbuf = e32_buf;
}
diff --git a/src/mpi/romio/mpi-io/read_all.c b/src/mpi/romio/mpi-io/read_all.c
index 8d412a3..b387fe9 100644
--- a/src/mpi/romio/mpi-io/read_all.c
+++ b/src/mpi/romio/mpi-io/read_all.c
@@ -107,11 +107,12 @@ int MPIOI_File_read_all(MPI_File fh,
xbuf = buf;
if (adio_fh->is_external32)
{
- error_code = MPIU_datatype_full_size(datatype, &datatype_size);
+ MPI_Aint e32_size = 0;
+ error_code = MPIU_datatype_full_size(datatype, &e32_size);
if (error_code != MPI_SUCCESS)
goto fn_exit;
- e32_buf = ADIOI_Malloc(datatype_size*count);
+ e32_buf = ADIOI_Malloc(e32_size*count);
xbuf = e32_buf;
}
diff --git a/src/mpi/romio/mpi-io/read_allb.c b/src/mpi/romio/mpi-io/read_allb.c
index 2ba4b3a..ecc9088 100644
--- a/src/mpi/romio/mpi-io/read_allb.c
+++ b/src/mpi/romio/mpi-io/read_allb.c
@@ -104,11 +104,12 @@ int MPIOI_File_read_all_begin(MPI_File fh,
xbuf = buf;
if (adio_fh->is_external32)
{
- error_code = MPIU_datatype_full_size(datatype, &datatype_size);
+ MPI_Aint e32_size = 0;
+ error_code = MPIU_datatype_full_size(datatype, &e32_size);
if (error_code != MPI_SUCCESS)
goto fn_exit;
- e32_buf = ADIOI_Malloc(datatype_size*count);
+ e32_buf = ADIOI_Malloc(e32_size*count);
xbuf = e32_buf;
}
diff --git a/src/mpi/romio/mpi-io/read_ordb.c b/src/mpi/romio/mpi-io/read_ordb.c
index 6944e68..324fa7f 100644
--- a/src/mpi/romio/mpi-io/read_ordb.c
+++ b/src/mpi/romio/mpi-io/read_ordb.c
@@ -102,11 +102,12 @@ int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count,
xbuf = buf;
if (adio_fh->is_external32)
{
- error_code = MPIU_datatype_full_size(datatype, &datatype_size);
+ MPI_Aint e32_size = 0;
+ error_code = MPIU_datatype_full_size(datatype, &e32_size);
if (error_code != MPI_SUCCESS)
goto fn_exit;
- e32_buf = ADIOI_Malloc(datatype_size*count);
+ e32_buf = ADIOI_Malloc(e32_size*count);
xbuf = e32_buf;
}
diff --git a/src/mpi/romio/mpi-io/read_sh.c b/src/mpi/romio/mpi-io/read_sh.c
index 8ee0e63..1536838 100644
--- a/src/mpi/romio/mpi-io/read_sh.c
+++ b/src/mpi/romio/mpi-io/read_sh.c
@@ -99,11 +99,12 @@ int MPI_File_read_shared(MPI_File fh, void *buf, int count,
xbuf = buf;
if (adio_fh->is_external32)
{
- error_code = MPIU_datatype_full_size(datatype, &datatype_size);
+ MPI_Aint e32_size = 0;
+ error_code = MPIU_datatype_full_size(datatype, &e32_size);
if (error_code != MPI_SUCCESS)
goto fn_exit;
- e32_buf = ADIOI_Malloc(datatype_size*count);
+ e32_buf = ADIOI_Malloc(e32_size*count);
xbuf = e32_buf;
}
diff --git a/src/mpi/romio/mpi-io/write.c b/src/mpi/romio/mpi-io/write.c
index 4221eb3..02867c2 100644
--- a/src/mpi/romio/mpi-io/write.c
+++ b/src/mpi/romio/mpi-io/write.c
@@ -74,7 +74,8 @@ int MPIOI_File_write(MPI_File fh,
int datatype_size;
ADIO_Offset off;
ADIO_File adio_fh;
- void *e32buf=NULL, *xbuf=NULL;
+ void *e32buf=NULL;
+ const void *xbuf=NULL;
MPIU_THREAD_CS_ENTER(ALLFUNC,);
@@ -121,7 +122,7 @@ int MPIOI_File_write(MPI_File fh,
ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code);
- xbuf = (void *)buf;
+ xbuf = buf;
if (adio_fh->is_external32) {
error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf);
if (error_code != MPI_SUCCESS)
diff --git a/src/mpi/romio/mpi-io/write_all.c b/src/mpi/romio/mpi-io/write_all.c
index 28cd31a..2e1533c 100644
--- a/src/mpi/romio/mpi-io/write_all.c
+++ b/src/mpi/romio/mpi-io/write_all.c
@@ -74,7 +74,8 @@ int MPIOI_File_write_all(MPI_File fh,
{
int error_code, datatype_size;
ADIO_File adio_fh;
- void *e32buf=NULL, *xbuf=NULL;
+ void *e32buf=NULL;
+ const void *xbuf=NULL;
MPIU_THREAD_CS_ENTER(ALLFUNC,);
@@ -104,7 +105,7 @@ int MPIOI_File_write_all(MPI_File fh,
MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code);
/* --END ERROR HANDLING-- */
- xbuf = (void *)buf;
+ xbuf = buf;
if (adio_fh->is_external32) {
error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf);
if (error_code != MPI_SUCCESS)
diff --git a/src/mpi/romio/mpi-io/write_allb.c b/src/mpi/romio/mpi-io/write_allb.c
index 3ee56ca..21e928e 100644
--- a/src/mpi/romio/mpi-io/write_allb.c
+++ b/src/mpi/romio/mpi-io/write_allb.c
@@ -60,7 +60,8 @@ int MPIOI_File_write_all_begin(MPI_File fh,
{
int error_code, datatype_size;
ADIO_File adio_fh;
- void *e32buf=NULL, *xbuf=NULL;
+ void *e32buf=NULL;
+ const void *xbuf=NULL;
MPIU_THREAD_CS_ENTER(ALLFUNC,);
@@ -100,7 +101,7 @@ int MPIOI_File_write_all_begin(MPI_File fh,
/* --END ERROR HANDLING-- */
- xbuf = (void *)buf;
+ xbuf = buf;
if (adio_fh->is_external32) {
error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf);
if (error_code != MPI_SUCCESS)
diff --git a/src/mpi/romio/mpi-io/write_ord.c b/src/mpi/romio/mpi-io/write_ord.c
index 2dc7b91..d0fe63f 100644
--- a/src/mpi/romio/mpi-io/write_ord.c
+++ b/src/mpi/romio/mpi-io/write_ord.c
@@ -48,7 +48,8 @@ int MPI_File_write_ordered(MPI_File fh, const void *buf, int count,
static char myname[] = "MPI_FILE_WRITE_ORDERED";
ADIO_Offset shared_fp;
ADIO_File adio_fh;
- void *e32buf=NULL, *xbuf;
+ void *e32buf=NULL;
+ const void *xbuf;
MPIU_THREAD_CS_ENTER(ALLFUNC,);
diff --git a/src/mpi/romio/mpi-io/write_ordb.c b/src/mpi/romio/mpi-io/write_ordb.c
index f11b1df..87ee213 100644
--- a/src/mpi/romio/mpi-io/write_ordb.c
+++ b/src/mpi/romio/mpi-io/write_ordb.c
@@ -44,7 +44,8 @@ int MPI_File_write_ordered_begin(MPI_File fh, const void *buf, int count,
static char myname[] = "MPI_FILE_WRITE_ORDERED_BEGIN";
ADIO_Offset shared_fp;
ADIO_File adio_fh;
- void *e32buf = NULL, *xbuf=NULL;
+ void *e32buf = NULL;
+ const void *xbuf=NULL;
MPIU_THREAD_CS_ENTER(ALLFUNC,);
diff --git a/src/mpi/romio/mpi-io/write_sh.c b/src/mpi/romio/mpi-io/write_sh.c
index 23f81b7..de7d21d 100644
--- a/src/mpi/romio/mpi-io/write_sh.c
+++ b/src/mpi/romio/mpi-io/write_sh.c
@@ -47,7 +47,8 @@ int MPI_File_write_shared(MPI_File fh, const void *buf, int count,
int datatype_size, incr;
ADIO_Offset off, shared_fp;
ADIO_File adio_fh;
- void *e32buf = NULL, *xbuf = NULL;
+ void *e32buf = NULL;
+ const void *xbuf = NULL;
MPIU_THREAD_CS_ENTER(ALLFUNC,);
-----------------------------------------------------------------------
Summary of changes:
src/mpi/romio/adio/common/error.c | 2 +-
src/mpi/romio/adio/include/adioi.h | 2 +-
src/mpi/romio/adio/include/mpiu_external32.h | 4 ++--
src/mpi/romio/mpi-io/mpiu_external32.c | 4 ++--
src/mpi/romio/mpi-io/read.c | 5 +++--
src/mpi/romio/mpi-io/read_all.c | 5 +++--
src/mpi/romio/mpi-io/read_allb.c | 5 +++--
src/mpi/romio/mpi-io/read_ordb.c | 5 +++--
src/mpi/romio/mpi-io/read_sh.c | 5 +++--
src/mpi/romio/mpi-io/write.c | 5 +++--
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 | 3 ++-
src/mpi/romio/mpi-io/write_ordb.c | 3 ++-
src/mpi/romio/mpi-io/write_sh.c | 3 ++-
15 files changed, 36 insertions(+), 25 deletions(-)
hooks/post-receive
--
MPICH primary repository
More information about the commits
mailing list