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
cfc81c10
Commit
cfc81c10
authored
9 years ago
by
Chichi Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
multiple job call works on pc again
parent
7cbf23e9
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
bfps/code.py
+5
-3
5 additions, 3 deletions
bfps/code.py
test.py
+54
-5
54 additions, 5 deletions
test.py
with
59 additions
and
8 deletions
bfps/code.py
+
5
−
3
View file @
cfc81c10
...
...
@@ -174,9 +174,11 @@ class code(base):
elif
self
.
host_info
[
'
type
'
]
==
'
pc
'
:
os
.
chdir
(
self
.
work_dir
)
os
.
environ
[
'
LD_LIBRARY_PATH
'
]
+=
'
:{0}
'
.
format
(
bfps
.
lib_dir
)
subprocess
.
call
(
command_atoms
,
stdout
=
open
(
out_file
+
'
_
'
+
self
.
simname
,
'
w
'
),
stderr
=
open
(
err_file
+
'
_
'
+
self
.
simname
,
'
w
'
))
for
j
in
range
(
njobs
):
command_atoms
[
-
1
]
=
'
{0}
'
.
format
(
iter0
+
j
*
self
.
parameters
[
'
niter_todo
'
])
subprocess
.
call
(
command_atoms
,
stdout
=
open
(
out_file
+
'
_
'
+
self
.
simname
,
'
w
'
),
stderr
=
open
(
err_file
+
'
_
'
+
self
.
simname
,
'
w
'
))
os
.
chdir
(
current_dir
)
return
None
def
write_sge_file
(
...
...
This diff is collapsed.
Click to expand it.
test.py
+
54
−
5
View file @
cfc81c10
...
...
@@ -350,7 +350,7 @@ def convergence_test(opt):
(
2
*
np
.
pi
/
c
.
parameters
[
'
nx
'
])),
dashes
=
c
.
style
[
'
dashes
'
])
a
.
set_title
(
'
$
\\
frac{
\\
Delta t
\\
| u
\\
|_\infty}{
\\
Delta x}$
'
)
fig
.
savefig
(
'
stats.pdf
'
,
format
=
'
pdf
'
)
fig
.
savefig
(
'
convergence_
stats.pdf
'
,
format
=
'
pdf
'
)
## particle test:
# compute distance between final positions for species 1
def
get_traj_error
(
species
):
...
...
@@ -383,6 +383,58 @@ def convergence_test(opt):
fig
.
savefig
(
'
traj_N{0:0>3x}.pdf
'
.
format
(
c
.
parameters
[
'
nx
'
],
format
=
'
pdf
'
))
return
None
def
plain
(
opt
):
wd
=
opt
.
work_dir
opt
.
work_dir
=
wd
+
'
/N{0:0>3x}_1
'
.
format
(
opt
.
n
)
c0
=
NSlaunch
(
opt
)
c0
.
compute_statistics
()
opt
.
work_dir
=
wd
+
'
/N{0:0>3x}_2
'
.
format
(
opt
.
n
)
opt
.
njobs
*=
2
opt
.
nsteps
/=
2
c1
=
NSlaunch
(
opt
)
c1
.
compute_statistics
()
# plot energy and enstrophy
fig
=
plt
.
figure
(
figsize
=
(
12
,
12
))
a
=
fig
.
add_subplot
(
221
)
c0
.
set_plt_style
({
'
label
'
:
'
1
'
,
'
dashes
'
:
(
None
,
None
),
'
color
'
:
(
1
,
0
,
0
)})
c1
.
set_plt_style
({
'
label
'
:
'
2
'
,
'
dashes
'
:
(
2
,
2
),
'
color
'
:
(
0
,
0
,
1
)})
for
c
in
[
c0
,
c1
]:
a
.
plot
(
c
.
statistics
[
'
t
'
],
c
.
statistics
[
'
energy(t)
'
],
label
=
c
.
style
[
'
label
'
],
dashes
=
c
.
style
[
'
dashes
'
],
color
=
c
.
style
[
'
color
'
])
a
.
set_title
(
'
energy
'
)
a
.
legend
(
loc
=
'
best
'
)
a
=
fig
.
add_subplot
(
222
)
for
c
in
[
c0
,
c1
]:
a
.
plot
(
c
.
statistics
[
'
t
'
],
c
.
statistics
[
'
enstrophy(t)
'
],
dashes
=
c
.
style
[
'
dashes
'
],
color
=
c
.
style
[
'
color
'
])
a
.
set_title
(
'
enstrophy
'
)
a
=
fig
.
add_subplot
(
223
)
for
c
in
[
c0
,
c1
]:
a
.
plot
(
c
.
statistics
[
'
t
'
],
c
.
statistics
[
'
kM
'
]
*
c
.
statistics
[
'
etaK(t)
'
],
dashes
=
c
.
style
[
'
dashes
'
],
color
=
c
.
style
[
'
color
'
])
a
.
set_title
(
'
$k_M
\\
eta_K$
'
)
a
=
fig
.
add_subplot
(
224
)
for
c
in
[
c0
,
c1
]:
a
.
plot
(
c
.
statistics
[
'
t
'
],
c
.
statistics
[
'
vel_max(t)
'
]
*
(
c
.
parameters
[
'
dt
'
]
*
c
.
parameters
[
'
dkx
'
]
/
(
2
*
np
.
pi
/
c
.
parameters
[
'
nx
'
])),
dashes
=
c
.
style
[
'
dashes
'
],
color
=
c
.
style
[
'
color
'
])
a
.
set_title
(
'
$
\\
frac{
\\
Delta t
\\
| u
\\
|_\infty}{
\\
Delta x}$
'
)
fig
.
savefig
(
'
plain_stats.pdf
'
,
format
=
'
pdf
'
)
return
None
if
__name__
==
'
__main__
'
:
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'
--particles
'
,
dest
=
'
particles
'
,
action
=
'
store_true
'
)
...
...
@@ -402,10 +454,7 @@ if __name__ == '__main__':
if
opt
.
convergence
:
convergence_test
(
opt
)
if
opt
.
plain
:
opt
.
work_dir
+=
'
/N{0:0>3x}
'
.
format
(
opt
.
n
)
c0
=
NSlaunch
(
opt
)
c0
.
compute_statistics
()
c0
.
basic_plots
()
plain
(
opt
)
if
opt
.
io
:
c
=
bfps
.
test_io
(
work_dir
=
opt
.
work_dir
+
'
/test_io
'
)
c
.
write_src
()
...
...
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