Commit 9d1fc459 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Elide #ifdef USE_MPI in code only compiled when USE_MPI is defined.

parent c1d6f0b3
......@@ -61,9 +61,6 @@ cat > ${PROG} << EOR
#include <aio.h>
#endif
#include <stdbool.h>
#ifdef USE_MPI
#include "mpi.h"
#endif
#include <assert.h>
#if defined (HAVE_LIBGRIB_API)
......
......@@ -3,8 +3,6 @@
#endif
#ifdef USE_MPI
#include <ctype.h>
#include <yaxt.h>
......@@ -202,7 +200,6 @@ void backendCleanup ( void )
/***************************************************************/
#endif
/*
* Local Variables:
* c-file-style: "Java"
......
......@@ -5,7 +5,6 @@
# include "config.h"
#endif
#ifdef USE_MPI
#include <stdlib.h>
#include <mpi.h>
......@@ -17,9 +16,6 @@ int pioFileOpen(const char *filename, const char *mode);
int pioFileClose ( int );
size_t cdiPioFileWrite(int fileID, const void *restrict buffer, size_t len,
int tsID);
#else
typedef int MPI_Comm;
#endif
#endif
/*
......
......@@ -2,7 +2,7 @@
# include "config.h"
#endif
#if defined USE_MPI && defined (HAVE_NETCDF4) && defined (HAVE_PARALLEL_NC4)
#if defined (HAVE_NETCDF4) && defined (HAVE_PARALLEL_NC4)
#include <netcdf.h>
#ifdef HAVE_NETCDF_PAR_H
......@@ -63,7 +63,6 @@ cdiPioEnableNetCDFParAccess()
namespaceSwitchSet(NSSWITCH_CDF_DEF_VAR, NSSW_FUNC(cdiPioCdfDefVar));
}
#endif
/*
* Local Variables:
......
......@@ -2,7 +2,6 @@
# include "config.h"
#endif
#ifdef USE_MPI
#include <ctype.h>
#include <yaxt.h>
......@@ -280,7 +279,6 @@ cdiPioClientSetup(int *pioNamespace_, int *pioNamespace)
}
#endif
/*
* Local Variables:
* c-file-style: "Java"
......
......@@ -10,8 +10,6 @@
#include "dmemory.h"
#include "pio_util.h"
#ifdef USE_MPI
#include "cdipio.h"
typedef struct {
......@@ -860,9 +858,6 @@ void commPrint ( FILE * fp )
fprintf ( fp, "\n" );
}
#endif
/************************************************************************/
/*
* Local Variables:
......
......@@ -5,8 +5,6 @@
# include "config.h"
#endif
#ifdef USE_MPI
#include <mpi.h>
#include <stdio.h>
#include "cdi.h"
......@@ -71,7 +69,6 @@ int commInqNProcsColl ( void );
void commPrint ( FILE * );
#endif
#endif
/*
* Local Variables:
......
......@@ -13,7 +13,6 @@
#include <unistd.h>
#include <string.h>
#ifdef USE_MPI
#include "pio_impl.h"
#include "pio_util.h"
......@@ -162,7 +161,6 @@ dbuffer_push(struct dBuffer *dbuffer, const void *buffer, size_t len)
return 0;
}
#endif
/*
* Local Variables:
* c-file-style: "Java"
......
......@@ -7,8 +7,7 @@
#include <stdbool.h>
#ifdef USE_MPI
#include "mpi.h"
#include <mpi.h>
typedef enum
{
......@@ -93,7 +92,6 @@ void finalizePOSIXFPGUARDSENDRECV ( void );
/* pio_posixnonb.c */
void pioWriterStdIO(void);
#endif
#endif
/*
* Local Variables:
......
......@@ -7,10 +7,8 @@
#include <stdio.h>
#include <stdarg.h>
#ifdef USE_MPI
#include <mpi.h>
#include <yaxt.h>
#endif
#include "cdi.h"
#include "cdipio.h"
......@@ -18,7 +16,6 @@
#include "pio_util.h"
#include "vlist_var.h"
#ifdef USE_MPI
#include "namespace.h"
#include "pio.h"
#include "pio_serialize.h"
......@@ -732,8 +729,6 @@ void pioBufferFuncCall(struct winHeaderEntry header,
xdebug("%s", "RETURN");
}
#endif
void
cdiPioNoPostCommSetup(void)
......@@ -743,9 +738,6 @@ cdiPioNoPostCommSetup(void)
/*****************************************************************************/
/* pioInit definition must currently compile even in non-MPI configurations */
#ifndef MPI_VERSION
# define MPI_Comm int
#endif
/**
@brief initializes the MPI_Communicators needed for the
communication between the calculator PEs and the I/O PEs and within the
......@@ -771,17 +763,14 @@ cdiPioNoPostCommSetup(void)
@return int indicating wether the calling PE is a calcutator (1) or not (0)
*/
#ifdef USE_MPI
static int pioNamespace_ = -1;
static int xtInitByCDI = 0;
#endif
MPI_Comm
pioInit(MPI_Comm commGlob, int nProcsIO, int IOMode,
int *pioNamespace, float partInflate,
void (*postCommSetupActions)(void))
{
#ifdef USE_MPI
int sizeGlob;
namespaceSwitchSet(NSSWITCH_WARNING, NSSW_FUNC(cdiPioWarning));
......@@ -838,20 +827,12 @@ pioInit(MPI_Comm commGlob, int nProcsIO, int IOMode,
xdebug ( "nProcsGlob=%d, RETURN", sizeGlob );
return commInqCommModel ();
#else
abort();
#endif
}
#ifndef MPI_VERSION
# undef MPI_Comm
#endif
/*****************************************************************************/
void pioEndDef ( void )
{
#ifdef USE_MPI
char * buffer;
int bufferSize;
int rankGlob = commInqRankGlob ();
......@@ -876,18 +857,15 @@ void pioEndDef ( void )
modelWinCreate ();
namespaceDefResStatus ( STAGE_TIMELOOP );
xdebug("%s", "RETURN");
#endif
}
/************************************************************************/
void pioEndTimestepping ( void )
{
#ifdef USE_MPI
xdebug("%s", "START");
namespaceDefResStatus ( STAGE_CLEANUP );
xdebug("%s", "RETURN");
#endif
}
......@@ -905,7 +883,6 @@ void pioEndTimestepping ( void )
void pioFinalize ( void )
{
#ifdef USE_MPI
int collID, ibuffer = 1111;
xdebug("%s", "START");
......@@ -924,14 +901,12 @@ void pioFinalize ( void )
if (xtInitByCDI)
xt_finalize();
xdebug("%s", "RETURN");
#endif
}
/************************************************************************/
void pioWriteTimestep()
{
#ifdef USE_MPI
int collID, iAssert = MPI_MODE_NOPUT;
/* int tokenEnd = END; */
int rankGlob = commInqRankGlob ();
......@@ -966,11 +941,8 @@ void pioWriteTimestep()
}
xdebug("%s", "RETURN. messages sent, windows posted");
#endif
}
#if defined USE_MPI
void
streamWriteVarPart(int streamID, int varID, const void *data,
int nmiss, Xt_idxlist partDesc)
......@@ -1018,8 +990,6 @@ streamWriteScatteredVarPart(int streamID, int varID, const void *data,
numBlocks, blocklengths, displacements,
nmiss, partDesc);
}
#endif
/*
* Local Variables:
......
......@@ -5,8 +5,6 @@
# include "config.h"
#endif
#ifdef USE_MPI
#include <mpi.h>
#include <yaxt.h>
......@@ -36,8 +34,6 @@ void memcpyPackFunc(void *dataDesc, void *buf, int size, int *pos, void *context
extern float cdiPIOpartInflate_;
#endif
#endif
/*
* Local Variables:
......
......@@ -11,7 +11,6 @@
#include "cdi.h"
#include "dmemory.h"
#ifdef USE_MPI
#include "pio_impl.h"
#include "pio_util.h"
......@@ -145,8 +144,6 @@ listSetForeach(listSet *q, void (*func)(void *elem, void *data), void *data)
func(p->val, data);
}
#endif
/*
* Local Variables:
* c-file-style: "Java"
......
......@@ -2,8 +2,6 @@
# include "config.h"
#endif
#ifdef USE_MPI
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
......@@ -338,7 +336,6 @@ initMPINONB(void (*postCommSetupActions)(void))
xabort ( "listSetNew did not succeed" );
}
#endif
/*
* Local Variables:
* c-file-style: "Java"
......
......@@ -7,7 +7,6 @@
#endif
#ifdef USE_MPI
#ifndef _SX
#include <aio.h>
......@@ -408,12 +407,9 @@ void pioWriterAIO(void)
/***************************************************************/
/***************************************************************/
#endif
#endif
/*
* Local Variables:
......
......@@ -8,8 +8,6 @@
# include "config.h"
#endif
#ifdef USE_MPI
#include <inttypes.h>
#include <stdio.h>
#include <stdbool.h>
......@@ -538,7 +536,6 @@ initPOSIXFPGUARDSENDRECV(void (*postCommSetupActions)(void))
bibAFiledataPF = listSetNew( destroyAFiledataPF, compareNamesAPF );
}
#endif
/*
* Local Variables:
* c-file-style: "Java"
......
......@@ -2,8 +2,6 @@
# include "config.h"
#endif
#ifdef USE_MPI
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
......@@ -290,7 +288,6 @@ pioWriterStdIO(void)
}
}
#endif
/*
* Local Variables:
* c-file-style: "Java"
......
......@@ -2,8 +2,6 @@
# include "config.h"
#endif
#ifdef USE_MPI
#include <inttypes.h>
#include <stdlib.h>
......@@ -347,7 +345,6 @@ pioSendInitialize(void (*postCommSetupActions)(void))
bibRemoteFileBuf = listSetNew(destroyRemoteFileBuf, compareNames);
}
#endif
/*
* Local Variables:
* c-file-style: "Java"
......
......@@ -5,8 +5,6 @@
# include "config.h"
#endif
#ifdef USE_MPI
#include <mpi.h>
#include <yaxt.h>
......@@ -96,7 +94,6 @@ enum
#endif
#endif
/*
* Local Variables:
* c-file-style: "Java"
......
......@@ -2,8 +2,6 @@
# include "config.h"
#endif
#ifdef USE_MPI
#include <inttypes.h>
#include <mpi.h>
......@@ -110,7 +108,6 @@ void serializeSetMPI()
}
#endif
/*
* Local Variables:
* c-file-style: "Java"
......
......@@ -4,8 +4,6 @@
# include "config.h"
#endif
#ifdef USE_MPI
#include "pio_server.h"
......@@ -1169,7 +1167,6 @@ void IOServer(void (*postCommSetupActions)(void))
}
}
#endif
/*
* Local Variables:
* c-file-style: "Java"
......
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