Please help with the ERROR: LoadError: On worker 9

20 views
Skip to first unread message

Xin Yao

unread,
Aug 27, 2026, 10:27:19 AMAug 27
to JuliaPhylo users
Hello,
Thank you very much for the authors of the PhyloNetworks! I used the SNaQ v.1.1.2 and PhyloNetworks v1.3.1 on a HPC of Linux. The julia was installed in a conda environment. I ran the PhyloNetworks with the following codes:
"""
#!/usr/bin/env julia

# file "runSNaQ.jl". run in the shell like this in general:
# julia runSNaQ.jl hvalue nruns
# example for h=2 and default 10 runs:
# julia runSNaQ.jl 2
# or example for h=3 and 50 runs:
# julia runSNaQ.jl 3 50

h = parse(Int, ARGS[1])
nruns = parse(Int, ARGS[2])
spp_tree = ARGS[3]
cf_table = ARGS[4]

outputfile = string("net", h, "_", nruns, "runs") # example: "net2_10runs"
seed = 1234 + h # change as desired! Best to have it different for different h
@info "will run SNaQ with h=$h, # of runs=$nruns, seed=$seed, output will go to: $outputfile"

using Distributed
addprocs(nruns)
@everywhere using PhyloNetworks
#net0 = readTopology("astral_tree.tre")
net0 = readTopology(spp_tree)
using SNaQ
d_sp =  readtableCF(cf_table)
net = snaq!(net0, d_sp, hmax=h, filename=outputfile, seed=seed, runs=nruns)
"""
And ran the julia code with the codes:
"""
for HMAX in $(seq 0 9)
do
echo "number ${HMAX} is used as hmax"
echo "start of SNaQ parallel runs on $(hostname)"
# finally: launch the julia script, using Julia executable appropriate for slurm, with full paths:
julia -p10 --history-file=no -- ~/scripts/runSNaQ.jl $HMAX 10 $SPP_TREE $CF_TABLE > net${HMAX}_runs.screenlog 2>&1
echo "end of SNaQ run with ${HMAX} as hmax..."
done
"""
It should generate results of the 10 hmax. However, the results of hmax =2 and 9 were not generated. And the screenlog for these two hmax values can be found in the attachment. Could you please have a look on the error message if you have time? Thank you for your time!

Best regards,
Xin




net2_runs.screenlog
net9_runs.screenlog

Cécile Ané

unread,
Aug 28, 2026, 5:31:54 PMAug 28
to JuliaPhylo users
It looks like you are using a script that works with PhyloNetworks v0.16 or earlier.
With PhyloNetworks v1 and the separate SNaQ package, the function names have been changed.
Could you please update your script based on this example here, which works with SNaQ v1?
Cecile.

Xin Yao

unread,
Aug 30, 2026, 10:32:54 PMAug 30
to JuliaPhylo users
Hi Cecile:

Thank you very much for your reply! I updated my script based on the exmaple you shared, but got similar error. The julia script now was:
"""
#!/usr/bin/env julia

# file "runSNaQ.jl". run in the shell like this in general:
# julia runSNaQ.jl hvalue nruns
# example for h=2 and default 10 runs:
# julia runSNaQ.jl 2
# or example for h=3 and 50 runs:
# julia runSNaQ.jl 3 50

length(ARGS) > 0 ||
    error("need 1 or 2 arguments: # reticulations (h) and # runs (optional, 10 by default)")

h = parse(Int, ARGS[1])
nruns = 10
if length(ARGS) > 1

    nruns = parse(Int, ARGS[2])
end

outputfile = string("net", h, "_", nruns, "runs") # example: "net2_10runs"
seed = 1234 + h # change as desired! Best to have it different for different h
@info "will run SNaQ with h=$h, # of runs=$nruns, seed=$seed, output will go to: $outputfile"

using Distributed
addprocs(nruns)
@everywhere using SNaQ,PhyloNetworks
net0 = readnewick("../astral4_group1_pruned.tre");
using DataFrames, CSV
df_sp = CSV.read("../tableCF.txt", DataFrame; pool=false);
d_sp = readtableCF!(df_sp);

net = snaq!(net0, d_sp, hmax=h, filename=outputfile, seed=seed, runs=nruns)
"""

The bash script I used to submit the job was:
"""
#!/bin/bash
#SBATCH -J s05_snaq_cecile
#SBATCH -o %x-%j.log
#SBATCH -e %x-%j.err
#SBATCH -p vip_67
#SBATCH -N 1
#SBATCH -n 10
#SBATCH --mem=30G

source /public1/soft/modules/module.sh
module purge
module load miniforge/24.11

source ~/.bashrc
conda activate phylonet-env

SPP_TREE=/public1/home/m6l601321/ilex_backbone/captus_alignment_minsam090/phylonetworks_85spp/group1/astral4_group1_pruned.tre
CF_TABLE=/public1/home/m6l601321/ilex_backbone/captus_alignment_minsam090/phylonetworks_85spp/group1/tableCF.txt

mkdir -p Cecile_snaq_analyses
cd Cecile_snaq_analyses

## --array: to run multiple instances of this script,
##          one for each value in the array.
##          1 instance = 1 task
## -J job name
## -n number of cores (CPUs) per task


for HMAX in $(seq 0 9)
do
echo "number ${HMAX} is used as hmax"
echo "start of SNaQ parallel runs on $(hostname)"
# finally: launch the julia script, using Julia executable appropriate for slurm, with full paths:
julia -p10 --history-file=no -- ../runSNaQ_Cecile.jl $HMAX > net${HMAX}_runs.screenlog 2>&1

echo "end of SNaQ run with ${HMAX} as hmax..."
done
"""

I set the hmax ranging from 0 to 9. However, the analyses of hmax = 0, 1, 3, 4, 5, 6, 7, 8 finished successfully. The analyses of hmax = 2 and 9 were failed, which their screenlog files are attached here. Is it because the species tree didn't have any gene flow when the hmax = 2 and 9? Could you please have a look on this problem when you have time? Thanks very much for your time and help!

Best regards,
Xin


net9_runs.screenlog
net2_runs.screenlog

Cécile Ané

unread,
Aug 31, 2026, 9:16:22 AMAug 31
to JuliaPhylo users
Hi Daniel, I don't know. Perhaps someone else will.

You may try to open a github issue with a reproducible example of the error, and writing the actual text of the error in the message rather than as an attachment, to describe the problem in the message.
Cecile.

On Thursday, August 27, 2026 at 9:27:19 AM UTC-5 danie...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages