Skip to content

Commit

Permalink
Fix workflow functionality, restructuring pending
Browse files Browse the repository at this point in the history
  • Loading branch information
zieglerSe committed Oct 23, 2023
1 parent 3080b67 commit 35a5dd3
Showing 1 changed file with 7 additions and 29 deletions.
36 changes: 7 additions & 29 deletions src/Slurmi/Workflow.fs
Original file line number Diff line number Diff line change
@@ -1,36 +1,12 @@
namespace Slurmi

open DynamicObj
open System.Runtime.InteropServices
open Fli
open Graphoscope
open System.Collections.Generic

module Workflow =
//type Workflow (jobs:Job array)=

// inherit DynamicObj()

// member val Jobs = jobs with get, set
// /// Wall clock time limit.
// static member SetTime
// ([<Optional; DefaultParameterValue(null)>]?Time:(int*int*int*int)) =
// (fun (wf: Workflow) ->
// Time |> DynObj.setValueOpt wf "time"
// wf
// )

// static member tryGetTime (wf: Workflow) =
// wf.TryGetValue "time"

// static member SetPartition
// ([<Optional; DefaultParameterValue(null)>]?Partition:string) =
// (fun (wf: Workflow) ->
// Partition |> DynObj.setValueOpt wf "partition"
// wf
// )

// static member tryGetPartition (wf: Workflow) =
// wf.TryGetValue "partition"

let callToTerminalCMD (command:string) =
let processResponse =
Expand Down Expand Up @@ -81,6 +57,7 @@ module Workflow =
|> List.iter (
fun jobWithDep ->
//FGraph.addElement jobWithDep.JobInfo.Name jobWithDep.DependingOn jobWithDep.DependingOn |> ignore
jobWithDep.JobInfo.OnlyKey |> OnlyKey.SetParsable true |> ignore
jobWithDep.DependingOn
|> List.iter (fun (job,dep) -> FGraph.addElement job.Name (input|> List.find (fun x -> x.JobInfo.Name = job.Name)) jobWithDep.JobInfo.Name jobWithDep dep g |> ignore))

Expand Down Expand Up @@ -171,10 +148,11 @@ module Workflow =
then printfn "already worked on %A "jobToLook
else
printfn "added %A" jobToLook
formatDep graph jobToLook
sendToTerminalAndReceiveJobID (getJob graph jobToLook)
// let jtwo = getJob graph jobToLook
let jtwo = getJob graph jobToLook

formatDep graph jobToLook
jtwo.JobInfo |> Job.SetJobID (getResultFromCallBASH (jtwo.JobInfo.produceCall)) |> ignore

workedOn.Add jobToLook
else
printfn "false"
Expand Down Expand Up @@ -214,4 +192,4 @@ module Workflow =
let firstNodes =
getNodesWithoutDependencies graph
|> Seq.toArray
firstNodes |> Array.map (fun x -> checkAllForWorked graph x.JobInfo.Name workedOn) |> ignore
firstNodes |> Array.map (fun x -> checkAllForWorked graph x.JobInfo.Name workedOn) |> ignore

0 comments on commit 35a5dd3

Please sign in to comment.