Commit 6fb6e054 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Move client-side streamOpen to pio_client.c.

parent 7cc363cf
......@@ -142,35 +142,6 @@ int pioFileOpen(const char *filename, const char *mode)
/***************************************************************/
int
cdiPioStreamOpen(const char *filename, const char *filemode,
int filetype, stream_t *streamptr,
int recordBufIsToBeCreated)
{
if ( tolower ( * filemode ) == 'w' )
{
statusCode nspStatus = namespaceInqResStatus ();
switch ( nspStatus )
{
case STAGE_DEFINITION:
break;
case STAGE_TIMELOOP:
pioBufferFuncCall(STREAMOPEN, 2, filename, filetype);
break;
case STAGE_CLEANUP:
xabort ( "TRANSITION TO IO PROCESSES ALREADY FINISHED." );
break;
default:
xabort ( "INTERNAL ERROR" );
}
}
else
Error("cdiPIO read support not implemented");
return 1;
}
/***************************************************************/
void backendInit ( void )
{
int IOMode = commInqIOMode ();
......
......@@ -18,9 +18,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);
int cdiPioStreamOpen(const char *filename, const char *filemode,
int filetype, stream_t *streamptr,
int recordBufIsToBeCreated);
#else
typedef int MPI_Comm;
#endif
......
......@@ -3,6 +3,8 @@
#endif
#ifdef USE_MPI
#include <ctype.h>
#include <yaxt.h>
#include "namespace.h"
......@@ -13,6 +15,33 @@
#include "pio_rpc.h"
#include "pio_util.h"
static int
cdiPioClientStreamOpen(const char *filename, const char *filemode,
int filetype, stream_t *streamptr,
int recordBufIsToBeCreated)
{
if ( tolower ( * filemode ) == 'w' )
{
statusCode nspStatus = namespaceInqResStatus ();
switch ( nspStatus )
{
case STAGE_DEFINITION:
break;
case STAGE_TIMELOOP:
pioBufferFuncCall(STREAMOPEN, 2, filename, filetype);
break;
case STAGE_CLEANUP:
xabort ( "TRANSITION TO IO PROCESSES ALREADY FINISHED." );
break;
default:
xabort ( "INTERNAL ERROR" );
}
}
else
Error("cdiPIO read support not implemented");
return 1;
}
static void
cdiPioClientStreamDefVlist_(int streamID, int vlistID)
{
......@@ -99,7 +128,7 @@ cdiPioClientSetup(int *pioNamespace_, int *pioNamespace)
int callerCDINamespace = namespaceGetActive();
pioNamespaceSetActive(*pioNamespace_);
serializeSetMPI();
namespaceSwitchSet(NSSWITCH_STREAM_OPEN_BACKEND, cdiPioStreamOpen);
namespaceSwitchSet(NSSWITCH_STREAM_OPEN_BACKEND, cdiPioClientStreamOpen);
namespaceSwitchSet(NSSWITCH_STREAM_DEF_VLIST_, cdiPioClientStreamDefVlist_);
namespaceSwitchSet(NSSWITCH_STREAM_WRITE_VAR_, cdiPioClientStreamWriteVar_);
namespaceSwitchSet(NSSWITCH_STREAM_WRITE_VAR_CHUNK_,
......
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