[QE-users] using mpirun -np with pwtk script

Tone Kokalj tone.kokalj at ijs.si
Wed Mar 22 14:01:00 CET 2023


On Wed, 2023-03-22 at 13:45 +0100, Matic wrote:
> Hi,
> 
> you can add:
> 
> prefix "mpirun -np X"
> 
> to your pwtk script (where X is the number of processors); 
> this can also be specified in your local ~/.pwtk/pwtk.tcl file so
> that you don't have to add it to every script when running on a
> particular machine

In addition, the specification can be made "automatic" by adding the
following snippet to ~/.pwtk/pwtk.tcl


    # get the number of available processors
    set np [exec nproc]
    while { [catch {exec mpirun -n $np echo yes}] } {
        set np [expr { $np > 2 ? $np / 2 : 1 }]
    }
    prefix mpirun -n $np


This will automatically determine the number of cores on your computer
and use them for running QE executables.

Regards, Tone
-- 
Jožef Stefan Institute, Ljubljana, Slovenia






More information about the users mailing list