How to choose number of CPU Cores

Hi there

We have 8 cores on a node in our Linux machine and DualSPHysics uses all 8 cores to run a simulation.

What if I want to use for example 4 cores or 2 cores?

How can I set the number of cores which will be used by machine?

Thanks a lot for any help.


  • Hi

    Look at:


    And its specified entry, "-ompthreads":

        -ompthreads:<int>  Only for CPU execution, indicates the number of threads
                       by host for parallel execution, this takes the number of 
                       cores of the device by default (or using zero value)

    Kind regards

  • Thank you so much for your response.

    I could not find -ompthreads in the execution parameters in Case_Def.xml file.

    Could you please let me know where I should specify number of threads?

    King regards

  • That is only available in the command line, not in the XML


  • Hello

    I just wanted to share my finding on how to request a number of cores for a job using SBATCH on a cluster.

    When submitting a job you can request the number of cores by a simple script like this:


    #SBATCH --account= ----------------

    #SBATCH --time=00:60:00

    #SBATCH --cpus-per-task=36


    cd /home/saleh85/DualSPHysics_v5.0/examples/mphase_nnewtonian/02_Poiseuille


    Here I requested 36 cores.

    Good luck

Sign In or Register to comment.