Commit d999798b authored by Deike Kleberg's avatar Deike Kleberg
Browse files

interim 1

parent b36997dc
......@@ -105,9 +105,9 @@ int main (int argc, char *argv[])
enum {
nProcsIO = 3,
//IOMode = PIO_NONE,
//IOMode = PIO_MPI,
IOMode = PIO_MPI,
//IOMode = PIO_FPGUARD,
IOMode = PIO_ASYNCH,
//IOMode = PIO_ASYNCH,
//IOMode = PIO_WRITER,
nNamespaces = 1 };
......
......@@ -116,10 +116,10 @@ CONTAINS
CALL streamDefVlist(streamID, vlistID)
! For parallel IO:
! End SUBROUTINE MODELRUNpart for CDI resources:
! Map variables on IO server,
! End definition stage for CDI resources,
! balance load of variables among collecting IO server,
! Decompose data on model processes for IO
! Transmit resources to the IO server.
! Transfer resources to the collecting IO server.
CALL pioEndDef ();
! Loop over the number of time steps
......
......@@ -206,14 +206,14 @@ extern "C" {
/* parallel IO routines */
int pioInit ( int, int, int, int, int * );
void pioFinalize ( void );
void pioEndDef ( void );
void pioEndTimestepping ( void );
void pioWriteTimestep ( int, int, int );
void pioFinalize ( void );
int pioInit ( int, int, int, int, int * );
int pioInqVarDecoChunk ( int, int );
int pioInqVarDecoOff ( int, int );
void pioNamespaceSetActive ( int );
void pioWriteTimestep ( int, int, int );
/* CDI control routines */
......
......@@ -9,9 +9,9 @@
static int nNamespaces = 1;
static int activeNamespace = 0;
static int serialHLF = 1;
static int * hasLocalFile = &serialHLF;
static int serialRS = 0;
static int * resStatus = &serialRS;
static int * hasLocalFiles = &serialHLF;
static int serialRS = STAGE_DEFINITION;
static statusCode * resStatus = &serialRS;
enum {
intbits = sizeof(int) * CHAR_BIT,
......@@ -76,9 +76,9 @@ void namespaceInit ( int nspn, int * argHasLocalFile )
nNamespaces = nspn;
if ( nspn >= 1 )
{
hasLocalFile = xmalloc ( nspn * sizeof ( hasLocalFile[0] ));
hasLocalFiles = xmalloc ( nspn * sizeof ( hasLocalFiles[0] ));
for ( nspID = 0; nspID < nspn; nspID++ )
hasLocalFile[nspID] = argHasLocalFile[nspID];
hasLocalFiles[nspID] = argHasLocalFile[nspID];
resStatus = xmalloc ( nspn * sizeof ( resStatus[0] ));
}
#endif
......@@ -89,8 +89,8 @@ void namespaceCleanup ( void )
{
if ( nNamespaces > 1 )
{
free ( hasLocalFile );
hasLocalFile = NULL;
free ( hasLocalFiles );
hasLocalFiles = NULL;
free ( resStatus );
}
}
......@@ -104,10 +104,12 @@ int namespaceGetNumber ()
void pioNamespaceSetActive ( int nId )
{
#ifdef USE_MPI
if ( nId >= nNamespaces || nId < 0 )
abort ();
activeNamespace = nId;
#endif
}
......@@ -122,7 +124,7 @@ int namespaceHasLocalFile ( int nId )
if ( nId >= nNamespaces || nId < 0 )
abort ();
return hasLocalFile ? hasLocalFile[nId] : 0;
return hasLocalFiles ? hasLocalFiles[nId] : 0;
}
......
#ifndef NAMESPACE_H
#define NAMESPACE_H
typedef struct {
int idx;
int nsp;
int resStatus;
}namespaceTuple_t;
typedef enum {
STAGE_DEFINITION = 0,
STAGE_TIMELOOP = 1,
STAGE_CLEANUP = 2
} statusCode;
typedef struct {
int idx;
int nsp;
statusCode resStatus;
}namespaceTuple_t;
void namespaceCleanup ( void );
void namespaceInit ( int, int * );
void namespaceShowbits ( int, char * );
......
......@@ -15,7 +15,7 @@ static pioInfo_t * info = NULL;
static
void pioinfoInit ( pioInfo_t * p )
void pioInfoInit ( pioInfo_t * p )
{
p->IOMode = CDI_UNDEFID;
p->maxIOMode = CDI_UNDEFID;
......@@ -59,7 +59,7 @@ void commInit ( void )
{
xassert ( info == 0 );
info = xmalloc ( sizeof ( pioInfo_t ));
pioinfoInit ( info );
pioInfoInit ( info );
}
......
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