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
1d9caed9
Commit
1d9caed9
authored
Jul 22, 2020
by
Philipp Samfass
Browse files
Merge branch 'mpi_offloading' of
https://gitlab.lrz.de/hpcsoftware/teaMPI
into mpi_offloading
Conflicts: lib/Makefile lib/Wrapper.cpp
parents
8798737f
14bcea1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/Makefile
View file @
1d9caed9
SMARTMPI_LIB
=
../../mpi_offloading/build/smartmpi_lib
SMARTMPI_INC
=
../../mpi_offloading/smartmpi_lib
CC
=
mpicxx
CFLAGS
+=
-fPIC
-
DCOMMUNICATION_MODE
=
0
-g
-Wall
-std
=
c++11
-I
${HOME}
/mpi_offloading/smartmpi_lib
LDFLAGS
+=
-shared
-L
${
HOME}
/mpi_offloading/smartmpi_lib
-lsmartmpi
CFLAGS
+=
-fPIC
-
g
-Wall
-std
=
c++11
-I
${SMARTMPI_INC}
LDFLAGS
+=
-shared
-L
${
SMARTMPI_LIB}
-lsmartmpi
SRC
=
Rank.cpp RankControl.cpp Timing.cpp Wrapper.cpp teaMPI.cpp
DEP
=
Rank.h RankControl.h Timing.h Wrapper.h Logging.h teaMPI.h
...
...
lib/Wrapper.cpp
View file @
1d9caed9
...
...
@@ -17,7 +17,7 @@
int
MPI_Init
(
int
*
argc
,
char
***
argv
)
{
int
err
=
PMPI_Init
(
argc
,
argv
);
#ifdef USE_MPI_OFFLOADING
o
mpi_init
(
(
*
argv
)[
0
]);
s
mpi_init
(
(
*
argv
)[
0
]);
if
(
!
_is_server
)
initialiseTMPI
(
_comm
);
#else
...
...
@@ -29,7 +29,7 @@ int MPI_Init(int *argc, char*** argv) {
int
MPI_Init_thread
(
int
*
argc
,
char
***
argv
,
int
required
,
int
*
provided
)
{
int
err
=
PMPI_Init_thread
(
argc
,
argv
,
required
,
provided
);
#ifdef USE_MPI_OFFLOADING
o
mpi_init
(
(
*
argv
)[
0
]);
s
mpi_init
(
(
*
argv
)[
0
]);
if
(
!
_is_server
)
initialiseTMPI
(
_comm
);
#else
...
...
@@ -232,10 +232,10 @@ int MPI_Iprobe_offload(int source, int tag, MPI_Comm comm, int *flag, MPI_Status
int
ierr
;
assert
(
source
==
MPI_ANY_SOURCE
);
#if COMMUNICATION_MODE==0
ierr
=
o
mpi_iprobe_offload_p2p
(
source
,
tag
,
comm
,
flag
,
status
);
ierr
=
s
mpi_iprobe_offload_p2p
(
source
,
tag
,
comm
,
flag
,
status
);
#elif COMMUNICATION_MODE==1
//ierr =
o
mpi_iprobe_offload_rma(source, tag, comm, flag, status);
ierr
=
o
mpi_iprobe_offload_p2p
(
source
,
tag
,
comm
,
flag
,
status
);
//ierr =
s
mpi_iprobe_offload_rma(source, tag, comm, flag, status);
ierr
=
s
mpi_iprobe_offload_p2p
(
source
,
tag
,
comm
,
flag
,
status
);
#endif
status
->
MPI_SOURCE
=
mapWorldToTeamRank
(
status
->
MPI_SOURCE
);
return
ierr
;
...
...
@@ -244,19 +244,18 @@ int MPI_Iprobe_offload(int source, int tag, MPI_Comm comm, int *flag, MPI_Status
int
MPI_Send_offload
(
const
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
int
dest
,
int
tag
,
MPI_Comm
comm
,
int
rail
)
{
#if COMMUNICATION_MODE==0
//return ompi_send_offload_p2p(buf, count, datatype, translateRank(comm, dest, _comm), tag, comm, rail);
return
ompi_send_offload_p2p
(
buf
,
count
,
datatype
,
translateRank
(
comm
,
dest
,
_comm
),
tag
,
comm
,
rail
);
return
smpi_send_offload_p2p
(
buf
,
count
,
datatype
,
translateRank
(
comm
,
dest
,
_comm
),
tag
,
comm
);
#elif COMMUNICATION_MODE==1
return
o
mpi_send_offload_rma
(
buf
,
count
,
datatype
,
translateRank
(
comm
,
dest
,
_comm
),
tag
,
comm
);
return
s
mpi_send_offload_rma
(
buf
,
count
,
datatype
,
translateRank
(
comm
,
dest
,
_comm
),
tag
,
comm
);
#endif
}
int
MPI_Recv_offload
(
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
int
source
,
int
tag
,
MPI_Comm
comm
,
MPI_Status_Offload
*
stat
)
{
#if COMMUNICATION_MODE==0
return
o
mpi_recv_offload_p2p
(
buf
,
count
,
datatype
,
translateRank
(
comm
,
source
,
_comm
),
tag
,
comm
,
stat
);
return
s
mpi_recv_offload_p2p
(
buf
,
count
,
datatype
,
translateRank
(
comm
,
source
,
_comm
),
tag
,
comm
,
stat
);
#elif COMMUNICATION_MODE==1
return
o
mpi_recv_offload_rma
(
buf
,
count
,
datatype
,
translateRank
(
comm
,
source
,
_comm
),
tag
,
comm
,
stat
);
//
return
o
mpi_recv_offload_
p2p
(buf, count, datatype, translateRank(comm, source, _comm), tag, comm, stat);
//
return
s
mpi_recv_offload_rma(buf, count, datatype, translateRank(comm, source, _comm), tag, comm, stat);
return
s
mpi_recv_offload_
rma
(
buf
,
count
,
datatype
,
translateRank
(
comm
,
source
,
_comm
),
tag
,
comm
,
stat
);
#endif
}
...
...
@@ -334,7 +333,7 @@ int MPI_Finalize() {
Timing
::
outputTiming
();
#ifdef USE_MPI_OFFLOADING
}
o
mpi_finalize
();
s
mpi_finalize
();
#endif
return
PMPI_Finalize
();
}
...
...
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