Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUALIMAP_RNASEQ error simultaneous access on same dir #1298

Open
redvoidling opened this issue May 9, 2024 · 10 comments
Open

QUALIMAP_RNASEQ error simultaneous access on same dir #1298

redvoidling opened this issue May 9, 2024 · 10 comments
Labels
question Further information is requested
Milestone

Comments

@redvoidling
Copy link

Description of the bug

The problem seems to be that more than one process tries to access the same tmp dir:

[0.206s][warning][perf,memops] Cannot use file /tmp/hsperfdata_mh281129/75 because it is locked by another process (errno = 11)

Command used and terminal output

executor >  local (14)
[00/432011] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1, cached: 1 ✔
[d8/3036ea] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1, cached: 1 ✔
[78/7597ac] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1, cached: 1 ✔
[53/d56da7] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1, cached: 1 ✔
[77/372ac0] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1, cached: 1 ✔
[21/f13c90] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1, cached: 1 ✔
[63/e937c7] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1, cached: 1 ✔
[-        ] process > NFCORE_RNASEQ:RNASEQ:CAT_FASTQ -
[93/ac4e18] process > NFCORE_RNASEQ:RNASEQ:FASTQ_... [100%] 7 of 7, cached: 7 ✔
[f2/577bf4] process > NFCORE_RNASEQ:RNASEQ:FASTQ_... [100%] 7 of 7, cached: 7 ✔
[e4/19149a] process > NFCORE_RNASEQ:RNASEQ:FASTQ_... [100%] 1 of 1, cached: 1 ✔
[ca/6bb9d4] process > NFCORE_RNASEQ:RNASEQ:FASTQ_... [100%] 7 of 7, cached: 7 ✔
[19/072cbd] process > NFCORE_RNASEQ:RNASEQ:FASTQ_... [100%] 7 of 7, cached: 7 ✔
[42/6e256f] process > NFCORE_RNASEQ:RNASEQ:ALIGN_... [100%] 7 of 7, cached: 7 ✔
[1e/2625f7] process > NFCORE_RNASEQ:RNASEQ:ALIGN_... [100%] 7 of 7, cached: 7 ✔
[64/ef104d] process > NFCORE_RNASEQ:RNASEQ:ALIGN_... [100%] 7 of 7, cached: 7 ✔
[45/280d7b] process > NFCORE_RNASEQ:RNASEQ:ALIGN_... [100%] 7 of 7, cached: 7 ✔
[c8/3bd2df] process > NFCORE_RNASEQ:RNASEQ:ALIGN_... [100%] 7 of 7, cached: 7 ✔
[ca/b99dda] process > NFCORE_RNASEQ:RNASEQ:ALIGN_... [100%] 7 of 7, cached: 7 ✔
[3d/876e68] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [100%] 7 of 7, cached: 7 ✔
[23/4baf67] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [100%] 1 of 1, cached: 1 ✔
[bf/2f42c7] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [100%] 1 of 1, cached: 1 ✔
[-        ] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [  0%] 0 of 1
[-        ] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [  0%] 0 of 1
[-        ] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [  0%] 0 of 1
[-        ] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [  0%] 0 of 1
[-        ] process > NFCORE_RNASEQ:RNASEQ:DESEQ2... [  0%] 0 of 1
[a1/d38592] process > NFCORE_RNASEQ:RNASEQ:BAM_MA... [100%] 7 of 7, cached: 7 ✔
[1f/2cb4dc] process > NFCORE_RNASEQ:RNASEQ:BAM_MA... [100%] 7 of 7, cached: 7 ✔
[53/7a50ec] process > NFCORE_RNASEQ:RNASEQ:BAM_MA... [100%] 7 of 7, cached: 7 ✔
[89/a4990d] process > NFCORE_RNASEQ:RNASEQ:BAM_MA... [100%] 7 of 7, cached: 7 ✔
[f7/20aacb] process > NFCORE_RNASEQ:RNASEQ:BAM_MA... [100%] 7 of 7, cached: 7 ✔
[c3/f07d29] process > NFCORE_RNASEQ:RNASEQ:STRING... [ 71%] 5 of 7, cached: 3
[a8/4b9039] process > NFCORE_RNASEQ:RNASEQ:SUBREA... [ 57%] 4 of 7, cached: 4
[88/752365] process > NFCORE_RNASEQ:RNASEQ:MULTIQ... [ 75%] 3 of 4, cached: 3
[dd/23b174] process > NFCORE_RNASEQ:RNASEQ:BEDTOO... [ 57%] 4 of 7, cached: 4
[0b/c8a5cc] process > NFCORE_RNASEQ:RNASEQ:BEDGRA... [ 75%] 3 of 4, cached: 2
[0a/f71366] process > NFCORE_RNASEQ:RNASEQ:BEDGRA... [ 66%] 2 of 3, cached: 2
[c9/2b24b0] process > NFCORE_RNASEQ:RNASEQ:BEDGRA... [ 75%] 3 of 4, cached: 2
[a4/dd57fb] process > NFCORE_RNASEQ:RNASEQ:BEDGRA... [ 66%] 2 of 3, cached: 2
[36/7ea983] process > NFCORE_RNASEQ:RNASEQ:QUALIM... [ 57%] 4 of 7, cached: 1...
[59/4e3b64] process > NFCORE_RNASEQ:RNASEQ:DUPRAD... [100%] 7 of 7, cached: 7 ✔
[9c/0ae624] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 42%] 3 of 7, cached: 2
[51/5b153e] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 42%] 3 of 7, cached: 2
[80/a94df0] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 42%] 3 of 7, cached: 2
[b1/97c564] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 42%] 3 of 7, cached: 2
[63/01cca6] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 42%] 3 of 7, cached: 2
[28/19ccbf] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 42%] 3 of 7, cached: 2
[44/f140a1] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 42%] 3 of 7, cached: 2
[-        ] process > NFCORE_RNASEQ:RNASEQ:CUSTOM... -
[-        ] process > NFCORE_RNASEQ:RNASEQ:MULTIQC   -
-[nf-core/rnaseq] Pipeline completed with errors-
ERROR ~ Error executing process > 'NFCORE_RNASEQ:RNASEQ:QUALIMAP_RNASEQ (ASD_14)'

