Skip to content

Commit

Permalink
fixed configuring new storables
Browse files Browse the repository at this point in the history
  • Loading branch information
louisponet committed Apr 19, 2023
1 parent d95cfe2 commit 07630db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RemoteHPC"
uuid = "c4f2a1c4-7655-40d8-82ee-c6ae0a8b7409"
authors = ["louisponet <[email protected]>"]
version = "0.3.22"
version = "0.3.23"

[deps]
BinaryTraits = "190e46ec-f771-4705-b939-984896f7be0e"
Expand Down
5 changes: 3 additions & 2 deletions src/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ function configure!(storable::T, s::Server) where {T<:Storable}
mkpath(tdir)
tf = joinpath(tdir, "storable.md")
open(tf, "w") do f
write(f, "Storable configuration. Replace default fields as desired after reading the documentation below.\nSave and close editor when finished.\n```julia\n")
write(f, "Storable configuration. Replace default fields inside the ```julia``` block as desired after reading the documentation below.\nSave and close editor when finished.\n```julia\n")
for field in configurable_fieldnames(T)
value = getfield(storable, field)
ft = typeof(value)
Expand All @@ -347,7 +347,8 @@ function configure!(storable::T, s::Server) where {T<:Storable}
while parsing_error

parsing_error = false

@info "Opening editor, press any key to continue..."
readline()
InteractiveUtils.edit(tf)
tstr = filter(!isempty, readlines(tf))
i = findfirst(x->occursin("```julia",x), tstr)
Expand Down
4 changes: 2 additions & 2 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ from the [`Server`](@ref) where it is stored.
# `configure()` Example
```julia
name::String = "default",
directives::Dict{Any, Any} = Dict{Any, Any}("time" => "24:00:00", "partition" => "standard", "account" => "s1073", "N" => 4, "ntasks-per-node" => 36, "cpus-per-taks" => 1)
directives::Dict{Any, Any} = Dict{Any, Any}("time" => "24:00:00", "partition" => "standard", "account" => "s1073", "N" => 4, "ntasks-per-node" => 36, "cpus-per-task" => 1)
exports::Dict{Any, Any} = Dict{Any, Any}("OMP_NUM_THREADS" => 1)
preamble::String = "echo hello"
postamble::String = "echo goodbye"
Expand All @@ -169,7 +169,7 @@ parallel_exec::Exec = Exec(name="srun", path="srun", flags=Dict("n" => 36))
```julia
Environment(
name = "default",
directives = Dict("time" => "24:00:00", "partition" => "standard", "account" => "s1073", "N" => 4, "ntasks-per-node" => 36, "cpus-per-taks" => 1)
directives = Dict("time" => "24:00:00", "partition" => "standard", "account" => "s1073", "N" => 4, "ntasks-per-node" => 36, "cpus-per-task" => 1)
exports = Dict("OMP_NUM_THREADS" => 1)
preamble = "echo hello"
postamble = "echo goodbye"
Expand Down

2 comments on commit 07630db

@louisponet
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/81914

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.23 -m "<description of version>" 07630db115c389d24cd122bc0f1886e0109b1ead
git push origin v0.3.23

Please sign in to comment.