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
4dcc8808
Commit
4dcc8808
authored
Nov 19, 2013
by
Thomas Jahns
🤸
Browse files
Rename pioNamespaceSetActive and make part of core interface.
* Also include namespaceNew and namespaceDelete in cdi.h.
parent
998e24ae
Changes
16
Hide whitespace changes
Inline
Side-by-side
examples/pio/collectData.c
View file @
4dcc8808
...
...
@@ -225,7 +225,7 @@ int main (int argc, char *argv[])
cdiPioNoPostCommSetup
);
if
(
commModel
!=
MPI_COMM_NULL
)
{
pioN
amespaceSetActive
(
pioNamespace
);
n
amespaceSetActive
(
pioNamespace
);
#endif
modelRun
(
commModel
);
...
...
examples/pio/collectData2003.F90
View file @
4dcc8808
...
...
@@ -43,7 +43,7 @@ PROGRAM collectdata2003
commModel
=
pioInit
(
commGlob
,
nProcsIO
,
IOMode
,
pio_namespace
,
1.1
,
&
cdiPioNoPostCommSetup
)
run_model
=
commModel
/
=
MPI_COMM_NULL
IF
(
run_model
)
CALL
pioN
amespaceSetActive
(
pio_namespace
)
IF
(
run_model
)
CALL
n
amespaceSetActive
(
pio_namespace
)
#endif
IF
(
run_model
)
CALL
modelrun
(
commModel
)
...
...
examples/pio/collectDataNStreams.c
View file @
4dcc8808
...
...
@@ -267,7 +267,7 @@ int main (int argc, char *argv[])
cdiPioNoPostCommSetup
);
if
(
commModel
!=
MPI_COMM_NULL
)
{
pioN
amespaceSetActive
(
pioNamespace
);
n
amespaceSetActive
(
pioNamespace
);
#endif
modelRun
(
commModel
);
...
...
examples/pio/compareResourcesArray.c
View file @
4dcc8808
...
...
@@ -192,7 +192,7 @@ static void modelRun ( MPI_Comm comm )
int
bufferSize
,
differ
;
MPI_Status
status
;
pioN
amespaceSetActive
(
0
);
n
amespaceSetActive
(
0
);
gridID
=
defineGrid
();
zaxisID
=
defineZaxis
();
...
...
@@ -210,7 +210,7 @@ static void modelRun ( MPI_Comm comm )
xmpi
(
MPI_Recv
(
recvBuffer
,
bufferSize
,
MPI_PACKED
,
0
,
0
,
comm
,
&
status
));
pioN
amespaceSetActive
(
1
);
n
amespaceSetActive
(
1
);
reshUnpackResources
(
recvBuffer
,
bufferSize
,
&
comm
);
free
(
recvBuffer
);
reshPackBufferDestroy
(
&
sendBuffer
);
...
...
@@ -219,7 +219,7 @@ static void modelRun ( MPI_Comm comm )
printf
(
"The resource arrays %s.
\n
"
,
differ
?
"differ"
:
"are equal"
);
printResources
();
pioN
amespaceSetActive
(
0
);
n
amespaceSetActive
(
0
);
streamClose
(
streamID
);
return
;
}
...
...
@@ -246,7 +246,7 @@ int main (int argc, char *argv[])
commModel
=
pioInit
(
commGlob
,
nProcsIO
,
IOMode
,
&
pioNamespace
,
1
.
0
f
,
cdiPioNoPostCommSetup
);
pioN
amespaceSetActive
(
pioNamespace
);
n
amespaceSetActive
(
pioNamespace
);
modelRun
(
commModel
);
...
...
src/cdi.h
View file @
4dcc8808
...
...
@@ -232,6 +232,11 @@ void cdiDefMissval(double missval);
double
cdiInqMissval
(
void
);
void
cdiDefGlobal
(
const
char
*
string
,
int
val
);
int
namespaceNew
();
void
namespaceSetActive
(
int
namespaceID
);
void
namespaceDelete
(
int
namespaceID
);
/* CDI converter routines */
/* parameter */
...
...
src/cdi.inc
View file @
4dcc8808
...
...
@@ -399,6 +399,17 @@
!
INTEGER
val
)
EXTERNAL
cdiDefGlobal
INTEGER
namespaceNew
EXTERNAL
namespaceNew
!
namespaceSetActive
!
(
INTEGER
namespaceID
)
EXTERNAL
namespaceSetActive
!
namespaceDelete
!
(
INTEGER
namespaceID
)
EXTERNAL
namespaceDelete
!
!
CDI
converter
routines
!
...
...
src/cdiFortran.c
View file @
4dcc8808
...
...
@@ -72,6 +72,9 @@ FCALLSCFUN1 (INT, cdiHaveFiletype, CDIHAVEFILETYPE, cdihavefiletype, INT)
FCALLSCSUB1
(
cdiDefMissval
,
CDIDEFMISSVAL
,
cdidefmissval
,
DOUBLE
)
FCALLSCFUN0
(
DOUBLE
,
cdiInqMissval
,
CDIINQMISSVAL
,
cdiinqmissval
)
FCALLSCSUB2
(
cdiDefGlobal
,
CDIDEFGLOBAL
,
cdidefglobal
,
STRING
,
INT
)
FCALLSCFUN0
(
INT
,
namespaceNew
,
NAMESPACENEW
,
namespacenew
)
FCALLSCSUB1
(
namespaceSetActive
,
NAMESPACESETACTIVE
,
namespacesetactive
,
INT
)
FCALLSCSUB1
(
namespaceDelete
,
NAMESPACEDELETE
,
namespacedelete
,
INT
)
/* CDI converter routines */
...
...
src/cdipio.h
View file @
4dcc8808
...
...
@@ -42,6 +42,4 @@ void streamWriteVarPart (int streamID, int varID,
const
void
*
data
,
int
nmiss
,
Xt_idxlist
partDesc
);
void
pioNamespaceSetActive
(
int
);
#endif
src/cdipio.inc
View file @
4dcc8808
!
This
file
was
automatically
generated
,
don
'
t
edit
!
!
!
Fortran
interface
for
CDI
library
version
1.6.
1.1
!
Fortran
interface
for
CDI
library
version
1.6.
2
!
!
Author
:
!
-------
...
...
@@ -58,7 +58,3 @@
!
TYPE
(
XT_IDXLIST
)
partDesc
)
EXTERNAL
streamWriteVarPart
!
pioNamespaceSetActive
!
(
INTEGER
)
EXTERNAL
pioNamespaceSetActive
src/cdipioFortran.c
View file @
4dcc8808
...
...
@@ -45,6 +45,5 @@ static void streamWriteVarPart_fwrap(int streamID, int varID, const void *data,
streamWriteVarPart
(
streamID
,
varID
,
data
,
nmiss
,
(
*
(
Xt_idxlist
*
)
partDesc
));
}
FCALLSCSUB5
(
streamWriteVarPart_fwrap
,
STREAMWRITEVARPART
,
streamwritevarpart
,
INT
,
INT
,
PVOID
,
INT
,
PVOID
)
FCALLSCSUB1
(
pioNamespaceSetActive
,
PIONAMESPACESETACTIVE
,
pionamespacesetactive
,
INT
)
#endif
src/namespace.c
View file @
4dcc8808
...
...
@@ -190,7 +190,7 @@ int namespaceGetNumber ()
}
void
pioN
amespaceSetActive
(
int
nId
)
void
n
amespaceSetActive
(
int
nId
)
{
xassert
(
nId
<
namespacesSize
&&
nId
>=
0
&&
namespaces
[
nId
].
resStage
!=
STAGE_UNUSED
);
...
...
src/namespace.h
View file @
4dcc8808
...
...
@@ -59,7 +59,7 @@ int namespaceNew();
void
namespaceDelete
(
int
namespaceID
);
void
namespaceCleanup
(
void
);
int
namespaceGetNumber
(
void
);
void
pioN
amespaceSetActive
(
int
namespaceID
);
void
n
amespaceSetActive
(
int
namespaceID
);
int
namespaceGetActive
(
void
);
int
namespaceIdxEncode
(
namespaceTuple_t
);
int
namespaceIdxEncode2
(
int
,
int
);
...
...
src/pio_client.c
View file @
4dcc8808
...
...
@@ -222,7 +222,7 @@ cdiPioClientSetup(int *pioNamespace_, int *pioNamespace)
commDefCommsIO
();
*
pioNamespace_
=
*
pioNamespace
=
namespaceNew
();
int
callerCDINamespace
=
namespaceGetActive
();
pioN
amespaceSetActive
(
*
pioNamespace_
);
n
amespaceSetActive
(
*
pioNamespace_
);
serializeSetMPI
();
namespaceSwitchSet
(
NSSWITCH_STREAM_OPEN_BACKEND
,
NSSW_FUNC
(
cdiPioClientStreamOpen
));
...
...
@@ -246,7 +246,7 @@ cdiPioClientSetup(int *pioNamespace_, int *pioNamespace)
namespaceSwitchSet
(
NSSWITCH_CDF_STREAM_SETUP
,
NSSW_FUNC
(
cdiPioClientStreamNOP
));
#endif
pioN
amespaceSetActive
(
callerCDINamespace
);
n
amespaceSetActive
(
callerCDINamespace
);
}
...
...
src/resource_handle.c
View file @
4dcc8808
...
...
@@ -124,7 +124,7 @@ reshListDestruct(int namespaceID)
LIST_LOCK
();
xassert
(
resHList
&&
namespaceID
>=
0
&&
namespaceID
<
resHListSize
);
int
callerNamespaceID
=
namespaceGetActive
();
pioN
amespaceSetActive
(
namespaceID
);
n
amespaceSetActive
(
namespaceID
);
if
(
resHList
[
namespaceID
].
resources
)
{
for
(
int
j
=
0
;
j
<
resHList
[
namespaceID
].
size
;
j
++
)
...
...
@@ -137,7 +137,7 @@ reshListDestruct(int namespaceID)
reshListClearEntry
(
namespaceID
);
}
if
(
resHList
[
callerNamespaceID
].
resources
)
pioN
amespaceSetActive
(
callerNamespaceID
);
n
amespaceSetActive
(
callerNamespaceID
);
LIST_UNLOCK
();
}
...
...
@@ -656,7 +656,7 @@ void reshListPrint(FILE *fp)
for
(
i
=
0
;
i
<
namespaceGetNumber
();
i
++
)
{
pioN
amespaceSetActive
(
i
);
n
amespaceSetActive
(
i
);
fprintf
(
fp
,
"
\n
"
);
fprintf
(
fp
,
"##################################
\n
"
);
...
...
@@ -680,7 +680,7 @@ void reshListPrint(FILE *fp)
fprintf
(
fp
,
"#
\n
# end global resource list"
\
"
\n
#
\n
##########################################
\n\n
"
);
pioN
amespaceSetActive
(
temp
);
n
amespaceSetActive
(
temp
);
}
...
...
tests/pio_write.c
View file @
4dcc8808
...
...
@@ -216,7 +216,7 @@ int main (int argc, char *argv[])
cdiPioNoPostCommSetup
);
if
(
commModel
!=
MPI_COMM_NULL
)
{
pioN
amespaceSetActive
(
pioNamespace
);
n
amespaceSetActive
(
pioNamespace
);
#else
commModel
=
-
1
;
#endif
...
...
tests/test_resource_copy.c
View file @
4dcc8808
...
...
@@ -182,7 +182,7 @@ int modelRun ( MPI_Comm comm )
char
*
recvBuffer
,
*
sendBuffer
;
int
bufferSize
,
differ
;
pioN
amespaceSetActive
(
0
);
n
amespaceSetActive
(
0
);
if
(
IOMode
!=
PIO_NONE
)
serializeSetMPI
();
...
...
@@ -201,14 +201,14 @@ int modelRun ( MPI_Comm comm )
xmpi
(
MPI_Sendrecv
(
sendBuffer
,
bufferSize
,
MPI_PACKED
,
0
,
0
,
recvBuffer
,
bufferSize
,
MPI_PACKED
,
0
,
0
,
MPI_COMM_SELF
,
MPI_STATUS_IGNORE
));
pioN
amespaceSetActive
(
1
);
n
amespaceSetActive
(
1
);
reshUnpackResources
(
recvBuffer
,
bufferSize
,
&
comm
);
free
(
recvBuffer
);
reshPackBufferDestroy
(
&
sendBuffer
);
differ
=
reshListCompare
(
0
,
1
);
pioN
amespaceSetActive
(
0
);
n
amespaceSetActive
(
0
);
streamClose
(
streamID
);
return
differ
;
}
...
...
@@ -235,7 +235,7 @@ int main (int argc, char *argv[])
commModel
=
pioInit
(
commGlob
,
nProcsIO
,
IOMode
,
&
pioNamespace
,
1
.
0
f
,
cdiPioNoPostCommSetup
);
pioN
amespaceSetActive
(
pioNamespace
);
n
amespaceSetActive
(
pioNamespace
);
exitCode
=
modelRun
(
commModel
);
...
...
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