Commit ff398646 authored by Philipp Samfaß's avatar Philipp Samfaß

Merge branch 'mpi_offloading' of gitlab.lrz.de:hpcsoftware/teaMPI into mpi_offloading

parents 94076599 c50a8e4c
CC=mpiicpc
CFLAGS += -fPIC -g -Wall -std=c++11 -I${HOME}/mpi_offloading/offloading_lib
LDFLAGS += -shared -L${HOME}/mpi_offloading/offloading_lib -lmpioffloading
SMARTMPI_LIB=../../mpi_offloading/build/smartmpi_lib
SMARTMPI_INC=../../mpi_offloading/smartmpi_lib
CC=mpicxx
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 CommStats.cpp
DEP = Rank.h RankControl.h Timing.h Wrapper.h Logging.h teaMPI.h CommStats.h
......
......@@ -84,7 +84,7 @@ int mapWorldToTeamRank(int rank);
int mapTeamToWorldRank(int rank, int r);
int translateRank(int srcRank, MPI_Comm srcComm, MPI_Comm destComm);
int translateRank(MPI_Comm srcComm, int srcRank, MPI_Comm destComm);
int mapToWorldRank(int rank, MPI_Comm comm);
......
......@@ -18,7 +18,7 @@
int MPI_Init(int *argc, char*** argv) {
int err = PMPI_Init(argc, argv);
#ifdef USE_SMARTMPI
ompi_init( (*argv)[0]);
smpi_init( (*argv)[0]);
if(!_is_server)
initialiseTMPI(_comm);
#else
......@@ -30,7 +30,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_SMARTMPI
ompi_init( (*argv)[0]);
smpi_init( (*argv)[0]);
if(!_is_server)
initialiseTMPI(_comm);
#else
......@@ -245,27 +245,30 @@ 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 = ompi_iprobe_offload_p2p(source, tag, comm, flag, status);
ierr = smpi_iprobe_offload_p2p(source, tag, comm, flag, status);
#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 = smpi_iprobe_offload_p2p(source, tag, comm, flag, status);
#endif
status->MPI_SOURCE = mapWorldToTeamRank(status->MPI_SOURCE);
return ierr;
}
int MPI_Send_offload(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
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);
return smpi_send_offload_p2p(buf, count, datatype, translateRank(comm, dest, _comm), tag, comm, rail);
#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, rail);
#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 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
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 smpi_recv_offload_rma(buf, count, datatype, translateRank(comm, source, _comm), tag, comm, stat);
#endif
}
......
......@@ -4,7 +4,6 @@
#include <mpi.h>
//#define USE_MPI_OFFLOADING
/**
* Sets up the MPI library and initialises the process
......
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