Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
waLBerla
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arash Partow
waLBerla
Commits
297d26cf
Commit
297d26cf
authored
4 years ago
by
Nils Kohl
Browse files
Options
Downloads
Patches
Plain Diff
Some fixes in BufferSystemTest for unknown sender communication.
parent
51bdeacc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/core/mpi/BufferSystemTest.cpp
+26
-2
26 additions, 2 deletions
tests/core/mpi/BufferSystemTest.cpp
with
26 additions
and
2 deletions
tests/core/mpi/BufferSystemTest.cpp
+
26
−
2
View file @
297d26cf
...
@@ -307,6 +307,17 @@ void gatherUsingAsymmetricCommunication(const bool useIProbe)
...
@@ -307,6 +307,17 @@ void gatherUsingAsymmetricCommunication(const bool useIProbe)
void
unknownRanksAllToAll
()
void
unknownRanksAllToAll
()
{
{
// The unknown-sender communication is more vulnerable when
// tags of other MPI communication routines are equal since
// it processes messages with MPI_ANY_SOURCE
//
// Therefore this barrier makes sure that previous tests
// do not impose race-conditions.
//
// This is safer than specifying "unique" tags, since
// tags are never "unique" :)
WALBERLA_MPI_BARRIER
();
const
int
rank
=
MPIManager
::
instance
()
->
worldRank
();
const
int
rank
=
MPIManager
::
instance
()
->
worldRank
();
const
int
numProcesses
=
MPIManager
::
instance
()
->
numProcesses
();
const
int
numProcesses
=
MPIManager
::
instance
()
->
numProcesses
();
...
@@ -331,6 +342,7 @@ void unknownRanksAllToAll()
...
@@ -331,6 +342,7 @@ void unknownRanksAllToAll()
auto
numReceives
=
0
;
auto
numReceives
=
0
;
for
(
auto
it
=
bs
.
begin
();
it
!=
bs
.
end
();
++
it
)
for
(
auto
it
=
bs
.
begin
();
it
!=
bs
.
end
();
++
it
)
{
{
WALBERLA_LOG_INFO
(
"Sender rank: "
<<
it
.
rank
()
<<
", msg size: "
<<
it
.
buffer
().
size
()
);
WALBERLA_CHECK_EQUAL
(
it
.
buffer
().
size
(),
(
it
.
rank
()
+
1
)
*
4
);
WALBERLA_CHECK_EQUAL
(
it
.
buffer
().
size
(),
(
it
.
rank
()
+
1
)
*
4
);
for
(
int
i
=
0
;
i
<
it
.
rank
()
+
1
;
++
i
)
for
(
int
i
=
0
;
i
<
it
.
rank
()
+
1
;
++
i
)
{
{
...
@@ -344,6 +356,17 @@ void unknownRanksAllToAll()
...
@@ -344,6 +356,17 @@ void unknownRanksAllToAll()
}
}
void
unknownRanksAllToLower
()
void
unknownRanksAllToLower
()
{
{
// The unknown-sender communication is more vulnerable when
// tags of other MPI communication routines are equal since
// it processes messages with MPI_ANY_SOURCE
//
// Therefore this barrier makes sure that previous tests
// do not impose race-conditions.
//
// This is safer than specifying "unique" tags, since
// tags are never "unique" :)
WALBERLA_MPI_BARRIER
();
const
int
rank
=
MPIManager
::
instance
()
->
worldRank
();
const
int
rank
=
MPIManager
::
instance
()
->
worldRank
();
const
int
numProcesses
=
MPIManager
::
instance
()
->
numProcesses
();
const
int
numProcesses
=
MPIManager
::
instance
()
->
numProcesses
();
...
@@ -358,8 +381,8 @@ void unknownRanksAllToLower()
...
@@ -358,8 +381,8 @@ void unknownRanksAllToLower()
sb
<<
rank
;
sb
<<
rank
;
}
}
//we await numProcesses messages on every rank
//we await numProcesses
- rank
messages on every rank
bs
.
setReceiverInfo
(
numProcesses
);
bs
.
setReceiverInfo
(
numProcesses
-
rank
);
//equivalent to
//equivalent to
//std::set<mpi::MPIRank> recvs;
//std::set<mpi::MPIRank> recvs;
//for (auto targetRank = numProcesses - 1; targetRank >=rank; --targetRank)
//for (auto targetRank = numProcesses - 1; targetRank >=rank; --targetRank)
...
@@ -456,6 +479,7 @@ int main(int argc, char**argv)
...
@@ -456,6 +479,7 @@ int main(int argc, char**argv)
debug
::
enterTestMode
();
debug
::
enterTestMode
();
auto
mpiManager
=
MPIManager
::
instance
();
auto
mpiManager
=
MPIManager
::
instance
();
mpiManager
->
useWorldComm
();
int
numProcesses
=
mpiManager
->
numProcesses
();
int
numProcesses
=
mpiManager
->
numProcesses
();
if
(
numProcesses
<=
2
)
if
(
numProcesses
<=
2
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment