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.

Comments

  • Hi

    Look at:

    help\DualSPHysics5.0_Help.out

    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

    Regards

  • 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:

    #!/bin/bash

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

    #SBATCH --time=00:60:00

    #SBATCH --cpus-per-task=36

    export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK

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

    ./xCasePoiseuilleNN_linux64_CPU.sh

    Here I requested 36 cores.

    Good luck

Sign In or Register to comment.