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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
toolbox
WindEnergyToolbox
Merge requests
!86
replace use of dict generator and recursive glob in PBSMultiRunner
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
replace use of dict generator and recursive glob in PBSMultiRunner
more_python2_issues
into
master
Overview
0
Commits
1
Pipelines
1
Changes
2
Merged
Mads M. Pedersen
requested to merge
more_python2_issues
into
master
6 years ago
Overview
0
Commits
1
Pipelines
1
Changes
2
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
a2870b97
1 commit,
6 years ago
2 files
+
4
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
wetb/utils/cluster_tools/pbsfile.py
+
2
−
2
Options
@@ -142,7 +142,7 @@ class PBSMultiRunner(PBSFile):
# find available nodes
with
open
(
os
.
environ
[
'
PBS_NODEFILE
'
])
as
fid
:
files
=
set
([
f
.
strip
()
for
f
in
fid
.
readlines
()
if
f
.
strip
()
!=
''
])
pbs_files
=
glob
.
glob
(
'
./**/*.in
'
,
recursive
=
True
)
pbs_files
=
[
os
.
path
.
join
(
root
,
f
)
for
root
,
folders
,
f_lst
in
os
.
walk
(
'
.
'
)
for
f
in
f_lst
if
f
.
endswith
(
'
.in
'
)]
# Make a list of [(pbs_in_filename, stdout_filename, walltime),...]
pat
=
re
.
compile
(
r
'
[\s\S]*#\s*PBS\s+-o\s+(.*)[\s\S]*(\d\d:\d\d:\d\d)[\s\S]*
'
)
@@ -158,7 +158,7 @@ class PBSMultiRunner(PBSFile):
# sort wrt walltime
pbs_info_lst
=
sorted
(
pbs_info_lst
,
key
=
lambda
fow
:
tuple
(
map
(
int
,
fow
[
2
].
split
(
'
:
'
))))[::
-
1
]
# make dict {node1: pbs_info_lst1, ...} and save
d
=
{
f
:
pbs_info_lst
[
i
::
len
(
files
)]
for
i
,
f
in
enumerate
(
files
)
}
d
=
dict
([(
f
,
pbs_info_lst
[
i
::
len
(
files
)]
)
for
i
,
f
in
enumerate
(
files
)
])
with
open
(
'
pbs.dict
'
,
'
w
'
)
as
fid
:
fid
.
write
(
str
(
d
))
Loading