Caused by:
  Process exceeded running time limit (8h)

Command executed:

  unset DISPLAY
  mkdir -p tmp
  export _JAVA_OPTIONS=-Djava.io.tmpdir=./tmp
  qualimap \
      --java-mem-size=29491M \
      rnaseq \
       \
      -bam ASD_14.markdup.sorted.bam \
      -gtf Callithrix_jacchus.mCalJac1.pat.X.dna.primary_assembly.filtered.gtf \
      -p strand-specific-reverse \
      -pe \
      -outdir ASD_14
  
  cat <<-END_VERSIONS > versions.yml
  "NFCORE_RNASEQ:RNASEQ:QUALIMAP_RNASEQ":
      qualimap: $(echo $(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*$//')
  END_VERSIONS

Command exit status:
  -

Command output:
  Java memory size is set to 29491M
  Launching application...
  
  [0.206s][warning][perf,memops] Cannot use file /tmp/hsperfdata_mh281129/75 because it is locked by another process (errno = 11)
  QualiMap v.2.3
  Built on 2023-05-19 16:57
  
  Selected tool: rnaseq
  Initializing regions from Callithrix_jacchus.mCalJac1.pat.X.dna.primary_assembly.filtered.gtf...
  
  Initialized 100000 regions...
  Initialized 200000 regions...
  Initialized 300000 regions...
  Initialized 400000 regions...
  Initialized 500000 regions...
  Initialized 600000 regions...
  Initialized 700000 regions...
  Initialized 800000 regions...
  Initialized 900000 regions...
  Initialized 1000000 regions...
  Initialized 1100000 regions...
  Initialized 1200000 regions...
  Initialized 1300000 regions...
  Initialized 1400000 regions...
  
  Initialized 1406694 regions it total
  
  Starting constructing transcripts for RNA-seq stats...
  Finished constructing transcripts
  
  Starting BAM file analysis
  
  Sorting BAM file by name...
  
  Read 10000000 records.
  Read 20000000 records.
  Read 30000000 records.
  Read 40000000 records.
  Read 50000000 records.
  Read 60000000 records.
  Read 70000000 records.
  Read 80000000 records.
  Read 90000000 records.
  Read 100000000 records.
  Read 110000000 records.
  Read 120000000 records.
  Read 130000000 records.
  Read 140000000 records.
  Read 150000000 records.
  Finished reading inputs, merging and writing to output now.

Command error:
  Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=./tmp

Relevant files

No response

System information

Nextflow: version 23.10.1 build 5891
HPC
slurm
LINUX, ROCKY 8.9
Container engine: Apptainer
rnaseq: 3.14.0

@redvoidling redvoidling added the bug Something isn't working label May 9, 2024
@drpatelh drpatelh added question Further information is requested and removed bug Something isn't working labels May 13, 2024
@drpatelh drpatelh added this to the 3.15.0 milestone May 13, 2024
@redvoidling
Copy link
Author

redvoidling commented May 15, 2024

I think there is progress if I restart the process over and over again. But that takes days to complete for a set of samples. Can anyone tell me what is the actual problem here?

@pinin4fjords
Copy link
Member

@redvoidling I think I can see a possible solution here.

In your local copy of the rnaseq workflow, could you try a fix for me?

In modules/nf-core/qualimap/rnaseq/main.nf, change:

export _JAVA_OPTIONS="-Djava.io.tmpdir=./tmp"

to:

export _JAVA_OPTIONS="-Djava.io.tmpdir=./tmp -XX:-UsePerfData"

If that does the trick I'll PR the fix in the usual way.

@redvoidling
Copy link
Author

Thank you! I will restart and get back to you on that.

Another thought of mine would be to just run the Qualimap process in a loop but I do not think there is a feature to just execute a subprocess with the usual nextflow commands.

@pinin4fjords
Copy link
Member

Thank you! I will restart and get back to you on that.

Another thought of mine would be to just run the Qualimap process in a loop but I do not think there is a feature to just execute a subprocess with the usual nextflow commands.

I'm not sure what you mean. You could limit the number of parallel qualimap tasks with maxForks, which might work, but we should fix it 'properly'.

@redvoidling
Copy link
Author

executor >  local (167)
[00/432011] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1 ✔
[d8/3036ea] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1 ✔
[6a/d8c007] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1 ✔
[dd/9efb26] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1 ✔
[56/ac74d8] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1 ✔
[81/57ccab] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1 ✔
[5f/a60907] process > NFCORE_RNASEQ:RNASEQ:PREPAR... [100%] 1 of 1 ✔
[-        ] process > NFCORE_RNASEQ:RNASEQ:CAT_FASTQ -
[90/a334ed] process > NFCORE_RNASEQ:RNASEQ:FASTQ_... [100%] 7 of 7, cached: 1 ✔
[a1/190bdc] process > NFCORE_RNASEQ:RNASEQ:FASTQ_... [100%] 7 of 7, cached: 2 ✔
[ac/7f790b] process > NFCORE_RNASEQ:RNASEQ:FASTQ_... [100%] 1 of 1 ✔
[1b/98c46d] process > NFCORE_RNASEQ:RNASEQ:FASTQ_... [100%] 7 of 7, cached: 1 ✔
[de/0d65b5] process > NFCORE_RNASEQ:RNASEQ:FASTQ_... [100%] 7 of 7 ✔
[c7/aa1303] process > NFCORE_RNASEQ:RNASEQ:ALIGN_... [100%] 7 of 7 ✔
[08/387a80] process > NFCORE_RNASEQ:RNASEQ:ALIGN_... [100%] 7 of 7 ✔
[ea/fa0027] process > NFCORE_RNASEQ:RNASEQ:ALIGN_... [100%] 7 of 7 ✔
[9d/3d609d] process > NFCORE_RNASEQ:RNASEQ:ALIGN_... [100%] 7 of 7 ✔
[5f/ec444d] process > NFCORE_RNASEQ:RNASEQ:ALIGN_... [100%] 7 of 7 ✔
[06/095e07] process > NFCORE_RNASEQ:RNASEQ:ALIGN_... [100%] 7 of 7 ✔
[b4/064bb8] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [100%] 7 of 7 ✔
[bb/6d32ef] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [100%] 1 of 1 ✔
[ec/ac61c6] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [100%] 1 of 1 ✔
[-        ] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [  0%] 0 of 1
[-        ] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [  0%] 0 of 1
[-        ] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [  0%] 0 of 1
[-        ] process > NFCORE_RNASEQ:RNASEQ:QUANTI... [  0%] 0 of 1
[-        ] process > NFCORE_RNASEQ:RNASEQ:DESEQ2... [  0%] 0 of 1
[96/401710] process > NFCORE_RNASEQ:RNASEQ:BAM_MA... [100%] 7 of 7 ✔
[f5/b39e59] process > NFCORE_RNASEQ:RNASEQ:BAM_MA... [100%] 7 of 7 ✔
[70/047101] process > NFCORE_RNASEQ:RNASEQ:BAM_MA... [100%] 7 of 7 ✔
[4d/3c309a] process > NFCORE_RNASEQ:RNASEQ:BAM_MA... [100%] 7 of 7 ✔
[6e/8e2354] process > NFCORE_RNASEQ:RNASEQ:BAM_MA... [100%] 7 of 7 ✔
[6c/e08dfb] process > NFCORE_RNASEQ:RNASEQ:STRING... [ 57%] 4 of 7
[77/28825b] process > NFCORE_RNASEQ:RNASEQ:SUBREA... [ 57%] 4 of 7
[4f/11e861] process > NFCORE_RNASEQ:RNASEQ:MULTIQ... [ 75%] 3 of 4
[8d/648071] process > NFCORE_RNASEQ:RNASEQ:BEDTOO... [ 71%] 5 of 7
[c1/441cd5] process > NFCORE_RNASEQ:RNASEQ:BEDGRA... [ 50%] 2 of 4
[20/298c35] process > NFCORE_RNASEQ:RNASEQ:BEDGRA... [100%] 2 of 2
[87/97d4fc] process > NFCORE_RNASEQ:RNASEQ:BEDGRA... [ 50%] 2 of 4
[8f/67e2c6] process > NFCORE_RNASEQ:RNASEQ:BEDGRA... [100%] 2 of 2
[35/d795bf] process > NFCORE_RNASEQ:RNASEQ:QUALIM... [ 28%] 2 of 7, failed: 1
[7e/d09388] process > NFCORE_RNASEQ:RNASEQ:DUPRAD... [100%] 7 of 7 ✔
[35/70de52] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 28%] 2 of 7
[71/2cceb9] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 28%] 2 of 7
[6e/eae317] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 28%] 2 of 7
[a1/a138b0] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 28%] 2 of 7
[63/bf9a7f] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 28%] 2 of 7
[a2/9fa74a] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 28%] 2 of 7
[c6/13bb17] process > NFCORE_RNASEQ:RNASEQ:BAM_RS... [ 28%] 2 of 7
[-        ] process > NFCORE_RNASEQ:RNASEQ:CUSTOM... -
[-        ] process > NFCORE_RNASEQ:RNASEQ:MULTIQC   -

