Lauren Huet
09/02/2024, 6:51 AMJob ID: 15064447
Cluster: setonix
User/Group:
State: OUT_OF_MEMORY (exit code 0)
Nodes: 1
Cores per node: 128
CPU Utilized: 01:28:14
CPU Efficiency: 1.78% of 3-10:35:44 core-walltime
Job Wall-clock time: 00:38:43
Memory Utilized: 601.45 GB
Memory Efficiency: 150.36% of 400.00 GB
if [[ -n /scratch/pawsey0812/lhuet ]]; then
temp=/scratch/pawsey0812/lhuet
fi
pairtools \
sort \
--nproc 32 \
--nproc 64 \
--tmpdir=/scratch/pawsey0812/lhuet \
--memory 400G \
-o OG647_v240501.hic1.pairs \
OG647_v240501.hic1.pairsam > log.txt
cat <<-END_VERSIONS > versions.yml
"OCEANGENOMES_REFGENOMES:REFGENOMES:OMNIC_HAP1:PAIRTOOLS_SORT":
pairtools: $(pairtools --version 2>&1 | tr '\n' ',' | sed 's/.*pairtools.*version //' | sed 's/,$/\n/')
END_VERSIONS
slurmstepd: error: Detected 1 oom-kill event(s) in StepId=15064447.batch. Some of your processes may have been killed by the cgroup out-of-memory handler.pontus
09/02/2024, 7:03 AMLauren Huet
09/02/2024, 7:26 AM#!/bin/bash --login
#---------------
#Requested resources:
#SBATCH --account=pawsey0812
#SBATCH --job-name=HICLCA
#SBATCH --partition=work
#SBATCH --ntasks=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=32
#SBATCH --time=15:00:00
#SBATCH --mem=64G
#SBATCH --export=ALL
#SBATCH --output=%x-%j.out
#SBATCH --error=%x-%j.err
date=$(date +%y%m%d)
echo "========================================="
echo "SLURM_JOB_ID = $SLURM_JOB_ID"
echo "SLURM_NODELIST = $SLURM_NODELIST"
echo "DATE: $date"
echo "========================================="
full_path=$(pwd)
echo "Full path: $full_path"
run_dir="$1"
echo "Run directory: $run_dir"
sample_dir="$2"
echo "Sample directory: $sample_dir"
OG="$3"
echo "Specimen ID: $OG"
# Define path to temp directory
temp="$4"
#Define Hi-C files
H1="${run_dir}/${sample_dir}/"*R1*.fastq.gz
for file in $H1; do
echo "Hi-C forward: $file"
done
H2="${run_dir}/${sample_dir}/"*R2*.fastq.gz
for file in $H2; do
echo "Hi-C reverse: $file"
done
asm="${run_dir}/${sample_dir}/"*.fasta
echo assembly: $asm
singularity run $SING/samtools_1.16.1.sif samtools faidx $asm && \
cut -f1,2 "${run_dir}/${sample_dir}/"*.fai > "${run_dir}/${sample_dir}/${OG}.genome" && \
singularity run $SING/bwa:0.7.17.sif bwa index $asm && \
singularity run $SING/bwa:0.7.17.sif bwa mem -5SP -T0 -t16 $asm $H1 $H2 -o "${run_dir}/${sample_dir}/${OG}.aligned.sam" && \
singularity run $SING/pairtools:1.1.0.sif pairtools parse --min-mapq 40 --walks-policy 5unique --max-inter-align-gap 30 --nproc-in 16 --nproc-out 16 --chroms-path "${run_dir}/${sample_dir}/${OG}.genome" "${run_dir}/${sample_dir}/${OG}.aligned.sam" > "${run_dir}/${sample_dir}/${OG}.parsed.pairsam" && \
singularity run $SING/pairtools:1.1.0.sif pairtools sort --tmpdir=$temp --nproc 16 "${run_dir}/${sample_dir}/${OG}.parsed.pairsam" > "${run_dir}/${sample_dir}/${OG}.sorted.parisam" && \
singularity run $SING/pairtools:1.1.0.sif pairtools dedup --nproc-in 16 --nproc-out 16 --mark-dups --output-stats "${run_dir}/${sample_dir}/${OG}.stats.txt" --output "${run_dir}/${sample_dir}/${OG}.dedup.pairsam" "${run_dir}/${sample_dir}/${OG}.sorted.pairsam" && \
singularity run $SING/pairtools:1.1.0.sif pairtools split --nproc-in 16 --nproc-out 16 --output-pairs "${run_dir}/${sample_dir}/${OG}.mapped.pairs" --output-sam "${run_dir}/${sample_dir}/${OG}.unsorted.bam" "${run_dir}/${sample_dir}/${OG}.dedup.pairsam" && \
singularity run $SING/samtools_1.16.1.sif samtools sort -@16 -T $temp.bam -o "${run_dir}/${sample_dir}/${OG}.mapped.PT.bam" "${run_dir}/${sample_dir}/${OG}.unsorted.bam" && \
singularity run $SING/samtools_1.16.1.sif samtools index "${run_dir}/${sample_dir}/${OG}.mapped.PT.bam"
wait
singularity run $SING/pairtools:1.1.0.sif python3 get_qc.py -p "${run_dir}/${sample_dir}/${OG}.stats.txt" && \
singularity run $SING/preseq:2.0.2.sif preseq lc_extrap -bam -pe -extrap 2.1e9 -step 1e8 -seg_len 1000000000 -output "${run_dir}/${sample_dir}/${OG}.out.preseq" "${run_dir}/${sample_dir}/${OG}.mapped.PT.bam"
in nf-core i have created a sub workflow for this so each is its own process.
for the pairtools sort on that last run i had allocated the following resources after some failures at 64GB of memory
withName:PAIRTOOLS_SORT {
queue = 'highmem'
cpus = { 64 }
memory = { 400.GB }
time = { 14.h }
withName: 'PAIRTOOLS_SORT' {
ext.args = { '--nproc 32' }
publishDir = [
path: { "${params.outdir}/${meta.sample}/04-scaffolding/omnic" }
]
}Lauren Huet
09/02/2024, 7:28 AMpontus
09/02/2024, 8:57 AM--memory should be removed), but as a first suggestion, I'd try not scaling both the number of parallel processes and memory.Lauren Huet
09/03/2024, 7:38 AMSimon Pearce
09/03/2024, 11:00 AMdef buffer = task.memory.toGiga().intdiv(2)
"""
--nproc $task.cpus \\
--memory ${buffer}G \\
so you don't need to specify nproc through in the ext.args.Lauren Huet
09/06/2024, 3:37 AMpontus
09/06/2024, 5:41 AMSIGTERM for out of memory, but it's not impossible that's sent first and handled or that there's some manual watchdog in their setup, killing processes nicely.Simon Pearce
09/06/2024, 8:04 AM