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
6822922f
Commit
6822922f
authored
Jul 04, 2011
by
Deike Kleberg
Browse files
pioNamepaceInit/pioNamespaceCleanup
parent
489cefc4
Changes
6
Hide whitespace changes
Inline
Side-by-side
pioExamples/collectData.c
View file @
6822922f
...
...
@@ -71,7 +71,7 @@ void modelRun ()
double
levs
[
nlev
]
=
{
101300
,
92500
,
85000
,
50000
,
20000
};
double
var
[
nlon
*
nlat
*
nlev
];
n
amespaceInit
(
1
,
hasLocalFile
);
pioN
amespaceInit
(
1
,
hasLocalFile
);
gridID
=
gridCreate
(
GRID_LONLAT
,
nlon
*
nlat
);
gridDefXsize
(
gridID
,
nlon
);
...
...
@@ -129,7 +129,9 @@ void modelRun ()
vlistDestroy
(
vlistID
);
taxisDestroy
(
taxisID
);
zaxisDestroy
(
zaxisID
);
gridDestroy
(
gridID
);
gridDestroy
(
gridID
);
pioNamespaceCleanup
();
}
...
...
pioExamples/compareResourcesArray.c
View file @
6822922f
...
...
@@ -187,9 +187,9 @@ void modelRun ()
int
bufferSize
,
differ
;
MPI_Status
status
;
n
amespaceInit
(
2
,
hasLocalFile
);
pioN
amespaceInit
(
2
,
hasLocalFile
);
n
amespaceSetActive
(
0
);
pioN
amespaceSetActive
(
0
);
gridID
=
defineGrid
();
zaxisID
=
defineZaxis
();
...
...
@@ -207,7 +207,7 @@ void modelRun ()
xmpi
(
MPI_Recv
(
recvBuffer
,
bufferSize
,
MPI_PACKED
,
0
,
0
,
MPI_COMM_WORLD
,
&
status
));
n
amespaceSetActive
(
1
);
pioN
amespaceSetActive
(
1
);
rpcUnpackResources
(
recvBuffer
,
bufferSize
,
MPI_COMM_WORLD
);
free
(
recvBuffer
);
reshPackBufferDestroy
(
&
sendBuffer
);
...
...
@@ -216,8 +216,9 @@ void modelRun ()
printf
(
"The resource arrays %s.
\n
"
,
differ
?
"differ"
:
"are equal"
);
reshArrayPrint
(
"reshArrayModel"
);
n
amespaceSetActive
(
0
);
pioN
amespaceSetActive
(
0
);
streamClose
(
streamID
);
pioNamespaceCleanup
();
return
;
}
...
...
src/cdi.h
View file @
6822922f
...
...
@@ -211,8 +211,12 @@ int pioInit ( int, int, int );
void
pioFinalize
(
void
);
void
pioMetadata
(
int
,
int
*
);
void
namespaceInit
(
int
,
int
*
);
void
namespaceSetActive
(
int
);
void
namespaceInit
(
int
,
int
*
);
//to delete
void
namespaceSetActive
(
int
);
//to delete
void
pioNamespaceInit
(
int
,
int
*
);
void
pioNamespaceCleanup
(
void
);
void
pioNamespaceSetActive
(
int
);
void
gridGetIndexArray
(
int
,
int
*
);
void
streamGetIndexArray
(
int
,
int
*
);
...
...
src/namespace.c
View file @
6822922f
...
...
@@ -66,7 +66,7 @@ namespaceTuple_t namespaceResHDecode ( int resH )
return
tin
;
}
// to delete
void
namespaceInit
(
int
nspn
,
int
*
argHasLocalFile
)
{
int
i
;
...
...
@@ -82,7 +82,22 @@ void namespaceInit ( int nspn, int * argHasLocalFile )
}
void
namespaceCleanup
(
void
)
void
pioNamespaceInit
(
int
nspn
,
int
*
argHasLocalFile
)
{
int
i
;
assert
(
nspn
<=
NUM_NAMESPACES
&&
nspn
>=
1
);
nNamespaces
=
nspn
;
if
(
nspn
>=
1
)
{
hasLocalFile
=
xmalloc
(
nspn
*
sizeof
(
int
));
for
(
i
=
0
;
i
<
nspn
;
i
++
)
hasLocalFile
[
i
]
=
argHasLocalFile
[
i
];
}
}
void
pioNamespaceCleanup
(
void
)
{
if
(
nNamespaces
>
1
)
free
(
hasLocalFile
);
}
...
...
@@ -103,6 +118,12 @@ void namespaceSetActive ( int nId )
}
void
pioNamespaceSetActive
(
int
nId
)
{
namespaceSetActive
(
nId
);
}
int
namespaceGetActive
()
{
return
activeNamespace
;
...
...
src/namespace.h
View file @
6822922f
...
...
@@ -14,7 +14,6 @@ int namespaceIdxEncode ( namespaceTuple_t );
int
namespaceIdxEncode2
(
int
,
int
);
namespaceTuple_t
namespaceResHDecode
(
int
);
int
namespaceHasLocalFile
(
int
);
void
namespaceCleanup
(
void
);
int
namespaceAdaptKey
(
int
,
int
);
int
namespaceAdaptKey2
(
int
);
...
...
src/pio_interface.c
View file @
6822922f
...
...
@@ -87,7 +87,6 @@ MPI_Comm pioInit_c ( MPI_Comm comm, int nIOP, int mode )
{
IOServer
(
commModel
,
mode
);
commsIOCleanup
();
namespaceCleanup
();
MPI_Finalize
();
exit
(
0
);
}
...
...
@@ -437,8 +436,6 @@ void pioFinalize ()
MPI_Send
(
&
ibuffer
,
1
,
MPI_INT
,
nProcsCalc
,
FINALIZE
,
*
(
commsIO
+
i
));
commsIOCleanup
();
namespaceCleanup
();
#endif
}
...
...
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