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
d0f3c5e0
Commit
d0f3c5e0
authored
10 years ago
by
Jean-Matthieu Etancelin
Committed by
Franck Pérignon
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fiw gpu transfer. Fix f2py parameters avoiding some array copy.
parent
cb0c758d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
HySoP/hysop/gpu/gpu_transfer.py
+2
-2
2 additions, 2 deletions
HySoP/hysop/gpu/gpu_transfer.py
HySoP/hysop/operator/computational.py
+4
-5
4 additions, 5 deletions
HySoP/hysop/operator/computational.py
HySoP/hysop/tools/parameters.py
+1
-1
1 addition, 1 deletion
HySoP/hysop/tools/parameters.py
with
7 additions
and
8 deletions
HySoP/hysop/gpu/gpu_transfer.py
+
2
−
2
View file @
d0f3c5e0
...
@@ -104,10 +104,10 @@ class DataTransfer(Computational):
...
@@ -104,10 +104,10 @@ class DataTransfer(Computational):
self
.
_ghosts_synchro
=
None
self
.
_ghosts_synchro
=
None
# This function is needed only in a toDevice transfer and if the target operator needs ghosts
# This function is needed only in a toDevice transfer and if the target operator needs ghosts
if
self
.
_transfer
==
self
.
_apply_toDevice
:
if
self
.
_transfer
==
self
.
_apply_toDevice
:
d_target
=
self
.
_target
.
discrete
Operator
d_target
=
self
.
_target
.
discrete
_op
# Test for advection operator
# Test for advection operator
if
self
.
_target
.
_is_discretized
and
d_target
is
None
:
if
self
.
_target
.
_is_discretized
and
d_target
is
None
:
d_target
=
self
.
_target
.
advec_dir
[
0
].
discrete
Operator
d_target
=
self
.
_target
.
advec_dir
[
0
].
discrete
_op
if
d_target
.
_synchronize
is
not
None
and
d_target
.
_synchronize
:
if
d_target
.
_synchronize
is
not
None
and
d_target
.
_synchronize
:
self
.
_ghosts_synchro
=
UpdateGhostsFull
(
self
.
_ghosts_synchro
=
UpdateGhostsFull
(
self
.
_d_var
[
0
].
topology
,
self
.
_d_var
[
0
].
topology
,
...
...
This diff is collapsed.
Click to expand it.
HySoP/hysop/operator/computational.py
+
4
−
5
View file @
d0f3c5e0
...
@@ -4,11 +4,12 @@
...
@@ -4,11 +4,12 @@
Interface common to all continuous operators.
Interface common to all continuous operators.
"""
"""
from
abc
import
ABCMeta
,
abstractmethod
from
abc
import
ABCMeta
,
abstractmethod
from
parmepy.constants
import
debug
from
parmepy.constants
import
debug
,
PARMES_INTEGER
from
parmepy.operator.continuous
import
Operator
from
parmepy.operator.continuous
import
Operator
from
parmepy.mpi.topology
import
Cartesian
from
parmepy.mpi.topology
import
Cartesian
from
parmepy.tools.parameters
import
Discretization
from
parmepy.tools.parameters
import
Discretization
from
parmepy.tools.profiler
import
profile
from
parmepy.tools.profiler
import
profile
import
parmepy.tools.numpywrappers
as
npw
class
Computational
(
Operator
):
class
Computational
(
Operator
):
...
@@ -221,20 +222,18 @@ class Computational(Operator):
...
@@ -221,20 +222,18 @@ class Computational(Operator):
"""
"""
if
self
.
_is_discretized
:
if
self
.
_is_discretized
:
return
return
build_topos
=
self
.
_check_variables
()
build_topos
=
self
.
_check_variables
()
assert
self
.
_single_topo
,
'
All fields must use the same topology.
'
assert
self
.
_single_topo
,
'
All fields must use the same topology.
'
# Get local mesh parameters from fftw
# Get local mesh parameters from fftw
comm
=
self
.
_mpis
.
comm
comm
=
self
.
_mpis
.
comm
from
parmepy.f2py
import
fftw2py
from
parmepy.f2py
import
fftw2py
if
build_topos
:
if
build_topos
:
# In that case, self._discretization must be
# In that case, self._discretization must be
# a Discretization object, used for all fields.
# a Discretization object, used for all fields.
# We use it to initialize scales solver
# We use it to initialize scales solver
msg
=
'
Wrong type for parameter discretization (at init).
'
msg
=
'
Wrong type for parameter discretization (at init).
'
assert
isinstance
(
self
.
_discretization
,
Discretization
),
msg
assert
isinstance
(
self
.
_discretization
,
Discretization
),
msg
resolution
=
self
.
_discretization
.
resolution
resolution
=
npw
.
asintarray
(
self
.
_discretization
.
resolution
)
localres
,
global_start
=
fftw2py
.
init_fftw_solver
(
localres
,
global_start
=
fftw2py
.
init_fftw_solver
(
resolution
,
self
.
domain
.
length
,
comm
=
comm
.
py2f
())
resolution
,
self
.
domain
.
length
,
comm
=
comm
.
py2f
())
# Create the parmes topo (plane, cut through ZDIR)
# Create the parmes topo (plane, cut through ZDIR)
...
@@ -258,7 +257,7 @@ class Computational(Operator):
...
@@ -258,7 +257,7 @@ class Computational(Operator):
else
:
else
:
assert
topo
.
shape
[
-
1
]
==
self
.
_mpis
.
comm
.
Get_size
(),
msg
assert
topo
.
shape
[
-
1
]
==
self
.
_mpis
.
comm
.
Get_size
(),
msg
resolution
=
topo
.
mesh
.
discretization
.
resolution
resolution
=
npw
.
asintarray
(
topo
.
mesh
.
discretization
.
resolution
)
localres
,
global_start
=
fftw2py
.
init_fftw_solver
(
localres
,
global_start
=
fftw2py
.
init_fftw_solver
(
resolution
,
self
.
domain
.
length
,
comm
=
comm
.
py2f
())
resolution
,
self
.
domain
.
length
,
comm
=
comm
.
py2f
())
...
...
This diff is collapsed.
Click to expand it.
HySoP/hysop/tools/parameters.py
+
1
−
1
View file @
d0f3c5e0
...
@@ -55,7 +55,7 @@ class Discretization(namedtuple("Discretization", ['resolution', 'ghosts'])):
...
@@ -55,7 +55,7 @@ class Discretization(namedtuple("Discretization", ['resolution', 'ghosts'])):
def
__new__
(
cls
,
resolution
,
ghosts
=
None
):
def
__new__
(
cls
,
resolution
,
ghosts
=
None
):
resolution
=
npw
.
asdimarray
(
resolution
)
resolution
=
npw
.
asdimarray
(
resolution
)
if
ghosts
is
not
None
:
if
ghosts
is
not
None
:
ghosts
=
npw
.
as
dim
array
(
ghosts
)
ghosts
=
npw
.
as
int
array
(
ghosts
)
msg
=
'
Dimensions of resolution and ghosts parameters
'
msg
=
'
Dimensions of resolution and ghosts parameters
'
msg
+=
'
are not complient.
'
msg
+=
'
are not complient.
'
assert
ghosts
.
size
==
resolution
.
size
,
msg
assert
ghosts
.
size
==
resolution
.
size
,
msg
...
...
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