Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
We have upgraded GitLab to 15.1. Due to major code changes GitLab was down for some time.
Open sidebar
Tobias Weinzierl
teaMPI
Commits
691ebd93
Commit
691ebd93
authored
Nov 11, 2019
by
Phillip Samfass
Browse files
more refactoring + complete any outstanding requests before termination
parent
b25f5f57
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/Timing.cpp
View file @
691ebd93
...
...
@@ -98,6 +98,17 @@ void Timing::progressOutstandingRequests(int targetTeam) {
}
}
void
Timing
::
pollForAndReceiveHeartbeat
(
int
targetTeam
)
{
int
received
=
0
;
PMPI_Iprobe
(
mapTeamToWorldRank
(
getTeamRank
(),
targetTeam
),
targetTeam
,
getLibComm
(),
&
received
,
MPI_STATUS_IGNORE
);
if
(
received
)
{
timer
.
heartbeatTimes
.
at
(
targetTeam
).
push_back
(
0.0
);
timer
.
heartbeatTimeRequests
.
at
(
targetTeam
).
push_back
(
MPI_Request
());
PMPI_Irecv
(
&
timer
.
heartbeatTimes
.
at
(
targetTeam
).
back
(),
1
,
MPI_DOUBLE
,
mapTeamToWorldRank
(
getTeamRank
(),
targetTeam
),
targetTeam
,
getLibComm
(),
&
timer
.
heartbeatTimeRequests
.
at
(
targetTeam
).
back
());
}
}
void
Timing
::
compareProgressWithReplicas
()
{
for
(
int
r
=
0
;
r
<
getNumberOfTeams
();
r
++
)
{
if
(
r
!=
getTeam
())
{
...
...
@@ -109,15 +120,7 @@ void Timing::compareProgressWithReplicas() {
// Receive deltas from other replicas
int
received
=
0
;
PMPI_Iprobe
(
mapTeamToWorldRank
(
getTeamRank
(),
r
),
r
,
getLibComm
(),
&
received
,
MPI_STATUS_IGNORE
);
if
(
received
)
{
timer
.
heartbeatTimes
.
at
(
r
).
push_back
(
0.0
);
timer
.
heartbeatTimeRequests
.
at
(
r
).
push_back
(
MPI_Request
());
PMPI_Irecv
(
&
timer
.
heartbeatTimes
.
at
(
r
).
back
(),
1
,
MPI_DOUBLE
,
mapTeamToWorldRank
(
getTeamRank
(),
r
),
r
,
getLibComm
(),
&
timer
.
heartbeatTimeRequests
.
at
(
r
).
back
());
}
pollForAndReceiveHeartbeat
(
r
);
progressOutstandingRequests
(
r
);
}
}
...
...
@@ -177,11 +180,13 @@ void Timing::outputTiming() {
//finish outstanding communication requests
bool
finished_all
=
false
;
while
(
!
finished_all
)
{
finished_all
=
true
;
for
(
int
r
=
0
;
r
<
getNumberOfTeams
();
r
++
)
{
finished_all
&=
timer
.
heartbeatTimeRequests
.
at
(
r
).
empty
();
}
if
(
!
finished_all
)
{
if
(
r
!=
getTeam
())
{
pollForAndReceiveHeartbeat
(
r
);
progressOutstandingRequests
(
r
);
finished_all
&=
timer
.
heartbeatTimeRequests
.
at
(
r
).
empty
();
}
}
}
...
...
lib/Timing.h
View file @
691ebd93
...
...
@@ -26,6 +26,8 @@ void compareProgressWithReplicas();
// Also compare a hash of a heartbeat buffer
void
compareBufferWithReplicas
(
const
void
*
sendbuf
,
int
sendcount
,
MPI_Datatype
sendtype
);
void
pollForAndReceiveHeartbeat
(
int
targetTeam
);
void
progressOutstandingRequests
(
int
targetTeam
);
void
sleepRankRaised
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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