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
0627da61
Commit
0627da61
authored
6 years ago
by
Jean-Baptiste Keck
Browse files
Options
Downloads
Patches
Plain Diff
added a target for local library updates
parent
567ff5c5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!5
Resolve "Gradient operator does not work correctly"
Pipeline
#10120
failed
6 years ago
Stage: env
Stage: configure
Stage: build
Stage: install
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+9
-0
9 additions, 0 deletions
CMakeLists.txt
hysop/backend/host/fortran/operator/poisson.py
+5
-6
5 additions, 6 deletions
hysop/backend/host/fortran/operator/poisson.py
setup.py.in
+3
-4
3 additions, 4 deletions
setup.py.in
with
17 additions
and
10 deletions
CMakeLists.txt
+
9
−
0
View file @
0627da61
...
@@ -625,6 +625,7 @@ if(VERBOSE_MODE)
...
@@ -625,6 +625,7 @@ if(VERBOSE_MODE)
message
(
WARNING
"You deactivate c++ to python interface generation. This will disable the Aitken-Schwarz Poisson solver."
)
message
(
WARNING
"You deactivate c++ to python interface generation. This will disable the Aitken-Schwarz Poisson solver."
)
endif
()
endif
()
message
(
STATUS
" Sources are in :
${
CMAKE_SOURCE_DIR
}
"
)
message
(
STATUS
" Sources are in :
${
CMAKE_SOURCE_DIR
}
"
)
message
(
STATUS
" Build is done in :
${
CMAKE_BINARY_DIR
}
"
)
message
(
STATUS
" Project uses MPI :
${
USE_MPI
}
"
)
message
(
STATUS
" Project uses MPI :
${
USE_MPI
}
"
)
message
(
STATUS
" Project uses Scales :
${
WITH_SCALES
}
"
)
message
(
STATUS
" Project uses Scales :
${
WITH_SCALES
}
"
)
message
(
STATUS
" Project uses FFTW :
${
WITH_FFTW
}
"
)
message
(
STATUS
" Project uses FFTW :
${
WITH_FFTW
}
"
)
...
@@ -650,3 +651,11 @@ if(VERBOSE_MODE)
...
@@ -650,3 +651,11 @@ if(VERBOSE_MODE)
message
(
"Try to run python -c 'import hysop'. If it fails, add
${
HYSOP_PYTHON_INSTALL_DIR
}
to PYTHONPATH environment variable."
)
message
(
"Try to run python -c 'import hysop'. If it fails, add
${
HYSOP_PYTHON_INSTALL_DIR
}
to PYTHONPATH environment variable."
)
message
(
"Example :
\n
export PYTHONPATH=
${
HYSOP_PYTHON_INSTALL_DIR
}
/:
\$
{PYTHONPATH}
\n
"
)
message
(
"Example :
\n
export PYTHONPATH=
${
HYSOP_PYTHON_INSTALL_DIR
}
/:
\$
{PYTHONPATH}
\n
"
)
endif
()
endif
()
# Add custom target to install compiled libraries locally
add_custom_target
(
update_libs
COMMAND find
${
CMAKE_SOURCE_DIR
}
/hysop/ -name '*.so' -type f -delete
COMMAND find
${
CMAKE_BINARY_DIR
}
-name '*.so' -type f -print0 | xargs -0 cp -t
${
CMAKE_SOURCE_DIR
}
/hysop/
COMMAND [ -f
"$ENV{HOME}/.hysop.__init__.py"
] && rm
${
CMAKE_SOURCE_DIR
}
/hysop/__init__.py
COMMAND [ -f
"$ENV{HOME}/.hysop.__init__.py"
] && cp $ENV{HOME}/.hysop.__init__.py
${
CMAKE_SOURCE_DIR
}
/hysop/__init__.py
DEPENDS wheel
)
This diff is collapsed.
Click to expand it.
hysop/backend/host/fortran/operator/poisson.py
+
5
−
6
View file @
0627da61
...
@@ -37,7 +37,7 @@ class PoissonFFTW(FortranFFTWOperator):
...
@@ -37,7 +37,7 @@ class PoissonFFTW(FortranFFTWOperator):
values
=
CartesianTopologyDescriptors
)
values
=
CartesianTopologyDescriptors
)
assert
Fin
.
nb_components
==
Fout
.
nb_components
assert
Fin
.
nb_components
==
Fout
.
nb_components
assert
Fin
.
nb_components
==
1
,
\
assert
Fin
.
nb_components
==
1
,
\
"
P
oisson operator is implemented only for scalar fields
"
"
Fortran FFTW p
oisson operator is implemented only for scalar fields
"
assert
Fin
.
domain
is
Fout
.
domain
,
\
assert
Fin
.
domain
is
Fout
.
domain
,
\
'
only one domain is supported
'
'
only one domain is supported
'
...
@@ -66,19 +66,18 @@ class PoissonFFTW(FortranFFTWOperator):
...
@@ -66,19 +66,18 @@ class PoissonFFTW(FortranFFTWOperator):
if
self
.
discretized
:
if
self
.
discretized
:
return
return
super
(
PoissonFFTW
,
self
).
discretize
()
super
(
PoissonFFTW
,
self
).
discretize
()
self
.
dFin
=
self
.
Fin
.
discrete_field
s
[
self
.
topology
]
self
.
dFin
=
self
.
get_input_
discrete_field
(
self
.
Fin
)
self
.
dFout
=
self
.
Fout
.
discrete_field
s
[
self
.
topology
]
self
.
dFout
=
self
.
get_output_
discrete_field
(
self
.
Fout
)
assert
(
self
.
dFin
.
ghosts
==
self
.
dFout
.
ghosts
).
all
(),
\
assert
(
self
.
dFin
.
ghosts
==
self
.
dFout
.
ghosts
).
all
(),
\
"
Input and output fields must have the same ghosts.
"
"
Input and output fields must have the same ghosts.
"
self
.
ghosts
=
self
.
dFin
.
ghosts
.
astype
(
np
.
float64
)
# prevent f2py copy
@op_apply
@op_apply
def
apply
(
self
,
**
kargs
):
def
apply
(
self
,
**
kargs
):
super
(
PoissonFFTW
,
self
).
apply
(
**
kargs
)
super
(
PoissonFFTW
,
self
).
apply
(
**
kargs
)
gh
=
self
.
input_fields
[
self
.
Fin
].
ghosts
changeLayout
,
di
,
do
=
self
.
_initialize_mem_layout
(
self
.
dFin
,
self
.
dFout
)
changeLayout
,
di
,
do
=
self
.
_initialize_mem_layout
(
self
.
dFin
,
self
.
dFout
)
# Vectors are given in ZYX layout to Fortran
# Vectors are given in ZYX layout to Fortran
do
=
self
.
_solve
(
di
[
0
],
gh
)
self
.
_solve
(
di
[
0
],
do
[
0
],
self
.
ghosts
)
if
changeLayout
:
if
changeLayout
:
self
.
dFout
.
data
[
0
][...]
=
-
np
.
ascontiguousarray
(
do
)
self
.
dFout
.
data
[
0
][...]
=
-
np
.
ascontiguousarray
(
do
)
self
.
dFout
.
exchange_ghosts
()
self
.
dFout
.
exchange_ghosts
()
...
...
This diff is collapsed.
Click to expand it.
setup.py.in
+
3
−
4
View file @
0627da61
...
@@ -136,10 +136,9 @@ def create_fortran_extension(name, pyf_file=None, src_dirs=None, sources=None,
...
@@ -136,10 +136,9 @@ def create_fortran_extension(name, pyf_file=None, src_dirs=None, sources=None,
# --- set f2py options ---
# --- set f2py options ---
f2py_options
=
[
'
--no-lower
'
,
'
--no-wrap-functions
'
]
f2py_options
=
[
'
--no-lower
'
,
'
--no-wrap-functions
'
]
options
=
[]
options
=
[]
if
debug_mode
==
1
:
options
.
append
((
'
F2PY_REPORT_ON_ARRAY_COPY
'
,
'
1
'
))
options
.
append
((
'
F2PY_REPORT_ON_ARRAY_COPY
'
,
'
1
'
))
if
os
.
uname
()[
0
]
==
'
Linux
'
:
if
os
.
uname
()[
0
]
==
'
Linux
'
:
options
.
append
((
'
F2PY_REPORT_ATEXIT
'
,
'
1
'
))
options
.
append
((
'
F2PY_REPORT_ATEXIT
'
,
'
1
'
))
# --- set include dir ---
# --- set include dir ---
inc_dir
=
parseCMakeVar
(
"
@FORTRAN_INCLUDE_DIRS@
"
)
inc_dir
=
parseCMakeVar
(
"
@FORTRAN_INCLUDE_DIRS@
"
)
...
...
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