Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpc-workflow-manager
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
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
FIJI
hpc-workflow-manager
Commits
1928b9d7
Commit
1928b9d7
authored
7 years ago
by
Petr Bainar
Browse files
Options
Downloads
Patches
Plain Diff
iss1011: implementing id resolving
parent
614a0215
No related branches found
No related tags found
1 merge request
!5
Iss1011
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/TaskComputation.java
+36
-22
36 additions, 22 deletions
...z/it4i/fiji/haas_spim_benchmark/core/TaskComputation.java
with
36 additions
and
22 deletions
haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/TaskComputation.java
+
36
−
22
View file @
1928b9d7
...
...
@@ -2,6 +2,7 @@ package cz.it4i.fiji.haas_spim_benchmark.core;
import
java.util.Collection
;
import
java.util.LinkedList
;
import
java.util.Scanner
;
import
cz.it4i.fiji.haas_java_client.JobState
;
...
...
@@ -10,10 +11,11 @@ public class TaskComputation {
private
final
SPIMComputationAccessor
outputHolder
;
private
final
Task
task
;
private
final
int
timepoint
;
private
final
Long
id
;
private
Long
id
;
//TASK 1011 what states will be defined and how it will be defined
private
JobState
state
=
JobState
.
Unknown
;
private
Collection
<
String
>
logs
=
new
LinkedList
<>();
private
Collection
<
String
>
outputs
=
new
LinkedList
<>();
private
Collection
<
String
>
inputs
=
new
LinkedList
<>();
...
...
@@ -23,6 +25,7 @@ public class TaskComputation {
this
.
outputHolder
=
outputHolder
;
this
.
task
=
task
;
this
.
timepoint
=
timepoint
;
this
.
id
=
resolveId
();
}
public
JobState
getState
()
{
...
...
@@ -31,39 +34,50 @@ public class TaskComputation {
}
private
void
updateState
()
{
String
snakeOutput
=
outputHolder
.
getActualOutput
();
Long
id
=
getId
();
if
(
id
==
null
)
{
//TASK 1011 This should never happen, add some error handling to resolveId()
if
(
id
==
null
)
{
return
;
}
String
snakeOutput
=
outputHolder
.
getActualOutput
();
//TASK 1011
//resolve if job is queued (defined id), started (exists log file), finished (in log is Finished job 10.) or
//or failed (some error in log)
}
private
Long
getId
()
{
if
(
id
==
null
)
{
fillId
();
}
return
id
;
}
private
void
fillId
()
{
//TASK 1011
//find timepoint-th occurence of
//rule resave_hdf5:
// input: HisRFP_test-01-00.h5_xml, HisRFP_test_first.xml
// output: HisRFP_test-01-00.h5, HisRFP_test-01-00.h5_hdf5
// log: logs/b2_resave_hdf5-01.log
// jobid: 7
// wildcards: xml_base=HisRFP_test, file_id=01
private
Long
resolveId
()
{
final
String
OUTPUT_PARSING_RULE
=
"rule "
;
final
String
OUTPUT_PARSING_JOB_ID
=
"jobid: "
;
final
String
OUTPUT_PARSING_COLON
=
":"
;
final
String
desiredPattern
=
OUTPUT_PARSING_RULE
+
task
.
getDescription
()
+
OUTPUT_PARSING_COLON
;
Scanner
scanner
=
new
Scanner
(
outputHolder
.
getActualOutput
());
int
jobsToSkip
=
timepoint
-
1
;
do
{
if
(
scanner
.
nextLine
().
equals
(
desiredPattern
))
{
jobsToSkip
--;
}
}
while
(
jobsToSkip
>=
0
&&
scanner
.
hasNextLine
());
String
currentLine
;
Long
resolvedId
=
null
;
while
(
scanner
.
hasNextLine
())
{
currentLine
=
scanner
.
nextLine
();
if
(!
currentLine
.
contains
(
OUTPUT_PARSING_JOB_ID
))
{
continue
;
}
resolvedId
=
Long
.
parseLong
(
currentLine
.
split
(
OUTPUT_PARSING_JOB_ID
)[
1
]);
break
;
}
scanner
.
close
();
//resave_hdf5 == task.getDescription()
//jobid -> id
//input->inputs
//...
//
//or return
return
resolvedId
;
}
}
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