Commit 1d9caed9 authored by Philipp Samfass's avatar 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
SMARTMPI_LIB=../../mpi_offloading/build/smartmpi_lib
SMARTMPI_INC=../../mpi_offloading/smartmpi_lib
CC=mpicxx CC=mpicxx
CFLAGS += -fPIC -DCOMMUNICATION_MODE=0 -g -Wall -std=c++11 -I${HOME}/mpi_offloading/smartmpi_lib CFLAGS += -fPIC -g -Wall -std=c++11 -I${SMARTMPI_INC}
LDFLAGS += -shared -L${HOME}/mpi_offloading/smartmpi_lib -lsmartmpi LDFLAGS += -shared -L${SMARTMPI_LIB} -lsmartmpi
SRC = Rank.cpp RankControl.cpp Timing.cpp Wrapper.cpp teaMPI.cpp SRC = Rank.cpp RankControl.cpp Timing.cpp Wrapper.cpp teaMPI.cpp
DEP = Rank.h RankControl.h Timing.h Wrapper.h Logging.h teaMPI.h DEP = Rank.h RankControl.h Timing.h Wrapper.h Logging.h teaMPI.h
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
int MPI_Init(int *argc, char*** argv) { int MPI_Init(int *argc, char*** argv) {
int err = PMPI_Init(argc, argv); int err = PMPI_Init(argc, argv);
#ifdef USE_MPI_OFFLOADING #ifdef USE_MPI_OFFLOADING
ompi_init( (*argv)[0]); smpi_init( (*argv)[0]);
if(!_is_server) if(!_is_server)
initialiseTMPI(_comm); initialiseTMPI(_comm);
#else #else
...@@ -29,7 +29,7 @@ int MPI_Init(int *argc, char*** argv) { ...@@ -29,7 +29,7 @@ int MPI_Init(int *argc, char*** argv) {
int MPI_Init_thread( int *argc, char ***argv, int required, int *provided ) { int MPI_Init_thread( int *argc, char ***argv, int required, int *provided ) {
int err = PMPI_Init_thread(argc, argv, required, provided); int err = PMPI_Init_thread(argc, argv, required, provided);
#ifdef USE_MPI_OFFLOADING #ifdef USE_MPI_OFFLOADING
ompi_init( (*argv)[0]); smpi_init( (*argv)[0]);
if(!_is_server) if(!_is_server)
initialiseTMPI(_comm); initialiseTMPI(_comm);
#else #else
...@@ -232,10 +232,10 @@ int MPI_Iprobe_offload(int source, int tag, MPI_Comm comm, int *flag, MPI_Status ...@@ -232,10 +232,10 @@ int MPI_Iprobe_offload(int source, int tag, MPI_Comm comm, int *flag, MPI_Status
int ierr; int ierr;
assert(source==MPI_ANY_SOURCE); assert(source==MPI_ANY_SOURCE);
#if COMMUNICATION_MODE==0 #if COMMUNICATION_MODE==0
ierr = ompi_iprobe_offload_p2p(source, tag, comm, flag, status); ierr = smpi_iprobe_offload_p2p(source, tag, comm, flag, status);
#elif COMMUNICATION_MODE==1 #elif COMMUNICATION_MODE==1
//ierr = ompi_iprobe_offload_rma(source, tag, comm, flag, status); //ierr = smpi_iprobe_offload_rma(source, tag, comm, flag, status);
ierr = ompi_iprobe_offload_p2p(source, tag, comm, flag, status); ierr = smpi_iprobe_offload_p2p(source, tag, comm, flag, status);
#endif #endif
status->MPI_SOURCE = mapWorldToTeamRank(status->MPI_SOURCE); status->MPI_SOURCE = mapWorldToTeamRank(status->MPI_SOURCE);
return ierr; return ierr;
...@@ -244,19 +244,18 @@ int MPI_Iprobe_offload(int source, int tag, MPI_Comm comm, int *flag, MPI_Status ...@@ -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) { 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 #if COMMUNICATION_MODE==0
//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);
return ompi_send_offload_p2p(buf, count, datatype, translateRank(comm, dest, _comm), tag, comm, rail);
#elif COMMUNICATION_MODE==1 #elif COMMUNICATION_MODE==1
return ompi_send_offload_rma(buf, count, datatype, translateRank(comm, dest, _comm), tag, comm); return smpi_send_offload_rma(buf, count, datatype, translateRank(comm, dest, _comm), tag, comm);
#endif #endif
} }
int MPI_Recv_offload(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status_Offload *stat) { 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 #if COMMUNICATION_MODE==0
return ompi_recv_offload_p2p(buf, count, datatype, translateRank(comm, source, _comm), tag, comm, stat); return smpi_recv_offload_p2p(buf, count, datatype, translateRank(comm, source, _comm), tag, comm, stat);
#elif COMMUNICATION_MODE==1 #elif COMMUNICATION_MODE==1
return ompi_recv_offload_rma(buf, count, datatype, translateRank(comm, source, _comm), tag, comm, stat); //return smpi_recv_offload_rma(buf, count, datatype, translateRank(comm, source, _comm), tag, comm, stat);
//return ompi_recv_offload_p2p(buf, count, datatype, translateRank(comm, source, _comm), tag, comm, stat); return smpi_recv_offload_rma(buf, count, datatype, translateRank(comm, source, _comm), tag, comm, stat);
#endif #endif
} }
...@@ -334,7 +333,7 @@ int MPI_Finalize() { ...@@ -334,7 +333,7 @@ int MPI_Finalize() {
Timing::outputTiming(); Timing::outputTiming();
#ifdef USE_MPI_OFFLOADING #ifdef USE_MPI_OFFLOADING
} }
ompi_finalize(); smpi_finalize();
#endif #endif
return PMPI_Finalize(); return PMPI_Finalize();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment