Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hysop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
particle_methods
hysop
Commits
73c49a6d
Commit
73c49a6d
authored
10 years ago
by
Franck Pérignon
Browse files
Options
Downloads
Patches
Plain Diff
Update adaptative TS for intercomm broadcast - Tests ok
parent
17319775
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
HySoP/hysop/mpi/bridge_inter.py
+2
-2
2 additions, 2 deletions
HySoP/hysop/mpi/bridge_inter.py
HySoP/hysop/operator/tests/test_adaptive_time_step.py
+46
-10
46 additions, 10 deletions
HySoP/hysop/operator/tests/test_adaptive_time_step.py
with
48 additions
and
12 deletions
HySoP/hysop/mpi/bridge_inter.py
+
2
−
2
View file @
73c49a6d
...
...
@@ -42,10 +42,10 @@ class BridgeInter(object):
current_task
=
self
.
_topology
.
domain
.
currentTask
()
# True if current process is in the 'from' group'
task_is_source
=
current_task
()
==
self
.
source_id
task_is_source
=
current_task
==
self
.
source_id
# True if current process is in the 'to' group
task_is_target
=
current_task
()
==
self
.
target_id
task_is_target
=
current_task
==
self
.
target_id
# Ensure that current process belongs to one and only one task.
assert
task_is_source
or
task_is_target
...
...
This diff is collapsed.
Click to expand it.
HySoP/hysop/operator/tests/test_adaptive_time_step.py
+
46
−
10
View file @
73c49a6d
...
...
@@ -42,13 +42,13 @@ def test_adapt():
Here we just check if discr/setup/apply process goes well.
"""
velo
,
vorti
=
init
()
dt
=
VariableParameter
(
data
=
0.0125
,
name
=
'
dt
'
)
op
=
AdaptTimeStep
(
velo
,
vorti
,
dt_adapt
=
dt
,
simu
=
Simulation
(
nbIter
=
2
)
op
=
AdaptTimeStep
(
velo
,
vorti
,
simulation
=
simu
,
discretization
=
d3d
,
lcfl
=
0.125
,
cfl
=
0.5
)
op
.
discretize
()
op
.
setup
()
simu
=
Simulation
(
nbIter
=
2
)
op
.
apply
(
simu
)
op
.
apply
(
)
op
.
wait
(
)
def
test_adapt_2
():
...
...
@@ -56,13 +56,13 @@ def test_adapt_2():
The same but with file output
"""
velo
,
vorti
=
init
()
dt
=
VariableParameter
(
data
=
0.0125
,
name
=
'
dt
'
)
op
=
AdaptTimeStep
(
velo
,
vorti
,
dt_adapt
=
dt
,
io_params
=
True
,
simu
=
Simulation
(
nbIter
=
2
)
op
=
AdaptTimeStep
(
velo
,
vorti
,
simulation
=
simu
,
io_params
=
True
,
discretization
=
d3d
,
lcfl
=
0.125
,
cfl
=
0.5
)
op
.
discretize
()
op
.
setup
()
simu
=
Simulation
(
nbIter
=
2
)
op
.
apply
(
simu
)
op
.
apply
(
)
op
.
wait
(
)
filename
=
op
.
io_params
.
filename
assert
os
.
path
.
exists
(
filename
)
...
...
@@ -72,8 +72,8 @@ def test_adapt_3():
The same but with external work vector
"""
velo
,
vorti
=
init
()
dt
=
VariableParameter
(
data
=
0.0125
,
name
=
'
dt
'
)
op
=
AdaptTimeStep
(
velo
,
vorti
,
dt_adapt
=
dt
,
io_params
=
True
,
simu
=
Simulation
(
nbIter
=
2
)
op
=
AdaptTimeStep
(
velo
,
vorti
,
simulation
=
simu
,
io_params
=
True
,
discretization
=
d3d
,
lcfl
=
0.125
,
cfl
=
0.5
)
op
.
discretize
()
wk_p
=
op
.
get_work_properties
()
...
...
@@ -86,11 +86,47 @@ def test_adapt_3():
op
.
setup
(
rwork
=
rwork
)
simu
=
Simulation
(
nbIter
=
2
)
op
.
apply
(
simu
)
op
.
wait
()
filename
=
op
.
io_params
.
filename
assert
os
.
path
.
exists
(
filename
)
def
test_adapt_4
():
"""
The same but with external work vector
"""
# MPI procs are distributed among two tasks
GPU
=
4
CPU
=
1
VISU
=
12
from
parmepy.mpi.main_var
import
main_size
proc_tasks
=
[
CPU
,
]
*
main_size
if
main_size
>
2
:
proc_tasks
[
-
1
]
=
GPU
proc_tasks
[
0
]
=
GPU
#proc_tasks[1] = VISU
dom
=
pp
.
Box
(
dimension
=
3
,
proc_tasks
=
proc_tasks
)
velo
=
Field
(
domain
=
dom
,
formula
=
computeVel
,
name
=
'
Velocity
'
,
isVector
=
True
)
vorti
=
Field
(
domain
=
dom
,
formula
=
computeVort
,
name
=
'
Vorticity
'
,
isVector
=
True
)
from
parmepy.tools.parameters
import
MPI_params
cpu_task
=
MPI_params
(
comm
=
dom
.
comm_task
,
task_id
=
CPU
)
simu
=
Simulation
(
nbIter
=
2
)
op
=
AdaptTimeStep
(
velo
,
vorti
,
simulation
=
simu
,
io_params
=
True
,
discretization
=
d3d
,
lcfl
=
0.125
,
cfl
=
0.5
,
mpi_params
=
cpu_task
)
if
dom
.
isOnTask
(
CPU
):
op
.
discretize
()
op
.
setup
()
op
.
apply
()
op
.
wait
()
if
__name__
==
"
__main__
"
:
test_adapt
()
test_adapt_2
()
test_adapt_3
()
test_adapt_4
()
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