Commit e7ccd25b authored by Deike Kleberg's avatar Deike Kleberg
Browse files

Let configure define USE_MPI in case MPI is available.

parent d2de7a65
......@@ -24005,14 +24005,13 @@ else
enable_mpi=no
fi
 
if test "${enable_mpi}" = "yes"; then :
if test "${host_os%???}" = "aix"; then :
replace_cc="mpicc"
else
replace_cc="mpcc_r"
if test x"${enable_mpi}" = x"yes"; then :
USE_MPI=yes
fi
else
replace_cc=$CC
if test x"$USE_MPI" = xyes; then :
$as_echo "#define USE_MPI 1" >>confdefs.h
fi
# ----------------------------------------------------------------------
# Create the Fortran Interface via iso_c_binding module (Fortran 2003 Standard)
......@@ -24398,10 +24397,6 @@ fi
 
 
 
if test "x${replace_cc}" != "x"; then :
CC=$replace_cc
fi
ac_config_files="$ac_config_files Makefile src/Makefile interfaces/Makefile app/Makefile tests/Makefile examples/Makefile cdi.settings"
 
cat >confcache <<\_ACEOF
......
......@@ -107,11 +107,10 @@ ACX_OPTIONS
# ----------------------------------------------------------------------
# Compile with MPI support
AC_ARG_ENABLE(mpi,AS_HELP_STRING([--enable-mpi],[Compile with MPI compiler [default=no]]),enable_mpi=${enableval},enable_mpi=no)
AS_IF([test "${enable_mpi}" = "yes"],
[AS_IF([test "${host_os%???}" = "aix"],
[replace_cc="mpicc"],
[replace_cc="mpcc_r"])],
[replace_cc=$CC])
AS_IF([test x"${enable_mpi}" = x"yes"],
[USE_MPI=yes])
AS_IF([test x"$USE_MPI" = xyes],
[AC_DEFINE([USE_MPI],[1],[parallel I/O requested and available])])
# ----------------------------------------------------------------------
# Create the Fortran Interface via iso_c_binding module (Fortran 2003 Standard)
AC_ARG_ENABLE(iso-c-interface,
......@@ -181,8 +180,6 @@ ACX_CHECK_CFINT([$srcdir/src/cfortran.h])
AC_SUBST([CPPFLAGS])
AS_IF([test "x${replace_cc}" != "x"],[CC=$replace_cc])
AC_OUTPUT(Makefile src/Makefile interfaces/Makefile app/Makefile tests/Makefile examples/Makefile cdi.settings)
# ----------------------------------------------------------------------
......
......@@ -161,6 +161,9 @@
/* User name */
#undef USER_NAME
/* parallel I/O requested and available */
#undef USE_MPI
/* Version number of package */
#undef VERSION
......
......@@ -21,7 +21,7 @@ size_t getpagesize(void);
/* begin deike */
#ifndef NOMPI
#ifdef USE_MPI
#include "pio.h"
#include "cdi.h"
extern pioInfo *pioinfo;
......@@ -1066,7 +1066,7 @@ int fileOpen(const char *filename, const char *mode)
bfile_t *fileptr = NULL;
/* begin deike */
#ifndef NOMPI
#ifdef USE_MPI
if ( memcmp ( mode, "w", 1 ) == 0 && pioinfo->type != PIO_NONE )
return pioFileOpenW ( filename );
#endif
......@@ -1161,7 +1161,7 @@ int fileClose(int fileID)
bfile_t *fileptr;
/* begin deike */
#ifndef NOMPI
#ifdef USE_MPI
if ( pioinfo->type != PIO_NONE )
return pioFileClose ( fileID );
#endif
......
......@@ -50,7 +50,7 @@ cat > ${PROG} << EOR
#include <aio.h>
#endif
#include <stdbool.h>
#ifndef NOMPI
#ifdef USE_MPI
#include "mpi.h"
#endif
#include <assert.h>
......
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifndef NOMPI
#ifdef USE_MPI
#include "mpi.h"
#include "cdi.h"
......@@ -15,7 +19,7 @@
bool ddebug = false;
#ifndef NOMPI
#ifdef USE_MPI
char * command2charP[6] = {"IO_Open_file", "IO_Close_file",
"IO_Get_fp","IO_Set_fp",
......@@ -347,7 +351,7 @@ void setPioCommunicator ( MPI_Comm *myComm, MPI_Comm commF2C, int *color,
int pioInit ( int ptype, int commF, int *color, int *nnodes, int *pioCollComm2F )
{
#ifndef NOMPI
#ifdef USE_MPI
MPI_Comm comm;
int size, rank;
#endif
......@@ -356,7 +360,7 @@ int pioInit ( int ptype, int commF, int *color, int *nnodes, int *pioCollComm2F
*color = 1;
*pioCollComm2F = 0;
#ifndef NOMPI
#ifdef USE_MPI
comm = MPI_COMM_NULL;
......@@ -442,7 +446,7 @@ int pioInit ( int ptype, int commF, int *color, int *nnodes, int *pioCollComm2F
void pioFinalize ()
{
#ifndef NOMPI
#ifdef USE_MPI
switch ( pioinfo->type )
{
case PIO_POSIX_FPGUARD_THREAD:
......
#ifndef _PIO_H
#define _PIO_H
#ifndef NOMPI
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef USE_MPI
#include <stdlib.h>
#include "mpi.h"
......
#define _XOPEN_SOURCE 600
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
......@@ -7,7 +11,7 @@
#include <unistd.h>
#include <string.h>
#ifndef NOMPI
#ifdef USE_MPI
#include "pio_impl.h"
bool ldebug =true;
......
#ifndef _PIO_IMPL_H
#define _PIO_IMPL_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdbool.h>
#ifndef NOMPI
#ifdef USE_MPI
#include "mpi.h"
typedef enum
......
#ifndef NOMPI
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef USE_MPI
#include <stdbool.h>
#include <stdio.h>
......
......@@ -2,8 +2,12 @@
todo
README: specialRank Pe closes down, when all output files are closed
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifndef NOMPI
#ifdef USE_MPI
#ifndef _SX
#include <stdbool.h>
......
......@@ -4,7 +4,11 @@
( pioOpenFile member name, recv in tmpbuffer, if(!uniqueName(q,v,n))abort )
*/
#ifndef NOMPI
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef USE_MPI
#include <stdio.h>
#include <stdbool.h>
......
......@@ -4,8 +4,11 @@
mutexes for each filedatas offset
mutex for queue
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifndef NOMPI
#ifdef USE_MPI
#include <pthread.h>
#include <stdlib.h>
......
......@@ -12,7 +12,11 @@
change condition to refuse of message ( without hard coding )
*/
#ifndef NOMPI
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef USE_MPI
#include <pthread.h>
#include <stdlib.h>
......
//pio_posixnonb.c:693: warning: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifndef NOMPI
#ifdef USE_MPI
#include <stdbool.h>
#include <stdio.h>
......
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#ifndef NOMPI
#ifdef USE_MPI
#include "pio_impl.h"
queue *queueInit ( valDestroyFunction vD, keyCompareFunction kC )
......
#if defined (HAVE_CONFIG_H)
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
......@@ -66,7 +66,7 @@ int grib2ltypeToZaxisType(int grib_ltype)
/* begin deike */
#ifndef NOMPI
#ifdef USE_MPI
#include "pio.h"
extern pioInfo *pioinfo;
#endif
......@@ -579,7 +579,7 @@ int grbWriteVarSliceDP(int streamID, int varID, int levelID, const double *data,
/* begin deike */
#ifndef NOMPI
#ifdef USE_MPI
if ( pioinfo->type != PIO_NONE )
nwrite = pioFileWrite ( fileID, tsID, gribbuffer, nbytes );
else
......
Supports Markdown
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