ERROR ~ Error executing process > 'NFCORE_RNASEQ:RNASEQ:QUALIMAP_RNASEQ (ASD_10)'

Caused by:
  Process exceeded running time limit (8h)

Command executed:

  unset DISPLAY
  mkdir -p tmp
  export _JAVA_OPTIONS="-Djava.io.tmpdir=./tmp -XX:-UsePerfData"
  qualimap \
      --java-mem-size=29491M \
      rnaseq \
       \
      -bam ASD_10.markdup.sorted.bam \
      -gtf Callithrix_jacchus.mCalJac1.pat.X.dna.primary_assembly.filtered.gtf \
      -p strand-specific-reverse \
      -pe \
      -outdir ASD_10
  
  cat <<-END_VERSIONS > versions.yml
  "NFCORE_RNASEQ:RNASEQ:QUALIMAP_RNASEQ":
      qualimap: $(echo $(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*$//')
  END_VERSIONS

Command exit status:
  -

Command output:
  Java memory size is set to 29491M
  Launching application...
  
  QualiMap v.2.3
  Built on 2023-05-19 16:57
  
  Selected tool: rnaseq
  Initializing regions from Callithrix_jacchus.mCalJac1.pat.X.dna.primary_assembly.filtered.gtf...
  
  Initialized 100000 regions...
  Initialized 200000 regions...
  Initialized 300000 regions...
  Initialized 400000 regions...
  Initialized 500000 regions...
  Initialized 600000 regions...
  Initialized 700000 regions...
  Initialized 800000 regions...
  Initialized 900000 regions...
  Initialized 1000000 regions...
  Initialized 1100000 regions...
  Initialized 1200000 regions...
  Initialized 1300000 regions...
  Initialized 1400000 regions...
  
  Initialized 1406694 regions it total
  
  Starting constructing transcripts for RNA-seq stats...
  Finished constructing transcripts
  
  Starting BAM file analysis
  
  Sorting BAM file by name...
  
  Read 10000000 records.
  Read 20000000 records.
  Read 30000000 records.
  Read 40000000 records.
  Read 50000000 records.
  Read 60000000 records.
  Read 70000000 records.
  Read 80000000 records.
  Read 90000000 records.
  Read 100000000 records.
  Read 110000000 records.
  Read 120000000 records.
  Read 130000000 records.
  Read 140000000 records.
  Read 150000000 records.
  Finished reading inputs, merging and writing to output now.

Command error:
  Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=./tmp -XX:-UsePerfData

same error!

I was under the impression that creating an individual tmp folder for each sample would solve the issue, but that is not what the snipped you suggested does right?

@pinin4fjords
Copy link
Member

That seems to have done the trick in removing the blocking error. My additional snippet just disabled some logging that probably isn't essential and seemed to be clashing. But it doesn't seem to have helped the run time:

Process exceeded running time limit (8h)

You may just need to increase the runtime limit for that process.

@redvoidling
Copy link
Author

redvoidling commented May 16, 2024

I have not seen the blocking in every error log I just assumed it to be the root cause because 8 hours seems to be quite extensive for Qualimap to run on one single sample.

How would I go about increasing the runtime limit?
I changed

process QUALIMAP_RNASEQ {
    tag "$meta.id"
    label 'process_medium'   

to

process QUALIMAP_RNASEQ {
    tag "$meta.id"
    label 'process_high'   

because that would give it 16h of compute time. Hope it works.

@pinin4fjords
Copy link
Member

The log suggests to me that it's the writing of results that is taking time, which may be related to your local disks or other infrastructure. You can supply custom configuration to override resource configuration for specific processes- see the instructions on nf-core: https://nf-co.re/docs/usage/configuration#tuning-workflow-resources

@redvoidling
Copy link
Author

Ok I think changing the label did the trick because, like I said, it increased the runtime to 16h.
16 out of 35 Qualimap runs are done.

Thank you for your help! :)

@pinin4fjords
Copy link
Member

Glad it's working. Just be aware that changing the label changes more than just the time request, so you may for example be requesting more memory than you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants