Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
d999798b
Commit
d999798b
authored
Nov 03, 2011
by
Deike Kleberg
Browse files
interim 1
parent
b36997dc
Changes
6
Hide whitespace changes
Inline
Side-by-side
pioExamples/collectData.c
View file @
d999798b
...
...
@@ -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
};
...
...
pioExamples/collectData2003.F90
View file @
d999798b
...
...
@@ -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
! Trans
mit
resources to the IO server.
! Trans
fer
resources to the
collecting
IO server.
CALL
pioEndDef
();
! Loop over the number of time steps
...
...
src/cdi.h
View file @
d999798b
...
...
@@ -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 */
...
...
src/namespace.c
View file @
d999798b
...
...
@@ -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
*
hasLocalFile
s
=
&
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
]
));
hasLocalFile
s
=
xmalloc
(
nspn
*
sizeof
(
hasLocalFile
s
[
0
]
));
for
(
nspID
=
0
;
nspID
<
nspn
;
nspID
++
)
hasLocalFile
[
nspID
]
=
argHasLocalFile
[
nspID
];
hasLocalFile
s
[
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
(
hasLocalFile
s
);
hasLocalFile
s
=
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
hasLocalFile
s
?
hasLocalFile
s
[
nId
]
:
0
;
}
...
...
src/namespace.h
View file @
d999798b
#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
*
);
...
...
src/pio_comm.c
View file @
d999798b
...
...
@@ -15,7 +15,7 @@ static pioInfo_t * info = NULL;
static
void
pio
i
nfoInit
(
pioInfo_t
*
p
)
void
pio
I
nfoInit
(
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
));
pio
i
nfoInit
(
info
);
pio
I
nfoInit
(
info
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment