Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ag-ohlberger
dune-community
dune-xt
Commits
65ee6df5
Commit
65ee6df5
authored
6 years ago
by
René Fritze
Committed by
dune-community-bulldozer[bot]
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[test] for mpi_comm_wrapper
parent
82bafd41
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/xt/common/test/parallel/mpi_comm_wrapper.cc
+36
-0
36 additions, 0 deletions
dune/xt/common/test/parallel/mpi_comm_wrapper.cc
python/test/base.py
+3
-15
3 additions, 15 deletions
python/test/base.py
python/test/mpi.py
+43
-0
43 additions, 0 deletions
python/test/mpi.py
with
82 additions
and
15 deletions
dune/xt/common/test/parallel/mpi_comm_wrapper.cc
0 → 100644
+
36
−
0
View file @
65ee6df5
// This file is part of the dune-xt-grid project:
// https://github.com/dune-community/dune-xt-grid
// Copyright 2009-2018 dune-xt-grid developers and contributors. All rights reserved.
// License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
// or GPL-2.0+ (http://opensource.org/licenses/gpl-license)
// with "runtime exception" (http://www.dune-project.org/license.html)
// Authors:
// Rene Milk (2018)
#include
<dune/xt/common/test/main.hxx>
#include
<dune/common/unused.hh>
#include
<dune/xt/common/parallel/mpi_comm_wrapper.hh>
using
namespace
Dune
;
using
namespace
Dune
::
XT
::
Common
;
MPIHelper
::
MPICommunicator
implicit_convert
(
MPI_Comm_Wrapper
mpi_comm
)
{
return
mpi_comm
.
get
();
}
GTEST_TEST
(
MpiCommWrapper
,
Global
)
{
const
auto
orig
=
MPIHelper
::
getCommunicator
();
const
auto
convert
=
implicit_convert
(
orig
);
ASSERT_EQ
(
orig
,
convert
);
}
GTEST_TEST
(
MpiCommWrapper
,
Local
)
{
const
auto
orig
=
MPIHelper
::
getLocalCommunicator
();
const
auto
convert
=
implicit_convert
(
orig
);
ASSERT_EQ
(
orig
,
convert
);
}
This diff is collapsed.
Click to expand it.
python/test/base.py
+
3
−
15
View file @
65ee6df5
...
...
@@ -46,18 +46,6 @@ def test_timings():
timings
.
output_simple
()
def
test_mpi_wrapper
():
try
:
from
mpi4py
import
MPI
except
ImportError
:
pytest
.
skip
(
'
optional mpi4py is missing
'
)
return
mpi_comm
=
MPI
.
COMM_WORLD
from
dune.xt.common
import
CollectiveCommunication
comm_def
=
CollectiveCommunication
()
comm
=
CollectiveCommunication
(
mpi_comm
)
assert
type
(
comm
)
is
type
(
comm_def
)
assert
comm
.
size
>
0
assert
comm
.
rank
<
comm
.
size
assert
comm
.
sum
(
1
)
==
comm
.
size
if
__name__
==
'
__main__
'
:
from
dune.xt.common.test
import
runmodule
runmodule
(
__file__
)
This diff is collapsed.
Click to expand it.
python/test/mpi.py
0 → 100644
+
43
−
0
View file @
65ee6df5
# ~~~
# This file is part of the dune-xt-common project:
# https://github.com/dune-community/dune-xt-common
# Copyright 2009-2018 dune-xt-common developers and contributors. All rights reserved.
# License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
# Authors:
# Rene Milk (2018)
# ~~~
import
pytest
from
dune.xt.common.test
import
load_all_submodule
def
test_mpi4py
():
try
:
from
mpi4py
import
MPI
except
ImportError
:
pytest
.
skip
(
'
optional mpi4py is missing
'
)
return
mpi_comm
=
MPI
.
COMM_WORLD
from
dune.xt.common
import
CollectiveCommunication
comm_def
=
CollectiveCommunication
()
comm
=
CollectiveCommunication
(
mpi_comm
)
assert
type
(
comm
)
is
type
(
comm_def
)
assert
comm
.
size
>
0
assert
comm
.
rank
<
comm
.
size
assert
comm
.
sum
(
1
)
==
comm
.
size
def
test_wrapper
():
try
:
from
mpi4py
import
MPI
except
ImportError
:
pytest
.
skip
(
'
optional mpi4py is missing
'
)
return
mpi_comm
=
MPI
.
COMM_WORLD
if
__name__
==
'
__main__
'
:
from
dune.xt.common.test
import
runmodule
runmodule
(
__file__
)
\ No newline at end of file
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