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
a0d44c4a
Commit
a0d44c4a
authored
8 years ago
by
Thomas Jahns
Committed by
Sergey Kosukhin
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Rename type and use struct tag instead of typedef.
parent
308ec061
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!34
Version 2.2.0
,
!13
Consolidation with CDI-PIO (develop)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pio_mpi_fw_at_reblock.c
+15
-15
15 additions, 15 deletions
src/pio_mpi_fw_at_reblock.c
with
15 additions
and
15 deletions
src/pio_mpi_fw_at_reblock.c
+
15
−
15
View file @
a0d44c4a
...
...
@@ -50,7 +50,7 @@ struct pendingBufWrite
int
incoming
;
};
typedef
struct
struct
fileMPIFWAR
{
MPI_File
fh
;
int
fileID
;
...
...
@@ -71,20 +71,20 @@ typedef struct
MPI_Request
*
reqs
;
long
collWriteSize
[];
/* used to allgather sizes of writes
* on different processes */
}
aFiledataM
;
};
static
listSet
*
bibAFiledataM
;
static
int
fileIDTest
(
void
*
a
,
void
*
fileID
)
{
return
((
aFiledataM
*
)
a
)
->
fileID
==
(
int
)
(
intptr_t
)
fileID
;
return
((
struct
fileMPIFWAR
*
)
a
)
->
fileID
==
(
int
)
(
intptr_t
)
fileID
;
}
/***************************************************************/
static
inline
void
initReblockPendingMsg
(
aFiledataM
*
of
,
size_t
i
)
initReblockPendingMsg
(
struct
fileMPIFWAR
*
of
,
size_t
i
)
{
of
->
msgs
[
i
].
pos
=
-
1
;
of
->
msgs
[
i
].
len
=
-
1
;
...
...
@@ -132,7 +132,7 @@ getXferBufAlign(const char *path)
return
(
size_t
)
align
;
}
static
aFiledataM
*
static
struct
fileMPIFWAR
*
initAFiledataFileWriteAtReblock
(
const
char
*
filename
,
size_t
bufSize
)
{
MPI_Comm
commPio
=
commInqCommPio
();
...
...
@@ -181,7 +181,7 @@ initAFiledataFileWriteAtReblock(const char *filename, size_t bufSize)
numBlockBuf
=
2
;
bufSize
=
blockSize
*
2
;
}
aFiledataM
*
of
=
Malloc
(
sizeof
(
*
of
)
+
sizeof
(
of
->
collWriteSize
[
0
])
*
(
size_t
)
sizePio
+
nameSize
);
struct
fileMPIFWAR
*
of
=
Malloc
(
sizeof
(
*
of
)
+
sizeof
(
of
->
collWriteSize
[
0
])
*
(
size_t
)
sizePio
+
nameSize
);
of
->
fh
=
fh
;
of
->
name
=
(
char
*
)
((
unsigned
char
*
)
of
+
sizeof
(
*
of
)
+
sizeof
(
of
->
collWriteSize
[
0
])
*
(
size_t
)
sizePio
);
memcpy
(
of
->
name
,
filename
,
nameSize
);
...
...
@@ -216,12 +216,12 @@ initAFiledataFileWriteAtReblock(const char *filename, size_t bufSize)
/***************************************************************/
static
void
flushReblockBuffer
(
aFiledataM
*
of
,
int
blockBufIdx
);
static
void
flushReblockBuffer
(
struct
fileMPIFWAR
*
of
,
int
blockBufIdx
);
static
int
destroyAFiledataFileWriteAtReblock
(
void
*
v
)
{
aFiledataM
*
of
=
v
;
struct
fileMPIFWAR
*
of
=
v
;
size_t
numBlockBuf
=
(
size_t
)
of
->
numBlockBuf
;
/* flush pending buffers */
...
...
@@ -258,7 +258,7 @@ destroyAFiledataFileWriteAtReblock(void *v)
static
bool
compareNamesFileWriteAtReblock
(
void
*
v1
,
void
*
v2
)
{
aFiledataM
*
afm1
=
v1
,
*
afm2
=
v2
;
struct
fileMPIFWAR
*
afm1
=
v1
,
*
afm2
=
v2
;
return
!
strcmp
(
afm1
->
name
,
afm2
->
name
);
}
...
...
@@ -271,7 +271,7 @@ lmin(long a, long b)
}
static
void
flushReblockBuffer
(
aFiledataM
*
of
,
int
blockBufIdx
)
flushReblockBuffer
(
struct
fileMPIFWAR
*
of
,
int
blockBufIdx
)
{
int
blockSize
=
of
->
blockSize
;
unsigned
char
*
blockBuf
=
of
->
blockBuf
+
blockSize
*
blockBufIdx
;
...
...
@@ -306,7 +306,7 @@ flushReblockBuffer(aFiledataM *of, int blockBufIdx)
}
static
void
reblockMoreMsgs
(
aFiledataM
*
of
,
int
numMsg
)
reblockMoreMsgs
(
struct
fileMPIFWAR
*
of
,
int
numMsg
)
{
/* optimize with MPI_Testsome */
if
(
of
->
msgSize
==
numMsg
)
...
...
@@ -323,7 +323,7 @@ reblockMoreMsgs(aFiledataM *of, int numMsg)
static
size_t
fwFileWriteAtReblock
(
int
fileID
,
const
void
*
buffer
,
size_t
len
)
{
aFiledataM
*
of
=
listSetGet
(
bibAFiledataM
,
fileIDTest
,
(
void
*
)
(
intptr_t
)
fileID
);
struct
fileMPIFWAR
*
of
=
listSetGet
(
bibAFiledataM
,
fileIDTest
,
(
void
*
)
(
intptr_t
)
fileID
);
xassert
(
of
&&
len
<=
INT_MAX
);
MPI_Comm
commPio
=
commInqCommPio
();
int
sizePio
=
commInqSizePio
(),
rankPio
=
commInqRankPio
();
...
...
@@ -431,7 +431,7 @@ fwFileWriteAtReblock(int fileID, const void *buffer, size_t len)
static
int
fcFileWriteAtReblock
(
int
fileID
)
{
aFiledataM
*
of
=
listSetGet
(
bibAFiledataM
,
fileIDTest
,
(
void
*
)
(
intptr_t
)
fileID
);
struct
fileMPIFWAR
*
of
=
listSetGet
(
bibAFiledataM
,
fileIDTest
,
(
void
*
)
(
intptr_t
)
fileID
);
if
(
!
of
)
xabort
(
"listSet, fileID=%d not found"
,
fileID
);
int
iret
=
listSetRemove
(
bibAFiledataM
,
fileIDTest
,
(
void
*
)
(
intptr_t
)
fileID
);
return
iret
;
...
...
@@ -441,7 +441,7 @@ fcFileWriteAtReblock(int fileID)
static
void
elemCheck
(
void
*
q
,
void
*
nm
)
{
aFiledataM
*
afm
=
q
;
struct
fileMPIFWAR
*
afm
=
q
;
const
char
*
name
=
nm
;
if
(
!
strcmp
(
name
,
afm
->
name
))
xabort
(
"Filename %s has already been added to set
\n
"
,
name
);
...
...
@@ -456,7 +456,7 @@ fowFileWriteAtReblock(const char *filename, const char *mode)
struct
cdiPioConf
*
conf
=
cdiPioGetConf
();
listSetForeach
(
bibAFiledataM
,
elemCheck
,
(
void
*
)
filename
);
aFiledataM
*
of
=
initAFiledataFileWriteAtReblock
(
filename
,
conf
->
writeAggBufLim
);
struct
fileMPIFWAR
*
of
=
initAFiledataFileWriteAtReblock
(
filename
,
conf
->
writeAggBufLim
);
int
id
;
if
((
of
->
fileID
=
id
=
listSetAdd
(
bibAFiledataM
,
of
))
<
0
)
xabort
(
"filename %s not unique"
,
of
->
name
);
...
...
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