Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FIJI
EmbryoGen
Commits
82fd9d5c
Commit
82fd9d5c
authored
Apr 09, 2021
by
Vladimír Ulman
Browse files
ADD2/2: simple MPI-native calls
parent
f3482508
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Scenarios/Scenario_mpiDebug.cpp
View file @
82fd9d5c
#include
"common/Scenarios.h"
#ifdef DISTRIBUTED
#include
<mpi.h>
#endif
SceneControls
&
Scenario_mpiDebug
::
provideSceneControls
()
{
...
...
@@ -36,9 +39,20 @@ void Scenario_mpiDebug::initializeScene()
void
Scenario_mpiDebug
::
initializeAgents
(
FrontOfficer
*
,
int
p
,
int
P
)
{
DEBUG_REPORT
(
"
rank
="
<<
p
<<
"/"
<<
P
);
DEBUG_REPORT
(
"
FOs slice
="
<<
p
<<
"/"
<<
P
);
#ifdef DISTRIBUTED
//code that gets compiled only in MPI (DISTRIBUTED) version
int
len
;
int
rank
,
size
;
char
node
[
MPI_MAX_PROCESSOR_NAME
];
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
size
);
MPI_Get_processor_name
(
node
,
&
len
);
REPORT
(
"Hello world! from MPI true rank "
<<
rank
<<
" of "
<<
size
<<
" on host "
<<
node
);
#endif
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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