Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
grudge
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Matt Wala
grudge
Commits
dd233f4d
Commit
dd233f4d
authored
7 years ago
by
Ellis
Browse files
Options
Downloads
Patches
Plain Diff
Refine test cases
parent
e90514e0
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
test/test_mpi_communication.py
+24
-11
24 additions, 11 deletions
test/test_mpi_communication.py
with
24 additions
and
11 deletions
test/test_mpi_communication.py
+
24
−
11
View file @
dd233f4d
...
...
@@ -36,7 +36,7 @@ from grudge import sym, bind, Discretization
from
grudge.shortcuts
import
set_up_rk4
def
boundary
_communication_entrypoint
():
def
simple
_communication_entrypoint
():
cl_ctx
=
cl
.
create_some_context
()
queue
=
cl
.
CommandQueue
(
cl_ctx
)
from
meshmode.distributed
import
MPIMeshDistributor
...
...
@@ -208,19 +208,31 @@ def mpi_communication_entrypoint():
# {{{ MPI test pytest entrypoint
@pytest.mark.mpi
@pytest.mark.parametrize
(
"
testcase
"
,
[
# "MPI_COMMUNICATION",
"
BOUNDARY_COMMUNICATION
"
])
@pytest.mark.parametrize
(
"
num_ranks
"
,
[
2
])
def
test_mpi
(
testcase
,
num_ranks
):
def
test_mpi
(
num_ranks
):
pytest
.
importorskip
(
"
mpi4py
"
)
from
subprocess
import
check_call
import
sys
newenv
=
os
.
environ
.
copy
()
newenv
[
"
RUN_WITHIN_MPI
"
]
=
"
1
"
newenv
[
testcase
]
=
"
1
"
newenv
[
"
TEST_MPI_COMMUNICATION
"
]
=
"
1
"
check_call
([
"
mpiexec
"
,
"
-np
"
,
str
(
num_ranks
),
"
-x
"
,
"
RUN_WITHIN_MPI
"
,
sys
.
executable
,
__file__
],
env
=
newenv
)
@pytest.mark.mpi
@pytest.mark.parametrize
(
"
num_ranks
"
,
[
2
])
def
test_simple_mpi
(
num_ranks
):
pytest
.
importorskip
(
"
mpi4py
"
)
from
subprocess
import
check_call
import
sys
newenv
=
os
.
environ
.
copy
()
newenv
[
"
RUN_WITHIN_MPI
"
]
=
"
1
"
newenv
[
"
TEST_SIMPLE_COMMUNICATION
"
]
=
"
1
"
check_call
([
"
mpiexec
"
,
"
-np
"
,
str
(
num_ranks
),
"
-x
"
,
"
RUN_WITHIN_MPI
"
,
sys
.
executable
,
__file__
],
...
...
@@ -230,10 +242,11 @@ def test_mpi(testcase, num_ranks):
if
__name__
==
"
__main__
"
:
if
"
MPI_COMMUNICATION
"
in
os
.
environ
:
mpi_communication_entrypoint
()
elif
"
BOUNDARY_COMMUNICATION
"
in
os
.
environ
:
boundary_communication_entrypoint
()
if
"
RUN_WITHIN_MPI
"
in
os
.
environ
:
if
"
TEST_MPI_COMMUNICATION
"
in
os
.
environ
:
mpi_communication_entrypoint
()
elif
"
TEST_SIMPLE_COMMUNICATION
"
in
os
.
environ
:
simple_communication_entrypoint
()
else
:
import
sys
if
len
(
sys
.
argv
)
>
1
:
...
...
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