Skip to content
Snippets Groups Projects
Commit 357ebf49 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel: Committed by Sergey Kosukhin
Browse files

Rename function according to actual query.

* While the previous name suggested a fileID, a streamID is used instead
  and the map is by now also used for collectively opened streams.
* Also adjust documentation to mirror actual behaviour.
parent faa459b9
No related branches found
No related tags found
2 merge requests!34Version 2.2.0,!13Consolidation with CDI-PIO (develop)
......@@ -664,9 +664,9 @@ writeNetCDFStreamParallel(size_t streamIdx, struct streamMapping *mapping, void
#endif
#if defined(HAVE_LIBNETCDF)
/* needed for writing when some files are only written to by a single process */
/* cdiOpenFileMap(fileID) gives the writer process */
/* cdiOpenStreamMap(streamID) gives the writer process */
static int
cdiPioSerialOpenFileMap(int streamID)
cdiPioStream2Owner(int streamID)
{
size_t streamIdx = indexOfID(&openStreams, streamID);
xassert(streamIdx < SIZE_MAX);
......@@ -710,7 +710,7 @@ cdiPioCloseFileOnRank(int rank)
static void
cdiPioServerCdfDefVars(stream_t *streamptr)
{
int rank, rankOpen = cdiPioSerialOpenFileMap(streamptr->self);
int rank, rankOpen = cdiPioStream2Owner(streamptr->self);
if (commInqIOMode() == PIO_NONE
#ifdef HAVE_PARALLEL_NC4
|| rankOpen == CDI_PIO_COLLECTIVE_OPEN
......@@ -729,7 +729,7 @@ writeNetCDFStreamSerial(size_t streamIdx, struct streamMapping *mapping, void **
* which has data for which variable (var owner)
* three cases need to be distinguished */
const int streamID = openStreams.entries[streamIdx], vlistID = streamInqVlist(streamID);
const int writerRank = cdiPioSerialOpenFileMap(streamID);
const int writerRank = cdiPioStream2Owner(streamID);
const int collRank = commInqRankColl();
const MPI_Comm collComm = commInqCommColl(); // HB: which communicator is to be supplied here?
const bool reuseRedists
......@@ -798,7 +798,7 @@ writeNetCDFStream(size_t streamIdx, struct streamMapping *mapping, void **data_,
= writeNetCDFStreamSerial;
#ifdef HAVE_PARALLEL_NC4
int streamID = openStreams.entries[streamIdx];
int rankOpen = cdiPioSerialOpenFileMap(streamID);
int rankOpen = cdiPioStream2Owner(streamID);
if (rankOpen == CDI_PIO_COLLECTIVE_OPEN) writeNetCDFStream_ = writeNetCDFStreamParallel;
#endif
writeNetCDFStream_(streamIdx, mapping, data_, currentDataBufSize, conf);
......@@ -1382,7 +1382,7 @@ getMaxNumStreamWrites(stream_t *streamptr)
case CDI_FILETYPE_NC4:
case CDI_FILETYPE_NC4C:
{
int rank, rankOpen = cdiPioSerialOpenFileMap(streamptr->self);
int rank, rankOpen = cdiPioStream2Owner(streamptr->self);
if (commInqIOMode() == PIO_NONE
#ifdef HAVE_PARALLEL_NC4
|| rankOpen == CDI_PIO_COLLECTIVE_OPEN
......@@ -1424,7 +1424,7 @@ cdiPioServerStreamClose(stream_t *streamptr, int recordBufIsToBeDeleted)
#ifdef HAVE_LIBNETCDF
case CDI_FILETYPE_NETCDF:
{
int rank, rankOpen = cdiPioSerialOpenFileMap(streamptr->self);
int rank, rankOpen = cdiPioStream2Owner(streamptr->self);
if (commInqIOMode() == PIO_NONE
#ifdef HAVE_PARALLEL_NC4
|| rankOpen == CDI_PIO_COLLECTIVE_OPEN
......@@ -1458,7 +1458,7 @@ cdiPioServerStreamClose(stream_t *streamptr, int recordBufIsToBeDeleted)
static void
cdiPioCdfDefTimestep(stream_t *streamptr, int tsID)
{
int rank, streamID = streamptr->self, rankOpen = cdiPioSerialOpenFileMap(streamID);
int rank, streamID = streamptr->self, rankOpen = cdiPioStream2Owner(streamID);
if (commInqIOMode() == PIO_NONE
#ifdef HAVE_PARALLEL_NC4
|| rankOpen == CDI_PIO_COLLECTIVE_OPEN
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment