ncbi / egapx

Eukaryotic Genome Annotation Pipeline-External caller scripts and documentation
Other
88 stars 9 forks source link

How to adjust CPU usage when running tasks with Singularity on a local server? #56

Open MrbrilliantLL opened 3 days ago

MrbrilliantLL commented 3 days ago

Hello, I am using a Singularity container to run tasks on a local server. Most of the time, the tasks are running with fewer than 10 threads. I would like to know if there are any parameters or configurations that can be used to adjust the CPU usage for the container, or any other methods to better control the number of CPU threads to improve parallel processing efficiency. It seems like the current setup isn't fully utilizing the multi-core resources of the server.

Thanks in advance for your help!

victzh commented 2 days ago

Nextflow - the workflow engine we use to run these jobs - has means for tuning requested CPUs and RAM for jobs to provide better parallelinsm. We use several large categories with their corresponding cpu and RAM allocation. You can copy this definition from the file ui/assets/config/process_resources.config into your own config file you use for Singularity. The structure is the following, and you can try to adjust it to your specific server: process { memory = 60.GB cpus = 7 time = 6.h errorStrategy = 'retry' maxRetries = 3

withLabel: 'big_job' {
    memory = 120.GB
    cpus = 15
}

withLabel: 'huge_job' {
    memory = 200.GB
    cpus = 31
}

withLabel: 'long_job' {
    time = 16.h
}

}

Hope it helps,

Victor