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
!6
Clustertools
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Clustertools
clustertools
into
master
Overview
0
Commits
25
Pipelines
0
Changes
1
Closed
Mads M. Pedersen
requested to merge
clustertools
into
master
8 years ago
Overview
0
Commits
25
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
df0c5a6f
Prev
Next
Show latest version
1 file
+
26
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
df0c5a6f
cluster_simulation updated
· df0c5a6f
Mads M. Pedersen
authored
8 years ago
wetb/hawc2/cluster_simulation.py
0 → 100755
+
26
−
0
Options
from
wetb.hawc2.simulation
import
Simulation
,
SimulationThread
,
INITIALIZING
,
ERROR
,
FINISH
from
wetb.hawc2.htc_file
import
HTCFile
from
wetb.hawc2.log_file
import
LogFile
from
wetb.hawc2
import
log_file
import
os
import
sys
import
time
from
threading
import
Timer
,
Thread
class
ClusterSimulation
(
Simulation
):
def
__init__
(
self
,
modelpath
,
htcfilename
,
hawc2exe
=
"
HAWC2MB.exe
"
):
Simulation
.
__init__
(
self
,
modelpath
,
htcfilename
,
hawc2exe
=
hawc2exe
)
self
.
simulation_id
=
[
f
for
f
in
os
.
listdir
(
'
.
'
)
if
f
.
endswith
(
'
.in
'
)][
0
][:
-
3
]
self
.
simulationThread
=
SimulationThread
(
self
,
False
)
self
.
thread
=
Thread
(
target
=
self
.
simulate
)
self
.
start
(
1
)
self
.
wait
()
print
(
self
.
simulationThread
.
res
[
1
])
sys
.
exit
(
self
.
simulationThread
.
res
[
0
])
def
update_status
(
self
,
*
args
,
**
kwargs
):
Simulation
.
update_status
(
self
,
*
args
,
**
kwargs
)
with
open
(
"
/home/mmpe/.hawc2launcher/status_%s
"
%
self
.
simulation_id
,
'
w
'
)
as
fid
:
fid
.
write
(
"
;
"
.
join
([
self
.
status
]
+
[
str
(
getattr
(
self
.
logFile
,
v
))
for
v
in
[
'
status
'
,
'
pct
'
,
'
remaining_time
'
,
'
lastline
'
]])
+
"
\n
"
)
def
show_status
(
self
):
pass
\ No newline at end of file
Loading