Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Weinzierl
teaMPI
Commits
7b418034
Commit
7b418034
authored
Nov 28, 2019
by
Philipp Samfaß
Browse files
fix blocking mode for offloading
parent
9d1f65dd
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/Wrapper.cpp
View file @
7b418034
...
...
@@ -86,7 +86,18 @@ int MPI_Comm_free(MPI_Comm *comm) {
int
MPI_Send
(
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
int
dest
,
int
tag
,
MPI_Comm
comm
)
{
//assert(comm == MPI_COMM_WORLD);
int
err
=
PMPI_Send
(
buf
,
count
,
datatype
,
dest
,
tag
,
getTeamComm
(
comm
));
int
err
;
#ifdef USE_MPI_OFFLOADING
if
(
_is_server
)
{
MPI_Comm
mapped_comm
=
(
comm
==
MPI_COMM_WORLD
)
?
_comm
:
comm
;
err
=
PMPI_Send
(
buf
,
count
,
datatype
,
dest
,
tag
,
mapped_comm
);
}
else
{
err
=
PMPI_Send
(
buf
,
count
,
datatype
,
dest
,
tag
,
getTeamComm
(
comm
));
}
#else
err
=
PMPI_Send
(
buf
,
count
,
datatype
,
dest
,
tag
,
getTeamComm
(
comm
));
#endif
logInfo
(
"Send to rank "
<<
dest
<<
"/"
<<
mapTeamToWorldRank
(
dest
)
<<
" with tag "
<<
tag
);
return
err
;
}
...
...
@@ -94,7 +105,18 @@ int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest,
int
MPI_Recv
(
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
int
source
,
int
tag
,
MPI_Comm
comm
,
MPI_Status
*
status
)
{
//assert(comm == MPI_COMM_WORLD);
int
err
=
PMPI_Recv
(
buf
,
count
,
datatype
,
source
,
tag
,
getTeamComm
(
comm
),
status
);
int
err
;
#ifdef USE_MPI_OFFLOADING
if
(
_is_server
)
{
MPI_Comm
mapped_comm
=
(
comm
==
MPI_COMM_WORLD
)
?
_comm
:
comm
;
err
=
PMPI_Recv
(
buf
,
count
,
datatype
,
source
,
tag
,
mapped_comm
,
status
);
}
else
{
err
=
PMPI_Recv
(
buf
,
count
,
datatype
,
source
,
tag
,
getTeamComm
(
comm
),
status
);
}
#else
err
=
PMPI_Recv
(
buf
,
count
,
datatype
,
source
,
tag
,
getTeamComm
(
comm
),
status
);
#endif
logInfo
(
"Receive from rank "
<<
source
<<
"/"
<<
mapTeamToWorldRank
(
source
)
<<
" with tag "
<<
tag
);
return
err
;
}
...
...
@@ -164,7 +186,20 @@ int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status) {
int
MPI_Iprobe
(
int
source
,
int
tag
,
MPI_Comm
comm
,
int
*
flag
,
MPI_Status
*
status
)
{
//assert(comm == MPI_COMM_WORLD);
int
err
=
PMPI_Iprobe
(
source
,
tag
,
getTeamComm
(
comm
),
flag
,
status
);
int
err
;
#ifdef USE_MPI_OFFLOADING
if
(
_is_server
)
{
if
(
comm
==
MPI_COMM_WORLD
)
err
=
PMPI_Iprobe
(
source
,
tag
,
_comm
,
flag
,
status
);
else
err
=
PMPI_Iprobe
(
source
,
tag
,
comm
,
flag
,
status
);
}
else
{
err
=
PMPI_Iprobe
(
source
,
tag
,
getTeamComm
(
comm
),
flag
,
status
);
}
#else
err
=
PMPI_Iprobe
(
source
,
tag
,
getTeamComm
(
comm
),
flag
,
status
);
#endif
logInfo
(
"Iprobe finished (FLAG="
<<
*
flag
<<
",SOURCE="
<<
mapTeamToWorldRank
(
source
)
<<
",TAG="
<<
tag
<<
",STATUS_SOURCE="
<<
status
->
MPI_SOURCE
<<
",STATUS_TAG="
<<
status
->
MPI_TAG
<<
")"
);
return
err
;
}
...
...
Write
Preview
Markdown
is supported
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