Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
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
Service Desk
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
TurTLE
TurTLE
Commits
a26bb1c6
Commit
a26bb1c6
authored
6 years ago
by
Cristian Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
tweak scaling test
parent
01eabb25
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
tests/DNS/test_scaling.py
+49
-13
49 additions, 13 deletions
tests/DNS/test_scaling.py
with
49 additions
and
13 deletions
tests/DNS/test_scaling.py
+
49
−
13
View file @
a26bb1c6
...
...
@@ -3,7 +3,7 @@ import numpy as np
import
argparse
import
os
import
t
ur
tle
import
T
ur
TLE
def
get_DNS_parameters
(
DNS_type
=
'
A
'
,
...
...
@@ -16,8 +16,11 @@ def get_DNS_parameters(
environment
=
'
express
'
,
minutes
=
'
29
'
,
no_submit
=
True
,
src_dirname
=
'
/draco/ptmp/clalescu/scaling
'
):
assert
(
N
in
[
1024
,
2048
,
4096
])
src_dirname
=
'
/draco/ptmp/clalescu/scaling
'
,
src_prefix
=
'
fbL
'
,
src_iteration
=
None
,
kMeta
=
1.5
):
assert
(
N
in
[
128
,
1024
,
2048
,
4096
])
simname
=
(
DNS_type
+
'
{0:0>4d}
'
.
format
(
N
))
if
output_on
:
simname
=
DNS_type
+
simname
...
...
@@ -30,14 +33,15 @@ def get_DNS_parameters(
work_dir
=
'
nn{0:0>4d}np{1}
'
.
format
(
nnodes
,
nprocesses
)
if
not
output_on
:
class_name
+=
'
_no_output
'
src_simname
=
'
fb3_N{0:0>4d}_kMeta1.5
'
.
format
(
N
)
if
N
==
1024
:
src_iteration
=
32
*
1024
if
N
==
2048
:
src_iteration
=
20
*
1024
if
N
==
4096
:
src_simname
=
'
fb3_N2048x2_kMeta1.5
'
src_iteration
=
0
src_simname
=
src_prefix
+
'
_N{0:0>4d}_kMeta{1:.1f}
'
.
format
(
N
,
kMeta
)
if
type
(
src_iteration
)
==
type
(
None
):
if
N
==
1024
:
src_iteration
=
32
*
1024
if
N
==
2048
:
src_iteration
=
20
*
1024
if
N
==
4096
:
src_simname
=
'
fb3_N2048x2_kMeta1.5
'
src_iteration
=
0
DNS_parameters
=
[
class_name
,
'
-n
'
,
'
{0}
'
.
format
(
N
),
...
...
@@ -48,10 +52,24 @@ def get_DNS_parameters(
'
--niter_todo
'
,
'
12
'
,
'
--niter_out
'
,
'
12
'
,
'
--niter_stat
'
,
'
3
'
]
# check that source sim exists
assert
(
os
.
path
.
exists
(
os
.
path
.
join
(
src_dirname
,
src_simname
+
'
.h5
'
)))
# check that source checkpoint exists
dns_src
=
TurTLE
.
DNS
(
simname
=
src_simname
,
work_dir
=
src_dirname
)
dns_src
.
read_parameters
()
assert
(
os
.
path
.
exists
(
dns_src
.
get_checkpoint_fname
(
iteration
=
src_iteration
)))
DNS_parameters
+=
[
'
--src-wd
'
,
src_dirname
,
'
--src-simname
'
,
src_simname
,
'
--src-iteration
'
,
'
{0}
'
.
format
(
src_iteration
)]
# hardcode precision:
if
N
<=
1024
:
DNS_parameters
+=
[
'
--precision
'
,
'
single
'
]
else
:
DNS_parameters
+=
[
'
--precision
'
,
'
double
'
]
# copy parameters from source simulation
for
parameter
in
[
'
fk0
'
,
'
fk1
'
,
'
forcing_type
'
,
'
dt
'
,
'
dealias_type
'
,
'
dkx
'
,
'
dky
'
,
'
dkz
'
,
'
energy
'
,
'
famplitude
'
,
'
fmode
'
,
'
injection_rate
'
,
'
nu
'
]:
DNS_parameters
+=
[
'
--
'
+
parameter
,
'
{0}
'
.
format
(
dns_src
.
parameters
[
parameter
])]
if
DNS_type
!=
'
A
'
:
DNS_parameters
+=
[
'
--nparticles
'
,
'
{0}
'
.
format
(
nparticles
)]
...
...
@@ -136,6 +154,21 @@ def main():
type
=
str
,
dest
=
'
src_dirname
'
,
default
=
'
/draco/ptmp/clalescu/scaling
'
)
parser
.
add_argument
(
'
--src-prefix
'
,
type
=
str
,
dest
=
'
src_prefix
'
,
default
=
'
fbL
'
)
parser
.
add_argument
(
'
--src-kMeta
'
,
type
=
float
,
dest
=
'
src_kMeta
'
,
default
=
1.5
)
parser
.
add_argument
(
'
--src-iteration
'
,
type
=
int
,
dest
=
'
src_iteration
'
,
default
=
None
)
opt
=
parser
.
parse_args
(
sys
.
argv
[
1
:])
simname
,
work_dir
,
params
=
get_DNS_parameters
(
DNS_type
=
opt
.
DNS_setup
,
...
...
@@ -148,7 +181,10 @@ def main():
no_submit
=
not
opt
.
submit
,
minutes
=
opt
.
minutes
,
environment
=
opt
.
environment
,
src_dirname
=
opt
.
src_dirname
)
src_dirname
=
opt
.
src_dirname
,
src_prefix
=
opt
.
src_prefix
,
src_iteration
=
opt
.
src_iteration
,
kMeta
=
opt
.
src_kMeta
)
print
(
work_dir
+
'
/
'
+
simname
)
print
(
'
'
.
join
(
params
))
# these following 2 lines actually launch something
...
...
@@ -156,7 +192,7 @@ def main():
# parameter conflicts after the simname and work_dir have been decided
if
not
os
.
path
.
exists
(
work_dir
):
os
.
makedirs
(
work_dir
)
c
=
t
ur
tle
.
DNS
()
c
=
T
ur
TLE
.
DNS
()
c
.
launch
(
params
)
return
None
...
...
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