Commit 89ae9455 authored by Philipp Samfaß's avatar Philipp Samfaß

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

parents 47747afd 7c9da831
......@@ -14,6 +14,12 @@ To use some example provided miniapps:
1. run `make` in the applications folder
2. run each application in the bin folder with the required command line parameters (documented in each application folder)
\section{Using \teaMPI together with SmartMPI}
Please make sure that you first link against teaMPI and then against smartMPI, i.e.
\begin{code}
-ltmpi -lsmartmpi
\end{code}
Otherwise, \teaMPI may not be initialized correctly, resulting in errors.
\section{Example Heartbeat Usage}
The following application models many scientific applications. Per loop, the two \texttt{MPI\_Sendrecv} calls act as heartbeats.
......
......@@ -55,7 +55,6 @@ void CommunicationStatistics::outputCommunicationStatistics() {
if (!filenamePrefix.empty()) {
// Write Generic Sync points to files
char sep = ',';
std::ostringstream filename;
std::string outputFolder(outputPathPrefix.empty() ? "tmpi-statistics" : outputPathPrefix);
filename << outputFolder << "/"
......
CC=mpicxx
CFLAGS += -fPIC -g -Wall -std=c++11
LDFLAGS += -shared
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
OBJECTS = $(SRC:.cpp=.o)
TARGET = libtmpi.so
.PHONY : clean
all: $(TARGET)
%.o: %.cpp $(DEP)
$(CC) $(CFLAGS) -c $< -o $@
$(TARGET) : $(OBJECTS)
$(CC) $(LDFLAGS) $^ -o $@
clean:
rm -f $(OBJECTS) $(TARGET)
......@@ -15,6 +15,10 @@
#include "Logging.h"
#include "Timing.h"
#ifdef USE_SMARTMPI
#include "mpi_offloading.h"
#endif
static int worldRank;
static int worldSize;
static int teamRank;
......@@ -40,6 +44,9 @@ int initialiseTMPI( MPI_Comm comm) {
PMPI_Comm_dup(comm, &TMPI_COMM_DUP);
PMPI_Comm_split(comm, color, worldRank, &TMPI_COMM_TEAM);
#ifdef USE_SMARTMPI
register_new_comm(TMPI_COMM_TEAM);
#endif
PMPI_Comm_rank(TMPI_COMM_TEAM, &teamRank);
......@@ -47,6 +54,9 @@ int initialiseTMPI( MPI_Comm comm) {
// Todo: free
PMPI_Comm_split(comm, teamRank, worldRank, &TMPI_COMM_INTER_TEAM);
#ifdef USE_SMARTMPI
register_new_comm(TMPI_COMM_INTER_TEAM);
#endif
assert(teamSize == (worldSize / numTeams));
......@@ -130,7 +140,7 @@ void outputEnvironment(){
PMPI_Barrier(TMPI_COMM_DUP);
double my_time = MPI_Wtime();
PMPI_Barrier(TMPI_COMM_DUP);
double times[worldSize];
double *times = new double[worldSize];
PMPI_Gather(&my_time, 1, MPI_DOUBLE, times, 1, MPI_DOUBLE, MASTER, TMPI_COMM_DUP);
......@@ -152,6 +162,7 @@ void outputEnvironment(){
std::cout << "---------------------------------------\n\n";
}
delete[] times;
PMPI_Barrier(TMPI_COMM_DUP);
}
......
......@@ -49,6 +49,9 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm) {
if(comm==MPI_COMM_WORLD)
#ifdef USE_SMARTMPI
PMPI_Comm_split(_comm, color, key, newcomm);
#ifdef USE_SMARTMPI
register_new_comm(*newcomm);
#endif
#else
PMPI_Comm_split(comm, color, key, newcomm);
#endif
......@@ -84,6 +87,9 @@ int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm) {
int err = PMPI_Comm_dup(getTeamComm(comm), newcomm);
logInfo("Created communicator " << *newcomm);
assert(err==MPI_SUCCESS);
#ifdef USE_SMARTMPI
register_new_comm(*newcomm);
#endif
return err;
}
......
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