Commit 6395fbae authored by Rob Latham's avatar Rob Latham Committed by Kenneth Raffenetti
Browse files

ROMIO standalone: check for need of const



const-ificaiton of MPI routines happened only in MPI-3.  making ROMIO's
const-ification optional lets us work standalone with older libraries.
Signed-off-by: Kenneth Raffenetti's avatarKen Raffenetti <raffenet@mcs.anl.gov>
parent 1dbbd09a
......@@ -1548,6 +1548,7 @@ elif test $FROM_MPICH = yes ; then
DEFINE_HAVE_MPI_GREQUEST="#define HAVE_MPI_GREQUEST 1"
AC_DEFINE(HAVE_MPIU_FUNCS,1,[Define if MPICH memory tracing macros defined])
AC_DEFINE(HAVE_MPIX_H, 1, [])
AC_DEFINE(HAVE_MPIIO_CONST, const, Set if MPI-IO prototypes use const qualifier),
fi
#
#
......@@ -1560,6 +1561,7 @@ if test $WITHIN_KNOWN_MPI_IMPL = no ; then
PAC_TEST_MPIU_FUNCS
AC_DEFINE(PRINT_ERR_MSG,1,[Define for printing error messages])
AC_CHECK_TYPE(MPI_Count,[],[AC_DEFINE_UNQUOTED([MPI_Count],[MPI_Aint],[Define to "MPI_Aint" if MPI does not provide MPI_Count]) ])
PAC_TEST_NEEDS_CONST
AC_CHECK_DECLS([MPI_COMBINER_HINDEXED_BLOCK], [], [], [[#include <mpi.h>]])
fi
#
......
......@@ -32,7 +32,7 @@ Input Parameters:
.N fortran
@*/
int MPI_File_delete(const char *filename, MPI_Info info)
int MPI_File_delete(ROMIO_CONST char *filename, MPI_Info info)
{
int error_code, file_system;
char *tmp;
......
......@@ -41,7 +41,7 @@ Output Parameters:
#include "mpiu_greq.h"
#endif
int MPI_File_iwrite(MPI_File fh, const void *buf, int count,
int MPI_File_iwrite(MPI_File fh, ROMIO_CONST void *buf, int count,
MPI_Datatype datatype, MPI_Request *request)
{
int error_code=MPI_SUCCESS;
......
......@@ -42,7 +42,7 @@ Output Parameters:
#include "mpiu_greq.h"
#endif
int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void *buf,
int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, ROMIO_CONST void *buf,
int count, MPI_Datatype datatype,
MPIO_Request *request)
{
......
......@@ -41,7 +41,7 @@ Output Parameters:
#include "mpiu_greq.h"
#endif
int MPI_File_iwrite_shared(MPI_File fh, const void *buf, int count,
int MPI_File_iwrite_shared(MPI_File fh, ROMIO_CONST void *buf, int count,
MPI_Datatype datatype, MPIO_Request *request)
{
int error_code, buftype_is_contig, filetype_is_contig;
......
......@@ -14,7 +14,6 @@
#include "adio.h"
#include "mpio.h"
#include "mpiu_external32.h"
#ifdef ROMIO_INSIDE_MPICH
#include "glue_romio.h"
......@@ -59,6 +58,14 @@ MPI_Delete_function ADIOI_End_call;
/* common initialization routine */
void MPIR_MPIOInit(int * error_code);
#ifdef HAVE_MPIIO_CONST
#define ROMIO_CONST const
#else
#define ROMIO_CONST
#endif
#include "mpiu_external32.h"
#include "mpioprof.h"
......
......@@ -28,8 +28,13 @@ int MPIU_write_external32_conversion_fn (const void *userbuf, MPI_Datatype datat
if (is_contig)
{
#ifdef HAVE_MPIIO_CONST
mpi_errno = MPI_Pack_external("external32", userbuf, count,
datatype, filebuf, bytes, &position);
#else
mpi_errno = MPI_Pack_external("external32", (void *)userbuf, count,
datatype, filebuf, bytes, &position);
#endif
if (mpi_errno != MPI_SUCCESS)
goto fn_exit;
}
......@@ -43,8 +48,13 @@ int MPIU_write_external32_conversion_fn (const void *userbuf, MPI_Datatype datat
goto fn_exit;
}
#ifdef HAVE_MPIIO_CONST
mpi_errno = MPI_Pack_external("external32", userbuf, count,
datatype, tmp_buf, bytes, &position);
#else
mpi_errno = MPI_Pack_external("external32", (void *)userbuf, count,
datatype, tmp_buf, bytes, &position);
#endif
if (mpi_errno != MPI_SUCCESS)
{
ADIOI_Free(tmp_buf);
......
......@@ -43,7 +43,7 @@ Output Parameters:
.N fortran
@*/
int MPI_File_open(MPI_Comm comm, const char *filename, int amode,
int MPI_File_open(MPI_Comm comm, ROMIO_CONST char *filename, int amode,
MPI_Info info, MPI_File *fh)
{
int error_code = MPI_SUCCESS, file_system, flag, tmp_amode=0, rank;
......
......@@ -48,7 +48,7 @@ Input Parameters:
.N fortran
@*/
int MPI_Register_datarep(const char *datarep,
int MPI_Register_datarep(ROMIO_CONST char *datarep,
MPI_Datarep_conversion_function *read_conversion_fn,
MPI_Datarep_conversion_function *write_conversion_fn,
MPI_Datarep_extent_function *dtype_file_extent_fn,
......
......@@ -37,7 +37,7 @@ Input Parameters:
.N fortran
@*/
int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype,
MPI_Datatype filetype, const char *datarep, MPI_Info info)
MPI_Datatype filetype, ROMIO_CONST char *datarep, MPI_Info info)
{
int error_code;
MPI_Count filetype_size, etype_size;
......
......@@ -36,7 +36,7 @@ Input Parameters:
.N fortran
@*/
int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, const void *buf,
int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, ROMIO_CONST void *buf,
int count, MPI_Datatype datatype)
{
int error_code;
......
......@@ -35,7 +35,7 @@ Output Parameters:
.N fortran
@*/
int MPI_File_write_at_all_end(MPI_File fh, const void *buf, MPI_Status *status)
int MPI_File_write_at_all_end(MPI_File fh, ROMIO_CONST void *buf, MPI_Status *status)
{
int error_code;
static char myname[] = "MPI_FILE_WRITE_AT_ALL_END";
......
......@@ -38,7 +38,7 @@ Output Parameters:
.N fortran
@*/
int MPI_File_write(MPI_File fh, const void *buf, int count,
int MPI_File_write(MPI_File fh, ROMIO_CONST void *buf, int count,
MPI_Datatype datatype, MPI_Status *status)
{
int error_code;
......
......@@ -39,7 +39,7 @@ Output Parameters:
.N fortran
@*/
int MPI_File_write_all(MPI_File fh, const void *buf, int count,
int MPI_File_write_all(MPI_File fh, ROMIO_CONST void *buf, int count,
MPI_Datatype datatype, MPI_Status *status)
{
int error_code;
......
......@@ -35,7 +35,7 @@ Input Parameters:
.N fortran
@*/
int MPI_File_write_all_begin(MPI_File fh, const void *buf, int count,
int MPI_File_write_all_begin(MPI_File fh, ROMIO_CONST void *buf, int count,
MPI_Datatype datatype)
{
int error_code;
......
......@@ -35,7 +35,7 @@ Output Parameters:
.N fortran
@*/
int MPI_File_write_all_end(MPI_File fh, const void *buf, MPI_Status *status)
int MPI_File_write_all_end(MPI_File fh, ROMIO_CONST void *buf, MPI_Status *status)
{
int error_code;
static char myname[] = "MPI_FILE_WRITE_ALL_END";
......
......@@ -39,7 +39,7 @@ Output Parameters:
.N fortran
@*/
int MPI_File_write_at(MPI_File fh, MPI_Offset offset, const void *buf,
int MPI_File_write_at(MPI_File fh, MPI_Offset offset, ROMIO_CONST void *buf,
int count, MPI_Datatype datatype, MPI_Status *status)
{
int error_code;
......
......@@ -40,7 +40,7 @@ Output Parameters:
.N fortran
@*/
int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, const void *buf,
int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, ROMIO_CONST void *buf,
int count, MPI_Datatype datatype,
MPI_Status *status)
{
......
......@@ -40,7 +40,7 @@ Output Parameters:
.N fortran
@*/
int MPI_File_write_ordered(MPI_File fh, const void *buf, int count,
int MPI_File_write_ordered(MPI_File fh, ROMIO_CONST void *buf, int count,
MPI_Datatype datatype, MPI_Status *status)
{
int error_code, nprocs, myrank;
......
......@@ -36,7 +36,7 @@ Output Parameters:
.N fortran
@*/
int MPI_File_write_ordered_begin(MPI_File fh, const void *buf, int count,
int MPI_File_write_ordered_begin(MPI_File fh, ROMIO_CONST void *buf, int count,
MPI_Datatype datatype)
{
int error_code, nprocs, myrank;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment