nextflow-io / nextflow

A DSL for data-driven computational pipelines
http://nextflow.io
Apache License 2.0
2.75k stars 628 forks source link

Differences between `shell` and `script` #5199

Open BioFalcon opened 3 months ago

BioFalcon commented 3 months ago

Bug report

Expected behavior and actual behavior

Hi, i'm running a script that maybe is too long for debugging but chose to go for a shell+template approach instead of using script on the process since sequera cloud complains about the script being too large. However, I noticed that some of my processes ran out of memory but didn't die, the script kept going instead of going to retry. The step where it runs out of memory is a single mafft command:

mafft \
            --genafpair \
            --maxiterate 1000 \
            --thread !{task.cpus} \
            --add ./Round_${CurrRound}/04_CurrentConsensi.${LowerCase}.Round${CurrRound}.Extended.fa \
            ./Round_${PrevRound}/06_CurrentConsensi.${LowerCase}.Round${PrevRound}.Extended.Curated.aln.fa \
            > ./Round_${CurrRound}/05_CurrentConsensi.${LowerCase}.Round${CurrRound}.Extended.aln \
            2> ./Round_${CurrRound}/05_CurrentConsensi.${LowerCase}.Round${CurrRound}.Extended.MAFFTlog

When I translated the same script so that it could run in the script directive, process runs out of memory and dies accordingly.

I really like better the shell+template approach. Any idea how to fix this?

Steps to reproduce the problem

(Provide a test case that reproduce the problem either with a self-contained script or GitHub repository)

Program output

(Copy and paste here output produced by the failing execution. Please highlight it as a code block. Whenever possible upload the .nextflow.log file.)

Environment

BioFalcon commented 3 months ago

I can provide the files to make it run in this step if needed :)

bentsherman commented 2 months ago

I'm not sure what you mean when you say that the process ran out of memory but didn't die. Then what did it do?

BioFalcon commented 2 months ago

It kept executing the next commands, as if it didn't output a non zero exit code

bentsherman commented 2 months ago

Sounds very strange. Why don't you include the log file, maybe then I will understand better