Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WindEnergyToolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
wtlib
WindEnergyToolbox
Commits
7c28969f
Commit
7c28969f
authored
7 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
prepost.dlctemplate/simchunks: remove redundant keyword, explicitly
refer to python environment on cluster
parent
f0fd071a
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
wetb/prepost/dlctemplate.py
+4
-4
4 additions, 4 deletions
wetb/prepost/dlctemplate.py
wetb/prepost/simchunks.py
+8
-5
8 additions, 5 deletions
wetb/prepost/simchunks.py
with
12 additions
and
9 deletions
wetb/prepost/dlctemplate.py
+
4
−
4
View file @
7c28969f
...
@@ -338,11 +338,11 @@ def launch_dlcs_excel(sim_id, silent=False, verbose=False, pbs_turb=False,
...
@@ -338,11 +338,11 @@ def launch_dlcs_excel(sim_id, silent=False, verbose=False, pbs_turb=False,
# respective nodes. It is not walltime per case.
# respective nodes. It is not walltime per case.
sorts_on
=
[
'
[DLC]
'
,
'
[Windspeed]
'
]
sorts_on
=
[
'
[DLC]
'
,
'
[Windspeed]
'
]
create_chunks_htc_pbs
(
cases
,
sort_by_values
=
sorts_on
,
ppn
=
20
,
create_chunks_htc_pbs
(
cases
,
sort_by_values
=
sorts_on
,
ppn
=
20
,
nr_procs_series
=
9
,
processes
=
1
,
nr_procs_series
=
9
,
walltime
=
'
20:00:00
'
,
walltime
=
'
20:00:00
'
,
chunks_dir
=
'
zip-chunks-jess
'
)
chunks_dir
=
'
zip-chunks-jess
'
)
create_chunks_htc_pbs
(
cases
,
sort_by_values
=
sorts_on
,
ppn
=
12
,
create_chunks_htc_pbs
(
cases
,
sort_by_values
=
sorts_on
,
ppn
=
12
,
nr_procs_series
=
15
,
processes
=
1
,
nr_procs_series
=
15
,
walltime
=
'
20:00:00
'
,
walltime
=
'
20:00:00
'
,
chunks_dir
=
'
zip-chunks-gorm
'
)
chunks_dir
=
'
zip-chunks-gorm
'
)
df
=
sim
.
Cases
(
cases
).
cases2df
()
df
=
sim
.
Cases
(
cases
).
cases2df
()
df
.
to_excel
(
os
.
path
.
join
(
POST_DIR
,
sim_id
+
'
.xls
'
))
df
.
to_excel
(
os
.
path
.
join
(
POST_DIR
,
sim_id
+
'
.xls
'
))
...
...
This diff is collapsed.
Click to expand it.
wetb/prepost/simchunks.py
+
8
−
5
View file @
7c28969f
...
@@ -32,10 +32,9 @@ import pandas as pd
...
@@ -32,10 +32,9 @@ import pandas as pd
from
wetb.prepost.Simulations
import
Cases
from
wetb.prepost.Simulations
import
Cases
def
create_chunks_htc_pbs
(
cases
,
sort_by_values
=
[
'
[Windspeed]
'
],
ppn
=
20
,
def
create_chunks_htc_pbs
(
cases
,
sort_by_values
=
[
'
[Windspeed]
'
],
ppn
=
20
,
i0
=
0
,
nr_procs_series
=
9
,
processes
=
1
,
queue
=
'
workq
'
,
nr_procs_series
=
9
,
queue
=
'
workq
'
,
pyenv
=
'
wetb_py3
'
,
walltime
=
'
24:00:00
'
,
chunks_dir
=
'
zip-chunks-jess
'
,
walltime
=
'
24:00:00
'
,
chunks_dir
=
'
zip-chunks-jess
'
):
pyenv
=
'
wetb_py3
'
,
i0
=
0
):
"""
Group a large number of simulations htc and pbs launch scripts into
"""
Group a large number of simulations htc and pbs launch scripts into
different zip files so we can run them with find+xargs on various nodes.
different zip files so we can run them with find+xargs on various nodes.
"""
"""
...
@@ -187,7 +186,7 @@ def create_chunks_htc_pbs(cases, sort_by_values=['[Windspeed]'], ppn=20,
...
@@ -187,7 +186,7 @@ def create_chunks_htc_pbs(cases, sort_by_values=['[Windspeed]'], ppn=20,
# =====================================================================
# =====================================================================
# activate the python environment
# activate the python environment
pbs
+=
'
echo
"
activate python environment %s
"
\n
'
%
pyenv
pbs
+=
'
echo
"
activate python environment %s
"
\n
'
%
pyenv
pbs
+=
'
source activate %s
\n
'
%
pyenv
pbs
+=
'
source
/home/python/miniconda3/bin/
activate %s
\n
'
%
pyenv
# sometimes activating an environment fails due to a FileExistsError
# sometimes activating an environment fails due to a FileExistsError
# is this because it is activated at the same time on another node?
# is this because it is activated at the same time on another node?
# check twice if the environment got activated for real
# check twice if the environment got activated for real
...
@@ -396,6 +395,10 @@ def create_chunks_htc_pbs(cases, sort_by_values=['[Windspeed]'], ppn=20,
...
@@ -396,6 +395,10 @@ def create_chunks_htc_pbs(cases, sort_by_values=['[Windspeed]'], ppn=20,
except
(
FileExistsError
,
OSError
):
except
(
FileExistsError
,
OSError
):
pass
pass
fpath
=
os
.
path
.
join
(
df
[
'
[run_dir]
'
].
iloc
[
0
],
'
pbs_out_chunks
'
)
if
not
os
.
path
.
exists
(
fpath
):
os
.
makedirs
(
fpath
)
df_iter
=
chunker
(
df
,
nr_procs_series
*
ppn
)
df_iter
=
chunker
(
df
,
nr_procs_series
*
ppn
)
sim_id
=
df
[
'
[sim_id]
'
].
iloc
[
0
]
sim_id
=
df
[
'
[sim_id]
'
].
iloc
[
0
]
run_dir
=
df
[
'
[run_dir]
'
].
iloc
[
0
]
run_dir
=
df
[
'
[run_dir]
'
].
iloc
[
0
]
...
...
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