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
97672586
Commit
97672586
authored
Aug 19, 2019
by
Philipp Samfass
Browse files
added optional header for teaMPI + communicator for communication within a team
parent
a099eeed
Changes
5
Hide whitespace changes
Inline
Side-by-side
lib/Makefile
View file @
97672586
...
@@ -2,8 +2,8 @@ CC=mpiicpc
...
@@ -2,8 +2,8 @@ CC=mpiicpc
CFLAGS
+=
-fPIC
-g
-Wall
-std
=
c++11
CFLAGS
+=
-fPIC
-g
-Wall
-std
=
c++11
LDFLAGS
+=
-shared
LDFLAGS
+=
-shared
SRC
=
Rank.cpp RankControl.cpp Timing.cpp Wrapper.cpp
SRC
=
Rank.cpp RankControl.cpp Timing.cpp Wrapper.cpp
teaMPI.cpp
DEP
=
Rank.h RankControl.h Timing.h Wrapper.h Logging.h
DEP
=
Rank.h RankControl.h Timing.h Wrapper.h Logging.h
teaMPI.h
OBJECTS
=
$(SRC:.cpp=.o)
OBJECTS
=
$(SRC:.cpp=.o)
TARGET
=
libtmpi.so
TARGET
=
libtmpi.so
...
...
lib/Rank.cpp
View file @
97672586
...
@@ -23,6 +23,7 @@ static int numTeams;
...
@@ -23,6 +23,7 @@ static int numTeams;
static
MPI_Comm
TMPI_COMM_TEAM
;
static
MPI_Comm
TMPI_COMM_TEAM
;
static
MPI_Comm
TMPI_COMM_DUP
;
static
MPI_Comm
TMPI_COMM_DUP
;
static
MPI_Comm
TMPI_COMM_INTER_TEAM
;
int
initialiseTMPI
()
{
int
initialiseTMPI
()
{
/**
/**
...
@@ -44,6 +45,9 @@ int initialiseTMPI() {
...
@@ -44,6 +45,9 @@ int initialiseTMPI() {
PMPI_Comm_size
(
TMPI_COMM_TEAM
,
&
teamSize
);
PMPI_Comm_size
(
TMPI_COMM_TEAM
,
&
teamSize
);
// Todo: free
PMPI_Comm_split
(
MPI_COMM_WORLD
,
teamRank
,
worldRank
,
&
TMPI_COMM_INTER_TEAM
);
assert
(
teamSize
==
(
worldSize
/
numTeams
));
assert
(
teamSize
==
(
worldSize
/
numTeams
));
registerSignalHandler
();
registerSignalHandler
();
...
@@ -92,6 +96,10 @@ MPI_Comm getTeamComm(MPI_Comm comm) {
...
@@ -92,6 +96,10 @@ MPI_Comm getTeamComm(MPI_Comm comm) {
return
(
comm
==
MPI_COMM_WORLD
)
?
TMPI_COMM_TEAM
:
comm
;
return
(
comm
==
MPI_COMM_WORLD
)
?
TMPI_COMM_TEAM
:
comm
;
}
}
MPI_Comm
getTeamInterComm
()
{
return
TMPI_COMM_INTER_TEAM
;
}
int
freeTeamComm
()
{
int
freeTeamComm
()
{
return
MPI_Comm_free
(
&
TMPI_COMM_TEAM
);
return
MPI_Comm_free
(
&
TMPI_COMM_TEAM
);
}
}
...
...
lib/Rank.h
View file @
97672586
...
@@ -53,6 +53,8 @@ int getTeam();
...
@@ -53,6 +53,8 @@ int getTeam();
MPI_Comm
getTeamComm
(
MPI_Comm
comm
);
MPI_Comm
getTeamComm
(
MPI_Comm
comm
);
int
freeTeamComm
();
int
freeTeamComm
();
MPI_Comm
getTeamInterComm
();
/* The duplicate MPI_COMM_WORLD used by the library*/
/* The duplicate MPI_COMM_WORLD used by the library*/
MPI_Comm
getLibComm
();
MPI_Comm
getLibComm
();
int
freeLibComm
();
int
freeLibComm
();
...
...
lib/teaMPI.cpp
0 → 100644
View file @
97672586
/**
* teaMPI.cpp
*
* Created on 19 Aug 2019
* Author: Philipp Samfass
*/
#include
"teaMPI.h"
#include
"Rank.h"
#include
<mpi.h>
int
TMPI_GetInterTeamCommSize
()
{
return
getNumberOfTeams
();
}
MPI_Comm
TMPI_GetInterTeamComm
()
{
return
getTeamInterComm
();
}
lib/teaMPI.h
0 → 100644
View file @
97672586
/**
* teaMPI.h
*
* Created on 19 Aug 2019
* Author: Philipp Samfass
*/
#include
<mpi.h>
MPI_Comm
TMPI_GetInterTeamComm
();
int
TMPI_GetInterTeamCommSize
();
Write
Preview
Supports
Markdown
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