modules icon indicating copy to clipboard operation
modules copied to clipboard

Update BWA_INDEX memory formula to match BWAMEM2_INDEX pattern

Open Copilot opened this issue 1 month ago • 0 comments

PR checklist

  • [x] This comment contains a description of changes (with reason).
  • [x] If you've fixed a bug or added code that should be tested, add tests!
  • [x] If you've added a new tool - have you followed the module conventions in the contribution docs
  • [x] If necessary, include test data in your PR.
  • [x] Remove all TODO statements.
  • [x] Emit the versions.yml file.
  • [x] Follow the naming conventions.
  • [x] Follow the parameters requirements.
  • [x] Follow the input/output options guidelines.
  • [x] Add a resource label
  • [x] Use BioConda and BioContainers if possible to fulfil software requirements.
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • For modules:
      • [ ] nf-core modules test <MODULE> --profile docker
      • [ ] nf-core modules test <MODULE> --profile singularity
      • [ ] nf-core modules test <MODULE> --profile conda
    • For subworkflows:
      • [ ] nf-core subworkflows test <SUBWORKFLOW> --profile docker
      • [ ] nf-core subworkflows test <SUBWORKFLOW> --profile singularity
      • [ ] nf-core subworkflows test <SUBWORKFLOW> --profile conda

Description

BWA_INDEX fails on HPC systems with strict memory limits. Applied the same memory allocation pattern used in BWAMEM2_INDEX.

Changes

Updated modules/nf-core/bwa/index/main.nf:

- memory { 6.B * fasta.size() }
+ memory { (53.7.MB * Math.ceil(fasta.size() / 10000000)) * task.attempt }
  • Floor-based allocation: 53.7MB minimum (5.37x per BWA docs)
  • task.attempt multiplier enables retry with increased memory on failure
  • Maintains 5.37x scaling: 53.7MB / 10MB = 5.37

Identical pattern to BWAMEM2_INDEX (28x scaling, 280MB floor).

Original prompt

This section details on the original issue you should resolve

<issue_title>BWA_INDEX just needs an update like BWAMEM2_INDEX in PR#8993</issue_title> <issue_description>It's failing on some HPC systems</issue_description>

<agent_instructions>Update the memory request for BWA_INDEX just like the memory request in BWAMEM2_index but with the values specific for BWA_INDEX</agent_instructions>

Comments on the Issue (you are @copilot in this section)

  • Fixes nf-core/modules#9527

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot avatar Dec 08 '25 18:12 Copilot