kleinhenz / SlurmClusterManager.jl

julia package for running code on slurm clusters
46 stars 5 forks source link

out from workers not show in real time #10

Open Lightup1 opened 1 year ago

Lightup1 commented 1 year ago

Even when I add flush(stdout) after all printlns executed by workers. Ther slurm-xxx.out still does not show the output in real time.

Lightup1 commented 1 year ago

One can try some thing like

using Distributed, SlurmClusterManager
addprocs(SlurmManager(),exeflags=["--project=.", "-t$(ENV["SLURM_CPUS_PER_TASK"])", "--color=yes", "--startup-file=no"])

@everywhere function sleep_println(s)
    sleep(10)
    println("hello world")
    flush(stdout)
end
pmap(sleep_println,1:parse(Int64,ENV["SLURM_NTASKS"]))