Commit 4dcc8808 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Rename pioNamespaceSetActive and make part of core interface.

* Also include namespaceNew and namespaceDelete in cdi.h.
parent 998e24ae
......@@ -225,7 +225,7 @@ int main (int argc, char *argv[])
cdiPioNoPostCommSetup);
if (commModel != MPI_COMM_NULL)
{
pioNamespaceSetActive(pioNamespace);
namespaceSetActive(pioNamespace);
#endif
modelRun(commModel);
......
......@@ -43,7 +43,7 @@ PROGRAM collectdata2003
commModel = pioInit(commGlob, nProcsIO, IOMode, pio_namespace, 1.1, &
cdiPioNoPostCommSetup)
run_model = commModel /= MPI_COMM_NULL
IF (run_model) CALL pioNamespaceSetActive(pio_namespace)
IF (run_model) CALL namespaceSetActive(pio_namespace)
#endif
IF (run_model) CALL modelrun ( commModel )
......
......@@ -267,7 +267,7 @@ int main (int argc, char *argv[])
cdiPioNoPostCommSetup);
if (commModel != MPI_COMM_NULL)
{
pioNamespaceSetActive(pioNamespace);
namespaceSetActive(pioNamespace);
#endif
modelRun(commModel);
......
......@@ -192,7 +192,7 @@ static void modelRun ( MPI_Comm comm )
int bufferSize, differ;
MPI_Status status;
pioNamespaceSetActive ( 0 );
namespaceSetActive ( 0 );
gridID = defineGrid ();
zaxisID = defineZaxis ();
......@@ -210,7 +210,7 @@ static void modelRun ( MPI_Comm comm )
xmpi ( MPI_Recv ( recvBuffer, bufferSize, MPI_PACKED, 0,
0, comm, &status ));
pioNamespaceSetActive ( 1 );
namespaceSetActive ( 1 );
reshUnpackResources(recvBuffer, bufferSize, &comm);
free ( recvBuffer );
reshPackBufferDestroy ( &sendBuffer );
......@@ -219,7 +219,7 @@ static void modelRun ( MPI_Comm comm )
printf ( "The resource arrays %s.\n", differ ? "differ" : "are equal" );
printResources();
pioNamespaceSetActive ( 0 );
namespaceSetActive ( 0 );
streamClose(streamID);
return;
}
......@@ -246,7 +246,7 @@ int main (int argc, char *argv[])
commModel = pioInit(commGlob, nProcsIO, IOMode, &pioNamespace, 1.0f,
cdiPioNoPostCommSetup);
pioNamespaceSetActive(pioNamespace);
namespaceSetActive(pioNamespace);
modelRun ( commModel );
......
......@@ -232,6 +232,11 @@ void cdiDefMissval(double missval);
double cdiInqMissval(void);
void cdiDefGlobal(const char *string, int val);
int namespaceNew();
void namespaceSetActive(int namespaceID);
void namespaceDelete(int namespaceID);
/* CDI converter routines */
/* parameter */
......
......@@ -399,6 +399,17 @@
! INTEGER val)
EXTERNAL cdiDefGlobal
INTEGER namespaceNew
EXTERNAL namespaceNew
! namespaceSetActive
! (INTEGER namespaceID)
EXTERNAL namespaceSetActive
! namespaceDelete
! (INTEGER namespaceID)
EXTERNAL namespaceDelete
!
! CDI converter routines
!
......
......@@ -72,6 +72,9 @@ FCALLSCFUN1 (INT, cdiHaveFiletype, CDIHAVEFILETYPE, cdihavefiletype, INT)
FCALLSCSUB1 (cdiDefMissval, CDIDEFMISSVAL, cdidefmissval, DOUBLE)
FCALLSCFUN0 (DOUBLE, cdiInqMissval, CDIINQMISSVAL, cdiinqmissval)
FCALLSCSUB2 (cdiDefGlobal, CDIDEFGLOBAL, cdidefglobal, STRING, INT)
FCALLSCFUN0 (INT, namespaceNew, NAMESPACENEW, namespacenew)
FCALLSCSUB1 (namespaceSetActive, NAMESPACESETACTIVE, namespacesetactive, INT)
FCALLSCSUB1 (namespaceDelete, NAMESPACEDELETE, namespacedelete, INT)
/* CDI converter routines */
......
......@@ -42,6 +42,4 @@ void streamWriteVarPart (int streamID, int varID,
const void *data, int nmiss,
Xt_idxlist partDesc);
void pioNamespaceSetActive ( int );
#endif
! This file was automatically generated, don't edit!
!
! Fortran interface for CDI library version 1.6.1.1
! Fortran interface for CDI library version 1.6.2
!
! Author:
! -------
......@@ -58,7 +58,3 @@
! TYPE(XT_IDXLIST)partDesc)
EXTERNAL streamWriteVarPart
! pioNamespaceSetActive
! (INTEGER )
EXTERNAL pioNamespaceSetActive
......@@ -45,6 +45,5 @@ static void streamWriteVarPart_fwrap(int streamID, int varID, const void *data,
streamWriteVarPart(streamID, varID, data, nmiss, (*(Xt_idxlist *)partDesc));
}
FCALLSCSUB5 (streamWriteVarPart_fwrap, STREAMWRITEVARPART, streamwritevarpart, INT, INT, PVOID, INT, PVOID)
FCALLSCSUB1 (pioNamespaceSetActive, PIONAMESPACESETACTIVE, pionamespacesetactive, INT)
#endif
......@@ -190,7 +190,7 @@ int namespaceGetNumber ()
}
void pioNamespaceSetActive ( int nId )
void namespaceSetActive ( int nId )
{
xassert(nId < namespacesSize && nId >= 0
&& namespaces[nId].resStage != STAGE_UNUSED);
......
......@@ -59,7 +59,7 @@ int namespaceNew();
void namespaceDelete(int namespaceID);
void namespaceCleanup ( void );
int namespaceGetNumber ( void );
void pioNamespaceSetActive(int namespaceID);
void namespaceSetActive(int namespaceID);
int namespaceGetActive ( void );
int namespaceIdxEncode ( namespaceTuple_t );
int namespaceIdxEncode2 ( int, int );
......
......@@ -222,7 +222,7 @@ cdiPioClientSetup(int *pioNamespace_, int *pioNamespace)
commDefCommsIO ();
*pioNamespace_ = *pioNamespace = namespaceNew();
int callerCDINamespace = namespaceGetActive();
pioNamespaceSetActive(*pioNamespace_);
namespaceSetActive(*pioNamespace_);
serializeSetMPI();
namespaceSwitchSet(NSSWITCH_STREAM_OPEN_BACKEND,
NSSW_FUNC(cdiPioClientStreamOpen));
......@@ -246,7 +246,7 @@ cdiPioClientSetup(int *pioNamespace_, int *pioNamespace)
namespaceSwitchSet(NSSWITCH_CDF_STREAM_SETUP,
NSSW_FUNC(cdiPioClientStreamNOP));
#endif
pioNamespaceSetActive(callerCDINamespace);
namespaceSetActive(callerCDINamespace);
}
......
......@@ -124,7 +124,7 @@ reshListDestruct(int namespaceID)
LIST_LOCK();
xassert(resHList && namespaceID >= 0 && namespaceID < resHListSize);
int callerNamespaceID = namespaceGetActive();
pioNamespaceSetActive(namespaceID);
namespaceSetActive(namespaceID);
if (resHList[namespaceID].resources)
{
for ( int j = 0; j < resHList[namespaceID].size; j++ )
......@@ -137,7 +137,7 @@ reshListDestruct(int namespaceID)
reshListClearEntry(namespaceID);
}
if (resHList[callerNamespaceID].resources)
pioNamespaceSetActive(callerNamespaceID);
namespaceSetActive(callerNamespaceID);
LIST_UNLOCK();
}
......@@ -656,7 +656,7 @@ void reshListPrint(FILE *fp)
for ( i = 0; i < namespaceGetNumber (); i++ )
{
pioNamespaceSetActive ( i );
namespaceSetActive ( i );
fprintf ( fp, "\n" );
fprintf ( fp, "##################################\n" );
......@@ -680,7 +680,7 @@ void reshListPrint(FILE *fp)
fprintf ( fp, "#\n# end global resource list" \
"\n#\n##########################################\n\n" );
pioNamespaceSetActive ( temp );
namespaceSetActive ( temp );
}
......
......@@ -216,7 +216,7 @@ int main (int argc, char *argv[])
cdiPioNoPostCommSetup);
if (commModel != MPI_COMM_NULL)
{
pioNamespaceSetActive(pioNamespace);
namespaceSetActive(pioNamespace);
#else
commModel = -1;
#endif
......
......@@ -182,7 +182,7 @@ int modelRun ( MPI_Comm comm )
char * recvBuffer, * sendBuffer;
int bufferSize, differ;
pioNamespaceSetActive ( 0 );
namespaceSetActive(0);
if (IOMode != PIO_NONE)
serializeSetMPI();
......@@ -201,14 +201,14 @@ int modelRun ( MPI_Comm comm )
xmpi(MPI_Sendrecv(sendBuffer, bufferSize, MPI_PACKED, 0, 0,
recvBuffer, bufferSize, MPI_PACKED, 0, 0,
MPI_COMM_SELF, MPI_STATUS_IGNORE));
pioNamespaceSetActive ( 1 );
namespaceSetActive(1);
reshUnpackResources(recvBuffer, bufferSize, &comm);
free ( recvBuffer );
reshPackBufferDestroy ( &sendBuffer );
differ = reshListCompare ( 0, 1 );
pioNamespaceSetActive ( 0 );
namespaceSetActive(0);
streamClose(streamID);
return differ;
}
......@@ -235,7 +235,7 @@ int main (int argc, char *argv[])
commModel = pioInit(commGlob, nProcsIO, IOMode, &pioNamespace, 1.0f,
cdiPioNoPostCommSetup);
pioNamespaceSetActive(pioNamespace);
namespaceSetActive(pioNamespace);
exitCode = modelRun(commModel);
......
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