MattiaPandolfoVR / MetaPhage

GNU General Public License v3.0
36 stars 9 forks source link

How to adjust HPC parameter to change resource limit #39

Closed rmadnantariq closed 2 years ago

rmadnantariq commented 2 years ago

Hi I have access to a 16cpu 64 GB RAM node. There is a guide to change the CPU and RAM limits but I do't know where to add this to. If adding to the main.nf file I get syntax errors for the (process { ..) not having a identifier. I I make up an identifier then I get a withLabel BigRes error. I would appreciate any help on the matter

MattiaPandolfoVR commented 2 years ago

Hi, if you use slurm on your node you can modify the slurm.config file that you find in the "conf" folder, otherwise you can either modify the nextflow.config file (in the main folder) or create a new config file. If the latter method, i suggest you to put the new config file in the "conf" folder and then add the proper profile in nextflow.config (e.g. insert in the profile scope: newconf { includeConfig './conf/newconf.config' } assuming newconf.config is the name of your new config file. Remember to use -c newconf option when you launch MetaPhage).

telatin commented 2 years ago

Hi Adnan, if you are using the node as a single machine, so not with Slurm or PBS, you can create an "ad hoc" configuration (suppose you call it mynode.config), like the following


params {
  max_cpus = 16
  max_memory = 64.GB
  max_time = 48.h
}
process {
   // DEFAULTS
   withLabel:big_res {
        cpus = 16
        memory = 64.GB
        time = 24.h
    }
  withLabel: med_res {
        cpus = 16
        memory = 32.GB
        time = 24.h
    }
  withLabel: low_res {
        cpus = 4
        memory = 16.GB
        time = 24.h
    }
}

Then, when running the pipeline, add -c mynode.config to the command (nextflow run .... -c mynode.config)

rmadnantariq commented 2 years ago

Thank you Andrea and Mattia. That solved the issue.