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
17e09b29
Commit
17e09b29
authored
10 years ago
by
Jean-Matthieu Etancelin
Browse files
Options
Downloads
Patches
Plain Diff
small improvements
parent
4f0c310e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Examples/RMI/RMI_hybrid.py
+10
-4
10 additions, 4 deletions
Examples/RMI/RMI_hybrid.py
HySoP/hysop/tools/profiler.py
+3
-2
3 additions, 2 deletions
HySoP/hysop/tools/profiler.py
with
13 additions
and
6 deletions
Examples/RMI/RMI_hybrid.py
+
10
−
4
View file @
17e09b29
...
@@ -48,7 +48,7 @@ from hysop.domain.subsets import SubBox
...
@@ -48,7 +48,7 @@ from hysop.domain.subsets import SubBox
from
hysop.operator.hdf_io
import
HDF_Writer
from
hysop.operator.hdf_io
import
HDF_Writer
from
hysop.operator.energy_enstrophy
import
EnergyEnstrophy
from
hysop.operator.energy_enstrophy
import
EnergyEnstrophy
import
hysop.tools.numpywrappers
as
npw
import
hysop.tools.numpywrappers
as
npw
from
hysop.tools.profiler
import
Profiler
from
hysop.tools.profiler
import
Profiler
,
FProfiler
#from hysop.tools.io_utils import IO
#from hysop.tools.io_utils import IO
#IO.set_default_path("/scratch_p/jmetancelin")
#IO.set_default_path("/scratch_p/jmetancelin")
pi
=
np
.
pi
pi
=
np
.
pi
...
@@ -164,7 +164,7 @@ rho = hysop.Field(domain=box, formula=initRho,
...
@@ -164,7 +164,7 @@ rho = hysop.Field(domain=box, formula=initRho,
data
=
{
'
dt
'
:
0.001
}
data
=
{
'
dt
'
:
0.001
}
dt
=
VariableParameter
(
data
)
dt
=
VariableParameter
(
data
)
simu
=
Simulation
(
tinit
=
0.0
,
tend
=
100.
,
timeStep
=
0.001
,
iterMax
=
1
)
simu
=
Simulation
(
tinit
=
0.0
,
tend
=
100.
,
timeStep
=
0.001
,
iterMax
=
1
000000
)
# Flow discretizations:
# Flow discretizations:
d_uw
=
Discretization
(
USER_NB_ELEM_UW
)
d_uw
=
Discretization
(
USER_NB_ELEM_UW
)
...
@@ -445,7 +445,7 @@ setup_time = MPI.Wtime() - ctime
...
@@ -445,7 +445,7 @@ setup_time = MPI.Wtime() - ctime
main_comm
.
Barrier
()
main_comm
.
Barrier
()
# Solve
# Solve
solve_time
=
0.
solve_time
=
FProfiler
(
"
Solve
"
)
while
not
simu
.
isOver
:
while
not
simu
.
isOver
:
ctime
=
MPI
.
Wtime
()
ctime
=
MPI
.
Wtime
()
if
main_rank
==
0
:
if
main_rank
==
0
:
...
@@ -476,6 +476,7 @@ if IS_OUTPUT:
...
@@ -476,6 +476,7 @@ if IS_OUTPUT:
p_velo
.
apply
(
simu
)
p_velo
.
apply
(
simu
)
prof
=
Profiler
(
None
,
box
.
comm_task
)
prof
=
Profiler
(
None
,
box
.
comm_task
)
prof
+=
solve_time
for
op
in
operators_list
:
for
op
in
operators_list
:
if
box
.
is_on_task
(
op
.
task_id
()):
if
box
.
is_on_task
(
op
.
task_id
()):
op
.
finalize
()
op
.
finalize
()
...
@@ -483,7 +484,12 @@ for op in operators_list:
...
@@ -483,7 +484,12 @@ for op in operators_list:
for
v
in
(
velo
,
vorti
,
rho
,
scal
):
for
v
in
(
velo
,
vorti
,
rho
,
scal
):
prof
+=
v
.
profiler
prof
+=
v
.
profiler
prof
.
summarize
()
prof
.
summarize
()
print
prof
for
i
in
xrange
(
main_size
):
if
i
==
main_rank
:
print
"
Solving Time:
"
,
solve_time
print
prof
main_comm
.
Barrier
()
velo
.
finalize
()
velo
.
finalize
()
if
box
.
is_on_task
(
TASK_SCALAR
):
if
box
.
is_on_task
(
TASK_SCALAR
):
...
...
This diff is collapsed.
Click to expand it.
HySoP/hysop/tools/profiler.py
+
3
−
2
View file @
17e09b29
...
@@ -41,8 +41,9 @@ class FProfiler(object):
...
@@ -41,8 +41,9 @@ class FProfiler(object):
def
__str__
(
self
):
def
__str__
(
self
):
if
self
.
n
>
0
:
if
self
.
n
>
0
:
s
=
"
- {0} : {1} s ({2} calls)
"
.
format
(
s
=
"
- {0} : {1} s ({2} call{3})
"
.
format
(
self
.
fname
,
self
.
t
,
self
.
n
)
self
.
fname
,
self
.
t
,
self
.
n
,
'
s
'
if
self
.
n
>
1
else
''
)
else
:
else
:
s
=
""
s
=
""
return
s
return
s
...
...
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