Commit 53024a10 authored by Deike Kleberg's avatar Deike Kleberg
Browse files

Suspended xxxDefyyy calls of cdi resources after metadata send to I/O server.

parent db181be3
......@@ -178,6 +178,8 @@ void modelRun ()
#ifdef USE_MPI
pioMetadata ();
#endif
streamDefByteorder(streamID, 5);
zaxisDefLevels ( zaxisID1, levs );
// Loop over the number of time steps
for ( tsID = 0; tsID < ntsteps; tsID++ )
......
......@@ -557,6 +557,12 @@ void gridDefXname(int gridID, const char *xname)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -584,6 +590,12 @@ void gridDefXlongname(int gridID, const char *xlongname)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -611,6 +623,12 @@ void gridDefXunits(int gridID, const char *xunits)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -638,6 +656,12 @@ void gridDefYname(int gridID, const char *yname)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -665,6 +689,12 @@ void gridDefYlongname(int gridID, const char *ylongname)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -692,6 +722,12 @@ void gridDefYunits(int gridID, const char *yunits)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1018,6 +1054,12 @@ void gridDefTrunc(int gridID, int trunc)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1044,6 +1086,12 @@ void gridDefXsize(int gridID, int xsize)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1077,6 +1125,12 @@ void gridDefPrec(int gridID, int prec)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1153,6 +1207,12 @@ void gridDefYsize(int gridID, int ysize)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1214,6 +1274,12 @@ void gridDefRowlon(int gridID, int nrowlon, const int *rowlon)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1278,6 +1344,12 @@ void gridDefMask(int gridID, const int *mask)
long size, i;
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1337,6 +1409,12 @@ void gridDefMaskGME(int gridID, const int *mask)
long size, i;
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1421,6 +1499,12 @@ void gridDefXvals(int gridID, const double *xvals)
long size;
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1509,6 +1593,12 @@ void gridDefYvals(int gridID, const double *yvals)
long size;
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1699,6 +1789,12 @@ void gridDefXpole(int gridID, double xpole)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1747,6 +1843,12 @@ void gridDefYpole(int gridID, double ypole)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1795,6 +1897,12 @@ void gridDefAngle(int gridID, double angle)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1840,6 +1948,12 @@ void gridDefGMEnd(int gridID, int nd)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1884,6 +1998,12 @@ void gridDefGMEni(int gridID, int ni)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1928,6 +2048,12 @@ void gridDefGMEni2(int gridID, int ni2)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -1961,6 +2087,12 @@ void gridDefGMEni3(int gridID, int ni3)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -2701,6 +2833,12 @@ void gridDefArea(int gridID, const double *area)
long size;
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -2766,6 +2904,12 @@ void gridDefNvertex(int gridID, int nvertex)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -2806,6 +2950,12 @@ void gridDefXbounds(int gridID, const double *xbounds)
long nvertex;
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -2916,6 +3066,12 @@ void gridDefYbounds(int gridID, const double *ybounds)
long nvertex;
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -3380,6 +3536,12 @@ void gridDefLCC(int gridID, double originLon, double originLat, double lonParY,
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -3461,6 +3623,12 @@ void gridDefLcc2(int gridID, double earth_radius, double lon_0, double lat_0, do
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -3510,6 +3678,12 @@ void gridDefLaea(int gridID, double earth_radius, double lon_0, double lat_0)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -3556,6 +3730,12 @@ void gridDefComplexPacking(int gridID, int lcomplex)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -3595,6 +3775,12 @@ void gridDefNumber(int gridID, int number)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -3619,6 +3805,12 @@ void gridDefPosition(int gridID, int position)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......@@ -3652,6 +3844,12 @@ void gridDefReference(int gridID, const char *reference)
{
grid_t *gridptr;
if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
grid_check_ptr(gridID, gridptr);
......
......@@ -76,6 +76,24 @@ char * outTextComm ( MPI_Comm * );
}
#endif
#ifdef USE_MPI
#define xwarning(fmt, ...) \
if ( ddebug ){ \
int rank; \
MPI_Comm_rank ( MPI_COMM_WORLD, &rank ); \
fprintf ( stderr, "WARNING: pe%d in %s, %s, line %d: " fmt "\n", \
rank, __func__, __FILE__, __LINE__, \
## __VA_ARGS__ ); \
}
#else
#define xwarning(fmt, ...) \
if ( ddebug ){ \
fprintf ( stderr, "WARNING: %s, %s, line %d: " fmt "\n", \
__func__, __FILE__, __LINE__, \
## __VA_ARGS__ ); \
}
#endif
void pcdiAbort ( char *, const char *, const char *, int );
#define xabort(text) pcdiAbort ( text, __FILE__, __func__, __LINE__ );
......
......@@ -21,9 +21,13 @@
#include "extra.h"
#include "ieg.h"
#include "vlist.h"
#include "resource_handle.h"
#include "pio_util.h"
#define MAX_FNAMES 3
extern resOps streamOps;
FILE *popen(const char *command, const char *type);
int pclose(FILE *stream);
......@@ -398,6 +402,12 @@ void streamDefByteorder(int streamID, int byteorder)
stream_check_ptr(__func__, streamptr);
if ( reshGetStatus ( streamID, &streamOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
streamptr->byteorder = byteorder;
filetype = streamptr->filetype;
fileID = streamptr->fileID;
......@@ -1965,6 +1975,12 @@ void streamDefVlist(int streamID, int vlistID)
stream_check_ptr(__func__, streamptr);
if ( reshGetStatus ( streamID, &streamOps ) == CLOSED )
{
xdebug ("WARNING: Operation not executed." );
return;
}
if ( streamptr->vlistID == CDI_UNDEFID )
{
streamptr->vlistID = vlistDuplicate(vlistID);
......@@ -2037,6 +2053,12 @@ void streamDefZtype(int streamID, int ztype)
stream_check_ptr(__func__, streamptr);
if ( reshGetStatus ( streamID, &streamOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
streamptr->ztype = ztype;
}
......@@ -2049,6 +2071,12 @@ void streamDefZlevel(int streamID, int zlevel)
stream_check_ptr(__func__, streamptr);
if ( reshGetStatus ( streamID, &streamOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
streamptr->zlevel = zlevel;
}
......
......@@ -293,6 +293,12 @@ void taxisDefType(int taxisID, int type)
{
taxis_t *taxisptr;
if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
taxis_check_ptr(__func__, taxisptr);
......@@ -318,6 +324,12 @@ void taxisDefVdate(int taxisID, int vdate)
{
taxis_t *taxisptr;
if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
taxis_check_ptr(__func__, taxisptr);
......@@ -343,6 +355,12 @@ void taxisDefVtime(int taxisID, int vtime)
{
taxis_t *taxisptr;
if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
taxis_check_ptr(__func__, taxisptr);
......@@ -368,6 +386,12 @@ void taxisDefRdate(int taxisID, int rdate)
{
taxis_t *taxisptr;
if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
taxis_check_ptr(__func__, taxisptr);
......@@ -393,6 +417,12 @@ void taxisDefRtime(int taxisID, int rtime)
{
taxis_t *taxisptr;
if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
taxis_check_ptr(__func__, taxisptr);
......@@ -420,6 +450,12 @@ void taxisDefCalendar(int taxisID, int calendar)
{
taxis_t *taxisptr;
if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
taxis_check_ptr(__func__, taxisptr);
......@@ -432,6 +468,12 @@ void taxisDefTunit(int taxisID, int unit)
{
taxis_t *taxisptr;
if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
taxis_check_ptr(__func__, taxisptr);
......@@ -444,6 +486,12 @@ void taxisDefNumavg(int taxisID, int numavg)
{
taxis_t *taxisptr;
if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
taxis_check_ptr(__func__, taxisptr);
......@@ -484,6 +532,12 @@ void taxisDeleteBounds(int taxisID)
{
taxis_t *taxisptr;
if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
taxis_check_ptr(__func__, taxisptr);
......@@ -568,6 +622,12 @@ void taxisDefVdateBounds(int taxisID, int vdate_lb, int vdate_ub)
{
taxis_t *taxisptr;
if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
taxis_check_ptr(__func__, taxisptr);
......@@ -623,6 +683,12 @@ void taxisDefVtimeBounds(int taxisID, int vtime_lb, int vtime_ub)
{
taxis_t *taxisptr;
if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
{
xwarning ( "Operation not executed." );
return;
}
taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
taxis_check_ptr(__func__, taxisptr);
......