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
9c25cefb
Commit
9c25cefb
authored
9 years ago
by
Thomas Jahns
Browse files
Options
Downloads
Patches
Plain Diff
Enhance aligned block writing with direct short-cut.
parent
124fab99
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pio_mpi_fw_at_reblock.c
+22
-1
22 additions, 1 deletion
src/pio_mpi_fw_at_reblock.c
with
22 additions
and
1 deletion
src/pio_mpi_fw_at_reblock.c
+
22
−
1
View file @
9c25cefb
...
...
@@ -394,6 +394,10 @@ fwFileWriteAtReblock(int fileID, const void *buffer, size_t len)
int
numBlockBuf
=
of
->
numBlockBuf
;
int
numMsg
=
of
->
numMsg
;
const
unsigned
char
*
inBuf
=
buffer
;
const
unsigned
char
*
directWriteBuf
;
/* positive value iff direct write occurs */
int
directWriteSize
=
-
1
;
MPI_Offset
directWriteOfs
;
for
(
int
collRank
=
0
;
collRank
<
sizePio
;
++
collRank
)
if
(
of
->
collWriteSize
[
collRank
])
{
...
...
@@ -404,7 +408,19 @@ fwFileWriteAtReblock(int fileID, const void *buffer, size_t len)
int
inBlockPos
=
(
int
)(
fWOfs
%
(
MPI_Offset
)
blockSize
);
int
txLen
=
(
int
)
lmin
(
blockSize
-
inBlockPos
,
remaining
);
int
destRank
=
(
int
)(
fWOfs
/
(
MPI_Offset
)
blockSize
)
%
sizePio
;
if
(
destRank
==
rankPio
)
if
(
txLen
==
blockSize
)
{
/* a properly aligned portion can be written directly */
txLen
=
(
int
)(
remaining
-
remaining
%
blockSize
);
if
(
collRank
==
rankPio
)
{
directWriteBuf
=
inBuf
;
inBuf
+=
txLen
;
directWriteSize
=
txLen
;
directWriteOfs
=
fWOfs
;
}
}
else
if
(
destRank
==
rankPio
)
{
int
blockBufIdx
=
(
int
)(
fWOfs
/
collBlockSize
)
%
numBlockBuf
;
if
(
of
->
pending
[
blockBufIdx
].
pass
>=
0
...
...
@@ -466,6 +482,11 @@ fwFileWriteAtReblock(int fileID, const void *buffer, size_t len)
remaining
-=
txLen
;
}
while
(
remaining
);
}
if
(
directWriteSize
>
-
1
)
xmpi
(
MPI_File_write_at
(
of
->
fh
,
directWriteOfs
,
(
unsigned
char
*
)
directWriteBuf
,
directWriteSize
,
MPI_UNSIGNED_CHAR
,
MPI_STATUS_IGNORE
));
of
->
numMsg
=
numMsg
;
of
->
pos
=
fWOfs
;
return
len
;
...
...
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