Skip to content

Commit

Permalink
Move DownloadPotentials way before CreateInput, directly before `…
Browse files Browse the repository at this point in the history
…ExtractCell`

Fix namedtuple constructors
  • Loading branch information
singularitti committed Nov 20, 2023
1 parent 6eee4a2 commit 83afbf6
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions src/MD/Recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,35 @@ end

function stage(::FixedCellOptimization, r::IonDynamicsRecipe)
conf = expand(r.config, FixedCellOptimization())
steps = map((ExtractCell(FixedCellOptimization()),)) do action
steps = map((
DownloadPotentials(FixedCellOptimization()),
ExtractCell(FixedCellOptimization()),
)) do action
think(action, conf)
end
steps = Iterators.Stateful(steps)
download = Job(first(iterate(steps)); name="download potentials")
extractcells = map(
thunk -> Job(thunk; name="extract cell in relax"), first(iterate(steps))
)
return (; extractcells=extractcells,)
download .→ extractcells
return (; download, extractcells)
end
function stage(::VariableCellOptimization, r::VariableCellMolecularDynamicsRecipe)
conf = expand(r.config, VariableCellOptimization())
steps = map((ExtractCell(VariableCellOptimization()),)) do action
steps = map((
DownloadPotentials(VariableCellOptimization()),
ExtractCell(VariableCellOptimization()),
)) do action
think(action, conf)
end
steps = Iterators.Stateful(steps)
download = Job(first(iterate(steps)); name="download potentials")
extractcells = map(
thunk -> Job(thunk; name="extract cell in vc-relax"), first(iterate(steps))
)
return (; extractcells=extractcells,)
download .→ extractcells
return (; download, extractcells)
end
function stage(::IonDynamics, r::IonDynamicsRecipe)
conf = expand(r.config, IonDynamics())
Expand All @@ -58,7 +68,6 @@ function stage(::IonDynamics, r::IonDynamicsRecipe)
think(action, conf)
end
steps = Iterators.Stateful(steps)
download = Job(first(iterate(steps)); name="download potentials")
makeinputs = map(
thunk -> ArgDependentJob(thunk; name="update input in MD"), first(iterate(steps))
)
Expand All @@ -75,21 +84,19 @@ function stage(::IonDynamics, r::IonDynamicsRecipe)
# )
# gatherdata = ArgDependentJob(first(iterate(steps)); name="gather E(V) data in MD")
# savedata = ArgDependentJob(first(iterate(steps)); name="save E(V) data in MD")
download .→ makeinputs .→ writeinputs .→ runcmds
makeinputs .→ writeinputs .→ runcmds
return steps = (;
download=download,
makeinputs=makeinputs,
writeinputs=writeinputs,
runcmds=runcmds,
# extractdata=extractdata,
# gatherdata=gatherdata,
# savedata=savedata,
makeinputs,
writeinputs,
runcmds,
# extractdata,
# gatherdata,
# savedata,
)
end
function stage(::VariableCellMolecularDynamics, r::VariableCellMolecularDynamicsRecipe)
conf = expand(r.config, VariableCellMolecularDynamics())
steps = map((
DownloadPotentials(VariableCellMolecularDynamics()),
CreateInput(VariableCellMolecularDynamics()),
WriteInput(VariableCellMolecularDynamics()),
RunCmd(VariableCellMolecularDynamics()),
Expand All @@ -100,7 +107,6 @@ function stage(::VariableCellMolecularDynamics, r::VariableCellMolecularDynamics
think(action, conf)
end
steps = Iterators.Stateful(steps)
download = Job(first(iterate(steps)); name="download potentials")
makeinputs = map(
thunk -> ArgDependentJob(thunk; name="update input in MD"), first(iterate(steps))
)
Expand All @@ -117,15 +123,14 @@ function stage(::VariableCellMolecularDynamics, r::VariableCellMolecularDynamics
# )
# gatherdata = ArgDependentJob(first(iterate(steps)); name="gather E(V) data in MD")
# savedata = ArgDependentJob(first(iterate(steps)); name="save E(V) data in MD")
download .→ makeinputs .→ writeinputs .→ runcmds
makeinputs .→ writeinputs .→ runcmds
return steps = (;
download=download,
makeinputs=makeinputs,
writeinputs=writeinputs,
runcmds=runcmds,
# extractdata=extractdata,
# gatherdata=gatherdata,
# savedata=savedata,
makeinputs,
writeinputs,
runcmds,
# extractdata,
# gatherdata,
# savedata,
)
end

Expand Down

0 comments on commit 83afbf6

Please sign in to comment.