Commit 37479ca5 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Remove artifacts of old compute node decomposition.

parent ff998304
......@@ -241,8 +241,6 @@ void streamWriteVarPart (int streamID, int varID,
Xt_idxlist partDesc);
#endif /* make_fint keep */
int pioInqVarDecoChunk ( int, int );
int pioInqVarDecoOff ( int, int );
void pioNamespaceSetActive ( int );
/* CDI control routines */
......
......@@ -402,16 +402,6 @@
! TYPE(XT_IDXLIST)partDesc)
EXTERNAL streamWriteVarPart
INTEGER pioInqVarDecoChunk
! (INTEGER ,
! INTEGER )
EXTERNAL pioInqVarDecoChunk
INTEGER pioInqVarDecoOff
! (INTEGER ,
! INTEGER )
EXTERNAL pioInqVarDecoOff
! pioNamespaceSetActive
! (INTEGER )
EXTERNAL pioNamespaceSetActive
......
......@@ -93,8 +93,6 @@ static void streamWriteVarPart_fwrap(int streamID, int varID, const void * data,
}
FCALLSCSUB5 (streamWriteVarPart_fwrap, STREAMWRITEVARPART, streamwritevarpart, INT, INT, PVOID, INT, PVOID)
#endif /* make_fint keep */
FCALLSCFUN2 (INT, pioInqVarDecoChunk, PIOINQVARDECOCHUNK, pioinqvardecochunk, INT, INT)
FCALLSCFUN2 (INT, pioInqVarDecoOff, PIOINQVARDECOOFF, pioinqvardecooff, INT, INT)
FCALLSCSUB1 (pioNamespaceSetActive, PIONAMESPACESETACTIVE, pionamespacesetactive, INT)
/* CDI control routines */
......
......@@ -197,21 +197,8 @@ void
cdiPioStreamWriteVar_(int streamID, int varID, int memtype, const void *data,
int nmiss)
{
statusCode nspStatus = namespaceInqResStatus ();
switch ( nspStatus )
{
case STAGE_DEFINITION:
xabort ( "DEFINITION STAGE: PARALLEL WRITING NOT POSSIBLE." );
break;
case STAGE_TIMELOOP:
pioBufferData ( streamID, varID, data, nmiss );
return;
case STAGE_CLEANUP:
xabort ( "CLEANUP STAGE: PARALLEL WRITING NOT POSSIBLE." );
break;
default:
xabort ( "INTERNAL ERROR" );
}
xabort("parallel writing must give explicit partition information,"
" use streamWriteVarPart!");
}
/***************************************************************/
......
......@@ -231,38 +231,6 @@ varMapGen(int *vSizes, int *sSizes, int *varMapping,
/************************************************************************/
static void
defVarDeco(int vlistID, int varID)
{
int varSize, cRank, lChunk, rem, lOffset;
int nProcsModel = commInqNProcsModel ();
deco_t deco[nProcsModel];
varSize = vlistInqVarSize ( vlistID, varID );
for ( cRank = 0; cRank < nProcsModel; cRank++ )
{
lChunk = varSize / nProcsModel;
lOffset = cRank * lChunk;
rem = varSize % nProcsModel;
if ( cRank < rem )
{
lChunk++;
lOffset += cRank;
}
else
lOffset += rem;
deco[cRank].rank = cRank;
deco[cRank].offset = lOffset;
deco[cRank].chunk = lChunk;
}
vlistDefVarDeco ( vlistID, varID, nProcsModel, &deco[0] );
}
/************************************************************************/
static void
varsMapNDeco(int nNodes, int *nodeSizes)
{
......@@ -300,8 +268,6 @@ varsMapNDeco(int nNodes, int *nodeSizes)
for ( i = 0; i < nStreams; i++ )
for ( j = 0; j < * ( streamSizes + i ); j++ )
{
defVarDeco ( streamInqVlist ( *( resHs + i )), j );
defVarDeco ( streamInqVlistIDorig ( * ( resHs + i )), j );
vlistDefVarIOrank ( streamInqVlist ( * ( resHs + i )), j,
* ( varMapping + k ));
vlistDefVarIOrank ( streamInqVlistIDorig ( * ( resHs + i )), j,
......@@ -382,10 +348,14 @@ modelWinDefBufferSizes(void)
nvars = vlistNvars ( vlistID );
for ( varID = 0; varID < nvars; varID++ )
{
collID = CDI_UNDEFID;
collID = commRankGlob2CollID(vlistInqVarIOrank(vlistID, varID));
int collIDchunk = cdiPIOpartInflate_
* vlistInqVarDecoChunk(vlistID, varID, rankModel);
int collID = commRankGlob2CollID(vlistInqVarIOrank(vlistID, varID));
int collIDchunk;
{
int varSize = vlistInqVarSize(vlistID, varID);
int nProcsModel = commInqNProcsModel();
collIDchunk = (int)ceilf(cdiPIOpartInflate_
* (varSize + nProcsModel - 1)/nProcsModel);
}
xassert ( collID != CDI_UNDEFID && collIDchunk > 0 );
collIndex[collID].numDataRecords += 2;
txWin[collID].size += (size_t)collIDchunk * sizeof (double)
......@@ -557,21 +527,6 @@ modelWinEnqueue(int collID,
winDict[targetEntry] = header;
}
void pioBufferData(int streamID, int varID,
const double *data, int nmiss)
{
int rankModel = commInqRankModel ();
int vlistID = streamInqVlist(streamID);
int chunk = vlistInqVarDecoChunk(vlistID, varID, rankModel);
int start = pioInqVarDecoOff(vlistID, varID);
struct Xt_stripe stripe = { .start = start, .nstrides = chunk, .stride = 1 };
Xt_idxlist partDesc = xt_idxstripes_new(&stripe, 1);
pioBufferPartData(streamID, varID, data, nmiss, partDesc);
xt_idxlist_delete(partDesc);
}
void
pioBufferPartData(int streamID, int varID, const double *data,
int nmiss, Xt_idxlist partDesc)
......@@ -711,30 +666,6 @@ void pioBufferFuncCall(int funcID, int argc, ... )
/*****************************************************************************/
int pioInqVarDecoChunk ( int vlistID, int varID )
{
#ifdef USE_MPI
int rankModel = commInqRankModel ();
xassert ( rankModel != CDI_UNDEFID );
return vlistInqVarDecoChunk ( vlistID, varID, rankModel );
#endif
return vlistInqVarDecoChunk ( vlistID, varID, CDI_UNDEFID );
}
/*****************************************************************************/
int pioInqVarDecoOff ( int vlistID, int varID )
{
#ifdef USE_MPI
int rankModel = commInqRankModel ();
xassert ( rankModel != CDI_UNDEFID );
return vlistInqVarDecoOff ( vlistID, varID, rankModel );
#else
return vlistInqVarDecoOff ( vlistID, varID, CDI_UNDEFID );
#endif
}
/*****************************************************************************/
/* pioInit definition must currently compile even in non-MPI configurations */
#ifndef MPI_VERSION
# define MPI_Comm int
......
......@@ -100,9 +100,14 @@ collDefBufferSizes()
{
for ( modelID = 0; modelID < nProcsModel; modelID++ )
{
int decoChunk
= (int)(cdiPIOpartInflate_
* vlistInqVarDecoChunk(vlistID, varID, modelID));
int decoChunk;
{
int varSize = vlistInqVarSize(vlistID, varID);
int nProcsModel = commInqNProcsModel();
decoChunk =
(int)ceilf(cdiPIOpartInflate_
* (varSize + nProcsModel - 1)/nProcsModel);
}
xassert ( decoChunk > 0 );
rxWin[modelID].size += decoChunk * sizeof (double)
/* re-align chunks to multiple of double size */
......
......@@ -222,7 +222,6 @@ vlist_delete(vlist_t *vlistptr)
if ( vlistptr->vars[varID].units ) free(vlistptr->vars[varID].units);
if ( vlistptr->vars[varID].ensdata ) free(vlistptr->vars[varID].ensdata);
if ( vlistptr->vars[varID].deco ) free(vlistptr->vars[varID].deco);
#if defined (HAVE_LIBGRIB_API)
int i;
......@@ -321,14 +320,6 @@ void vlistCopy(int vlistID2, int vlistID1)
memcpy(vlistptr2->vars[varID].ensdata,
vlistptr1->vars[varID].ensdata, sizeof(ensinfo_t));
}
if ( vlistptr1->vars[varID].deco )
{
size_t decoSize = (size_t)vlistptr1->vars[varID].decoSize;
vlistptr2->vars[varID].deco = malloc(decoSize * sizeof (deco_t));
memcpy(vlistptr2->vars[varID].deco, vlistptr1->vars[varID].deco,
decoSize * sizeof (deco_t));
}
#if defined (HAVE_LIBGRIB_API)
/* ---------------------------------- */
/* Local change: 2013-01-28, FP (DWD) */
......@@ -1153,7 +1144,7 @@ vlistPrintKernel(vlist_t *vlistptr, FILE * fp )
int param, gridID, zaxisID, tsteptype, nlevs;
int dtype;
int i, iorank, decoSize, size, rank, offset, chunk;
int i, iorank, size, rank, offset, chunk;
char paramstr[32];
char *name, *longname, *units;
......@@ -1176,7 +1167,7 @@ vlistPrintKernel(vlist_t *vlistptr, FILE * fp )
if ( nvars > 0 )
{
fprintf(fp, " varID param gridID zaxisID tsteptype nlevel flag "
" name longname iorank decosize\n");
" name longname iorank\n");
for ( varID = 0; varID < nvars; varID++ )
{
param = vlistptr->vars[varID].param;
......@@ -1189,14 +1180,13 @@ vlistPrintKernel(vlist_t *vlistptr, FILE * fp )
units = vlistptr->vars[varID].units;
flag = vlistptr->vars[varID].flag;
iorank = vlistptr->vars[varID].iorank;
decoSize = vlistptr->vars[varID].decoSize;
cdiParamToString(param, paramstr, sizeof(paramstr));
fprintf(fp, "%6d %-8s %6d %6d %6d %6d %5d %-8s"
" %s %6d %6d",
" %s %6d",
varID, paramstr, gridID, zaxisID, tsteptype, nlevs, flag,
name ? name : "", longname ? longname : "",
iorank, decoSize);
iorank);
if ( units ) fprintf ( fp, " [%s]", units);
fprintf ( fp, "\n");
......@@ -1225,23 +1215,12 @@ vlistPrintKernel(vlist_t *vlistptr, FILE * fp )
}
fprintf(fp, "\n");
fprintf(fp, " varID size iorank decosize corank offset chunk\n");
fprintf(fp, " varID size iorank\n");
for ( varID = 0; varID < nvars; varID++ )
{
iorank = vlistptr->vars[varID].iorank;
decoSize = vlistptr->vars[varID].decoSize;
size = vlistptr->vars[varID].nlevs *
gridInqSize ( vlistptr->vars[varID].gridID );
for ( i = 0; i < decoSize; i++ )
{
rank = vlistptr->vars[varID].deco[i].rank;
offset = vlistptr->vars[varID].deco[i].offset;
chunk = vlistptr->vars[varID].deco[i].chunk;
fprintf ( fp, "%3d %8d %6d %6d %6d %8d %6d\n",
varID, size, iorank, decoSize, rank, offset, chunk );
}
}
fprintf(fp, "%3d %8d %6d\n", varID,
vlistptr->vars[varID].nlevs
* gridInqSize(vlistptr->vars[varID].gridID),
vlistptr->vars[varID].iorank);
}
}
......
......@@ -48,14 +48,6 @@ typedef struct
levinfo_t;
typedef struct
{
int rank;
int offset;
int chunk;
}
deco_t;
typedef struct
{
int ens_index;
......@@ -108,9 +100,6 @@ typedef struct
ensinfo_t *ensdata; /* Ensemble information */
cdi_atts_t atts;
int iorank;
int decoSize;
deco_t *deco;
#if defined (HAVE_LIBGRIB_API)
/* ---------------------------------- */
/* Local change: 2013-01-28, FP (DWD) */
......@@ -165,8 +154,6 @@ int vlistDelAtts(int vlistID, int varID);
int vlistCopyVarAtts(int vlistID1, int varID_1, int vlistID2, int varID_2);
void vlistUnpack(char * buffer, int bufferSize, int * pos, int, void *context);
void vlistDefVarDeco ( int vlistID, int varID, int decoSize,
deco_t * deco );
/* vlistDefVarValidrange: Define the valid range of a Variable */
void vlistDefVarValidrange(int vlistID, int varID, const double *validrange);
......
......@@ -3,10 +3,6 @@
#endif
#include <limits.h>
#ifdef USE_MPI
#include <mpi.h>
#include "pio_comm.h"
#endif
#include "dmemory.h"
#include "cdi.h"
......@@ -63,8 +59,6 @@ void vlistvarInitEntry(int vlistID, int varID)
vlistptr->vars[varID].validrange[1] = VALIDMISS;
vlistptr->vars[varID].ensdata = NULL;
vlistptr->vars[varID].iorank = CDI_UNDEFID;
vlistptr->vars[varID].decoSize = 0;
vlistptr->vars[varID].deco = NULL;
#if defined (HAVE_LIBGRIB_API)
/* ---------------------------------- */
......@@ -2026,101 +2020,6 @@ int vlistInqVarIntKey(int vlistID, int varID, const char* name)
}
void vlistDefVarDeco ( int vlistID, int varID, int decoSize, deco_t * deco )
{
vlist_t * vlistptr;
int i;
vlistptr = vlist_to_pointer(vlistID );
vlistCheckVarID ( __func__, vlistID, varID );
if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
{
xwarning("%s", "Operation not executed.");
return;
}
xassert ( decoSize && deco );
vlistptr->vars[varID].deco = xmalloc ( decoSize * sizeof ( deco_t ));
for ( i = 0; i < decoSize; i++ )
{
vlistptr->vars[varID].deco[i].rank = deco[i].rank;
vlistptr->vars[varID].deco[i].offset = deco[i].offset;
vlistptr->vars[varID].deco[i].chunk = deco[i].chunk;
}
vlistptr->vars[varID].decoSize = decoSize;
}
int vlistInqVarDecoChunk ( int vlistID, int varID, int rankModel )
{
int iret = CDI_UNDEFID;
vlistCheckVarID(__func__, vlistID, varID);
#ifdef USE_MPI
{
deco_t * deco;
int i, decoSize = 0;
vlist_t *vlistptr = vlist_to_pointer(vlistID);
xassert ( vlistptr->vars[varID].deco != NULL &&
vlistptr->vars[varID].decoSize != CDI_UNDEFID );
deco = vlistptr->vars[varID].deco;
decoSize = vlistptr->vars[varID].decoSize;
if ( decoSize && deco )
for ( i = 0; i < decoSize; i++ )
if ( deco[i].rank == rankModel )
{
iret = deco[i].chunk;
break;
}
}
#else
iret = vlistInqVarSize ( vlistID, varID );
#endif
xassert ( iret != CDI_UNDEFID );
return iret;
}
int vlistInqVarDecoOff ( int vlistID, int varID, int rankModel )
{
int iret = CDI_UNDEFID;
vlistCheckVarID(__func__, vlistID, varID);
#ifdef USE_MPI
{
deco_t * deco;
int i, decoSize = 0;
vlist_t *vlistptr = vlist_to_pointer(vlistID);
xassert ( vlistptr->vars[varID].deco != NULL &&
vlistptr->vars[varID].decoSize != CDI_UNDEFID );
deco = vlistptr->vars[varID].deco;
decoSize = vlistptr->vars[varID].decoSize;
if ( decoSize && deco )
for ( i = 0; i < decoSize; i++ )
if ( deco[i].rank == rankModel )
{
iret = deco[i].offset;
break;
}
}
#else
iret = 0;
#endif
xassert ( iret != CDI_UNDEFID );
return iret;
}
void vlistDefVarIOrank ( int vlistID, int varID, int iorank )
{
vlist_t * vlistptr;
......@@ -2152,7 +2051,7 @@ int vlistInqVarIOrank(int vlistID, int varID)
enum {
vlistvar_nints = 21,
vlistvar_nints = 20,
vlistvar_ndbls = 3,
};
......@@ -2170,8 +2069,6 @@ int vlistVarGetSize(vlist_t *p, int varID, void *context)
if (var->units)
varsize += serializeGetSize(strlen(var->units), DATATYPE_TXT, context);
varsize += serializeGetSize(4 * var->nlevs, DATATYPE_INT, context);
if ( var->deco != NULL )
varsize += serializeGetSize(3 * var->decoSize, DATATYPE_INT, context);
varsize += vlistAttsGetSize(p, varID, context);
return varsize;
}
......@@ -2203,7 +2100,6 @@ void vlistVarPack(vlist_t *p, int varID, char * buf, int size, int *position,
tempbuf[17] = var->complevel;
tempbuf[18] = var->nlevs;
tempbuf[19] = var->iorank;
tempbuf[20] = var->decoSize;
dtempbuf[0] = var->missval;
dtempbuf[1] = var->scalefactor;
dtempbuf[2] = var->addoffset;
......@@ -2234,18 +2130,6 @@ void vlistVarPack(vlist_t *p, int varID, char * buf, int size, int *position,
serializePack(levbuf, var->nlevs * 4, DATATYPE_INT,
buf, size, position, context);
}
if ( var->deco != NULL )
{
int deco[var->decoSize][3];
for (i = 0; i < var->decoSize; ++i)
{
deco[i][0] = var->deco[i].rank;
deco[i][1] = var->deco[i].offset;
deco[i][2] = var->deco[i].chunk;
}
serializePack(deco, var->decoSize * 3, DATATYPE_INT,
buf, size, position, context);
}
vlistAttsPack(p, varID, buf, size, position, context);
}
......@@ -2339,22 +2223,6 @@ void vlistVarUnpack(int vlistID, char * buf, int size, int *position,
}
vlistDefFlag(vlistID, newvar, flagSetLev, levbuf[flagSetLev][0]);
}
if ( tempbuf[20] != 0 )
{
int decoSize = tempbuf[20], i;
deco_t deco[decoSize];
int decobuf[decoSize][3];
serializeUnpack(buf, size, position,
decobuf, decoSize * 3, DATATYPE_INT, context);
for (i = 0; i < decoSize; ++i)
{
deco[i].rank = decobuf[i][0];
deco[i].offset = decobuf[i][1];
deco[i].chunk = decobuf[i][2];
}
vlistDefVarDeco(vlistID, newvar, decoSize, &deco[0]);
}
vlistDefVarIOrank(vlistID, newvar, tempbuf[19]);
vlistAttsUnpack(vlistID, newvar, buf, size, position, context);
}
......
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