Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
66844e26
Commit
66844e26
authored
9 years ago
by
Thomas Jahns
Browse files
Options
Downloads
Patches
Plain Diff
Move serial netCDF library owner rank to table internal to pio_server.
parent
781cefd8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cdi_int.h
+0
-2
0 additions, 2 deletions
src/cdi_int.h
src/pio_server.c
+15
-6
15 additions, 6 deletions
src/pio_server.c
with
15 additions
and
8 deletions
src/cdi_int.h
+
0
−
2
View file @
66844e26
...
...
@@ -254,8 +254,6 @@ typedef struct {
#else
void
*
gribContainers
;
#endif
/* only used by MPI-parallelized version of library */
int
ownerRank
;
// MPI rank of owner process
void
*
gh
;
// grib handle
}
...
...
This diff is collapsed.
Click to expand it.
src/pio_server.c
+
15
−
6
View file @
66844e26
...
...
@@ -51,6 +51,9 @@ static struct
{
MPI_Win
getWin
;
struct
clientBuf
*
clientBuf
;
#if defined HAVE_LIBNETCDF && ! defined HAVE_PARALLEL_NC4
int
ownerRank
;
#endif
}
*
rxWin
;
static
struct
idList
openStreams
;
...
...
@@ -442,11 +445,13 @@ writeNetCDFStream(size_t streamIdx,
/* cdiOpenFileMap(fileID) gives the writer process */
static
int
cdiPioSerialOpenFileMap
(
int
streamID
)
{
return
stream_to_pointer
(
streamID
)
->
ownerRank
;
size_t
streamIdx
=
indexOfID
(
&
openStreams
,
streamID
);
xassert
(
streamIdx
<
SIZE_MAX
);
return
rxWin
[
streamIdx
].
ownerRank
;
}
/* for load-balancing purposes, count number of files per process */
/* cdiOpenFileCounts[rank] gives number of open files rank has to himself */
static
int
*
cdiSerialOpenFileCount
=
NULL
;
static
int
*
cdiSerialOpenFileCount
;
static
int
cdiPioNextOpenRank
()
...
...
@@ -807,14 +812,16 @@ cdiPioServerStreamOpen(const char *filename, char filemode,
int
recordBufIsToBeCreated
)
{
int
fileID
;
#if defined HAVE_LIBNETCDF && ! defined HAVE_PARALLEL_NC4
/* Only needs initialization to shut up gcc */
int
rank
=
-
1
;
#endif
switch
(
filetype
)
{
#if defined
(
HAVE_LIBNETCDF
)
&& ! defined
(
HAVE_PARALLEL_NC4
)
#if defined HAVE_LIBNETCDF && ! defined HAVE_PARALLEL_NC4
case
FILETYPE_NC4
:
case
FILETYPE_NC4C
:
{
/* Only needs initialization to shut up gcc */
int
rank
=
-
1
;
int
ioMode
=
commInqIOMode
();
if
(
ioMode
==
PIO_NONE
||
commInqRankColl
()
==
(
rank
=
cdiPioNextOpenRank
()))
...
...
@@ -825,7 +832,6 @@ cdiPioServerStreamOpen(const char *filename, char filemode,
streamptr
->
filetype
=
filetype
;
if
(
ioMode
!=
PIO_NONE
)
xmpi
(
MPI_Bcast
(
&
fileID
,
1
,
MPI_INT
,
rank
,
commInqCommColl
()));
streamptr
->
ownerRank
=
rank
;
cdiPioOpenFileOnRank
(
rank
);
}
break
;
...
...
@@ -851,6 +857,9 @@ cdiPioServerStreamOpen(const char *filename, char filemode,
for
(
size_t
i
=
oldNumStreams
;
i
<
numStreams
;
++
i
)
rxWin
[
i
].
clientBuf
=
newClientBufs
+
i
*
(
size_t
)
numClients_
;
rxWin
[
streamIdx
].
getWin
=
MPI_WIN_NULL
;
#if defined HAVE_LIBNETCDF && ! defined HAVE_PARALLEL_NC4
rxWin
[
streamIdx
].
ownerRank
=
rank
;
#endif
}
return
fileID
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment