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
75fa9133
Commit
75fa9133
authored
6 years ago
by
EXT Jean-Matthieu Etancelin
Browse files
Options
Downloads
Patches
Plain Diff
remove hysop main __init__.py from verionning (generated by cmake)
parent
60d45efa
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
hysop/__init__.py
+0
-142
0 additions, 142 deletions
hysop/__init__.py
with
0 additions
and
142 deletions
hysop/__init__.py
deleted
100644 → 0
+
0
−
142
View file @
60d45efa
"""
Python package dedicated to flow simulation using particular methods
on hybrid architectures (MPI-GPU)
"""
from
functools
import
wraps
from
hysop.deps
import
__builtin__
,
print_function
,
os
,
sys
,
warnings
,
traceback
def
get_env
(
target
,
default_value
):
target
=
'
HYSOP_{}
'
.
format
(
target
)
if
target
in
os
.
environ
:
value
=
os
.
environ
[
target
]
if
value
.
lower
()
in
(
'
0
'
,
'
no
'
,
'
false
'
):
return
False
elif
value
.
upper
()
in
(
'
1
'
,
'
yes
'
,
'
true
'
):
return
True
else
:
return
value
else
:
return
default_value
# HySoP
package_name
=
"
hysop
"
version
=
"
2.0.0-rc.1
"
# Compilation flags
__MPI_ENABLED__
=
"
ON
"
is
"
ON
"
__GPU_ENABLED__
=
"
ON
"
is
"
ON
"
__FFTW_ENABLED__
=
"
ON
"
is
"
ON
"
__SCALES_ENABLED__
=
"
OFF
"
is
"
ON
"
__OPTIMIZE__
=
not
__debug__
__VERBOSE__
=
get_env
(
'
VERBOSE
'
,
False
)
__DEBUG__
=
get_env
(
'
DEBUG
'
,
False
)
__PROFILE__
=
get_env
(
'
PROFILE
'
,
False
)
__KERNEL_DEBUG__
=
get_env
(
'
KERNEL_DEBUG
'
,
False
)
__TRACE_CALLS__
=
get_env
(
'
TRACE_CALLS
'
,
False
)
__TRACE_WARNINGS__
=
get_env
(
'
TRACE_WARNINGS
'
,
False
)
__TRACE_MEMALLOCS__
=
get_env
(
'
TRACE_MEMALLOC
'
,
False
)
__TRACE_KERNELS__
=
get_env
(
'
TRACE_KERNELS
'
,
False
)
__KERNEL_DEBUG__
=
get_env
(
'
KERNEL_DEBUG
'
,
False
)
__BACKTRACE_BIG_MEMALLOCS__
=
get_env
(
'
BACKTRACE_BIG_MEMALLOCS
'
,
False
)
__TEST_ALL_OPENCL_PLATFORMS__
=
get_env
(
'
TEST_ALL_OPENCL_PLATFORMS
'
,
False
)
__ENABLE_LONG_TESTS__
=
get_env
(
'
ENABLE_LONG_TESTS
'
,
(
"
OFF
"
is
"
ON
"
))
# OpenCL
__DEFAULT_PLATFORM_ID__
=
int
(
get_env
(
'
DEFAULT_PLATFORM_ID
'
,
0
))
__DEFAULT_DEVICE_ID__
=
int
(
get_env
(
'
DEFAULT_DEVICE_ID
'
,
0
))
if
__MPI_ENABLED__
:
from
hysop.core.mpi
import
MPI
,
main_rank
,
main_size
,
\
host_rank
,
interhost_size
,
\
shm_rank
,
intershm_size
else
:
main_rank
,
main_size
=
0
,
1
# define printing functions
def
print
(
*
args
,
**
kargs
):
"""
Wrap print function (because of python 3)
"""
__builtin__
.
print
(
*
args
,
**
kargs
)
def
vprint
(
*
args
,
**
kargs
):
"""
prints only if __VERBOSE__ has been set
"""
if
__VERBOSE__
:
print
(
*
args
,
**
kargs
)
def
dprint
(
*
args
,
**
kargs
):
"""
prints only if __DEBUG__ has been set
"""
if
__DEBUG__
:
print
(
*
args
,
**
kargs
)
def
mprint
(
*
args
,
**
kargs
):
"""
prints only on world master rank 0
"""
if
(
main_rank
==
0
):
vprint
(
*
args
,
**
kargs
)
def
hprint
(
*
args
,
**
kargs
):
"""
prints only host master rank 0
"""
if
(
host_rank
==
0
):
vprint
(
*
args
,
**
kargs
)
def
sprint
(
*
args
,
**
kargs
):
"""
prints only shared memory master rank 0
"""
if
(
shm_rank
==
0
):
vprint
(
*
args
,
**
kargs
)
def
reset
():
"""
Reset hysop state (registered objects).
"""
from
hysop.tools.handle
import
RegisteredObject
RegisteredObject
.
_RegisteredObject__reset
()
# override warning printer
if
'
__formatwarning
'
not
in
locals
():
__formatwarning
=
warnings
.
formatwarning
def
__new_formatwarning
(
message
,
category
,
filename
,
lineno
,
line
=
None
):
if
__TRACE_WARNINGS__
:
traceback
.
print_stack
()
return
__formatwarning
(
message
,
category
,
filename
,
lineno
,
line
=
''
)
warnings
.
formatwarning
=
__new_formatwarning
if
__TRACE_CALLS__
:
def
__trace
(
frame
,
event
,
arg
):
print
(
'
{} {}:{}
'
.
format
(
event
,
frame
.
f_code
.
co_filename
,
frame
.
f_lineno
))
sys
.
settrace
(
__trace
)
from
hysop.domain.domain
import
Domain
from
hysop.domain.box
import
Box
from
hysop.fields.continuous_field
import
Field
from
hysop.fields.discrete_field
import
DiscreteField
from
hysop.parameters.scalar_parameter
import
ScalarParameter
from
hysop.parameters.tensor_parameter
import
TensorParameter
from
hysop.topology.cartesian_topology
import
Topology
,
CartesianTopology
from
hysop.topology.topology_descriptor
import
TopologyDescriptor
from
hysop.tools.parameters
import
Discretization
,
MPIParams
from
hysop.simulation
import
Simulation
from
hysop.problem
import
Problem
from
hysop.tools.io_utils
import
IO
,
IOParams
__all__
=
[
'
Box
'
,
'
Field
'
,
'
DiscreteField
'
,
'
ScalarParameter
'
,
'
TensorParameter
'
,
'
Domain
'
,
'
Discretization
'
,
'
Simulation
'
,
'
MPIParams
'
,
'
Problem
'
,
'
IO
'
,
'
IOParams
'
,
'
Topology
'
,
'
CartesianTopology
'
,
'
TopologyDescriptor
'
]
if
__MPI_ENABLED__
:
__all__
+=
[
'
MPI
'
,
'
main_rank
'
,
'
main_size
'
]
from
hysop.tools.sys_utils
import
SysUtils
if
SysUtils
.
is_interactive
():
__defpath
=
os
.
path
.
join
(
os
.
getcwd
(),
'
interactive
'
)
else
:
__defpath
=
os
.
getcwd
()
IO
.
set_default_path
(
get_env
(
'
DUMP_DIR
'
,
__defpath
))
msg_start
=
'
\n
Starting {} version {}
'
.
format
(
package_name
,
version
)
if
__MPI_ENABLED__
:
msg_start
+=
(
'
with {} mpi process(es) on {} host(s)
'
+
'
providing {} shared memory node(s).
'
).
format
(
main_size
,
interhost_size
,
intershm_size
)
mprint
(
msg_start
)
default_path
=
IO
.
default_path
()
cache_path
=
IO
.
default_cache_path
()
msg_io
=
'
\n
*Default path for all i/o is
\'
{}
\'
.
'
.
format
(
default_path
)
msg_io
+=
'
\n
*Default path for caching is
\'
{}
\'
.
'
.
format
(
cache_path
)
mprint
(
msg_io
)
mprint
()
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