Commit 79e57a6d authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Move CDI-pio client side functionality to pio_client.[ch].

parent e1b5a90e
......@@ -230,6 +230,8 @@ src/pio.c -text
src/pio.h -text
src/pio_cdf_int.c -text
src/pio_cdf_int.h -text
src/pio_client.c -text
src/pio_client.h -text
src/pio_comm.c -text
src/pio_comm.h -text
src/pio_dbuffer.c -text
......
......@@ -74,6 +74,8 @@ libcdi_la_SOURCES = \
resource_unpack.h \
resource_unpack.c \
pio_rpc.h \
pio_client.c \
pio_client.h \
pio_server.c \
pio_server.h \
pio_util.c \
......
......@@ -117,13 +117,14 @@ am_libcdi_la_OBJECTS = basetime.lo binary.lo calendar.lo cdf.lo \
pio_dbuffer.lo pio_interface.lo pio_mpinonb.lo \
pio_record_send.lo pio_posixasynch.lo \
pio_posixfpguardsendrecv.lo pio_posixnonb.lo pio_list_set.lo \
resource_unpack.lo pio_server.lo pio_util.lo pio_serialize.lo \
pio_cdf_int.lo resource_handle.lo servicelib.lo stream_cdf.lo \
stream_cgribex.lo stream_ext.lo stream_grb.lo \
stream_gribapi.lo stream_history.lo stream_ieg.lo cdi_int.lo \
stream_record.lo stream_srv.lo stream_var.lo table.lo taxis.lo \
timebase.lo tsteps.lo util.lo varscan.lo version.lo vlist.lo \
vlist_att.lo vlist_var.lo zaxis.lo stream.lo swap.lo
resource_unpack.lo pio_client.lo pio_server.lo pio_util.lo \
pio_serialize.lo pio_cdf_int.lo resource_handle.lo \
servicelib.lo stream_cdf.lo stream_cgribex.lo stream_ext.lo \
stream_grb.lo stream_gribapi.lo stream_history.lo \
stream_ieg.lo cdi_int.lo stream_record.lo stream_srv.lo \
stream_var.lo table.lo taxis.lo timebase.lo tsteps.lo util.lo \
varscan.lo version.lo vlist.lo vlist_att.lo vlist_var.lo \
zaxis.lo stream.lo swap.lo
libcdi_la_OBJECTS = $(am_libcdi_la_OBJECTS)
@ENABLE_CDI_LIB_FALSE@am_libcdi_la_rpath =
@ENABLE_CDI_LIB_TRUE@am_libcdi_la_rpath = -rpath $(libdir)
......@@ -407,6 +408,8 @@ libcdi_la_SOURCES = \
resource_unpack.h \
resource_unpack.c \
pio_rpc.h \
pio_client.c \
pio_client.h \
pio_server.c \
pio_server.h \
pio_util.c \
......@@ -591,6 +594,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/namespace.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_cdf_int.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_client.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_comm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_dbuffer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_interface.Plo@am__quote@
......
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef USE_MPI
#include "namespace.h"
#include "pio.h"
#include "pio_client.h"
#include "pio_comm.h"
#if defined HAVE_LIBNETCDF
static void
cdiPioCdfDefTimestepNOP(stream_t *streamptr, int tsID)
{
}
#endif
void
cdiPioClientSetup(int *pioNamespace_, int *pioNamespace)
{
commEvalPhysNodes ();
commDefCommsIO ();
*pioNamespace_ = *pioNamespace = namespaceNew(0);
int callerCDINamespace = namespaceGetActive();
pioNamespaceSetActive(*pioNamespace_);
serializeSetMPI();
namespaceSwitchSet(NSSWITCH_STREAM_OPEN_BACKEND, cdiPioStreamOpen);
namespaceSwitchSet(NSSWITCH_STREAM_DEF_VLIST_, cdiPioStreamDefVlist_);
namespaceSwitchSet(NSSWITCH_STREAM_WRITE_VAR_, cdiPioStreamWriteVar_);
namespaceSwitchSet(NSSWITCH_STREAM_WRITE_VAR_CHUNK_,
cdiPioStreamWriteVarChunk_);
namespaceSwitchSet(NSSWITCH_STREAM_CLOSE_BACKEND, cdiPioStreamClose);
#ifdef HAVE_LIBNETCDF
namespaceSwitchSet(NSSWITCH_CDF_DEF_TIMESTEP, cdiPioCdfDefTimestepNOP);
#endif
pioNamespaceSetActive(callerCDINamespace);
}
#endif
#ifndef PIO_CLIENT_H
#define PIO_CLIENT_H
void
cdiPioClientSetup(int *pioNamespace_, int *pioNamespace);
#endif
......@@ -23,6 +23,7 @@
#include "pio_interface.h"
#include "pio_comm.h"
#include "pio_rpc.h"
#include "pio_client.h"
#include "pio_server.h"
#include "resource_handle.h"
#include "cdi_int.h"
......@@ -698,13 +699,6 @@ static int pioNamespace_ = -1;
static int xtInitByCDI = 0;
#endif
#if defined USE_MPI && defined HAVE_LIBNETCDF
static void
cdiPioCdfDefTimestepNOP(stream_t *streamptr, int tsID)
{
}
#endif
MPI_Comm
pioInit(MPI_Comm commGlob, int nProcsIO, int IOMode,
int *pioNamespace, float partInflate)
......@@ -761,24 +755,7 @@ pioInit(MPI_Comm commGlob, int nProcsIO, int IOMode,
exit ( EXIT_SUCCESS );
}
else
{
commEvalPhysNodes ();
commDefCommsIO ();
pioNamespace_ = *pioNamespace = namespaceNew(0);
int callerCDINamespace = namespaceGetActive();
pioNamespaceSetActive(pioNamespace_);
serializeSetMPI();
namespaceSwitchSet(NSSWITCH_STREAM_OPEN_BACKEND, cdiPioStreamOpen);
namespaceSwitchSet(NSSWITCH_STREAM_DEF_VLIST_, cdiPioStreamDefVlist_);
namespaceSwitchSet(NSSWITCH_STREAM_WRITE_VAR_, cdiPioStreamWriteVar_);
namespaceSwitchSet(NSSWITCH_STREAM_WRITE_VAR_CHUNK_,
cdiPioStreamWriteVarChunk_);
namespaceSwitchSet(NSSWITCH_STREAM_CLOSE_BACKEND, cdiPioStreamClose);
#ifdef HAVE_LIBNETCDF
namespaceSwitchSet(NSSWITCH_CDF_DEF_TIMESTEP, cdiPioCdfDefTimestepNOP);
#endif
pioNamespaceSetActive(callerCDINamespace);
}
cdiPioClientSetup(&pioNamespace_, pioNamespace);
xdebug ( "nProcsGlob=%d, RETURN", sizeGlob );
return commInqCommModel ();
......
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