[QE-users] pwtk scripting

Tone Kokalj tone.kokalj at ijs.si
Mon May 15 11:24:23 CEST 2023


On Mon, 2023-05-15 at 14:34 +0530, wenusaras wrote:
> I am new to QE.
> I am fallowing the MAX School workshop on QE.
> 
> The command in the pwtk script
> "    # run the pw.x calculation
>      runPW $name.in
> "
> is running with a single processor. (is that true?)

It depends: YES, if you did not define to run in parallel. 

To run in parallel you can do:

prefix mpirun -np 4
runPW $name.in

or 

runPW -prefix {mpirun -np 4} $name.in

But it is recommended to specify default "prefix" in ~/.pwtk/pwtk.tcl.
The following snippet will auto detect the number of procs on your
computer and use them for calculations:

try {
    set np [exec nproc]
    while { [catch {exec mpirun -n $np echo yes}] && $np > 1 } {
        set np [expr { $np > 2 ? $np / 2 : 1 }]
    }
    if { $np > 1 } {
        prefix mpirun -n $np
    }
}

You can put this snippet in ~/.pwtk/pwtk.tcl

Best regards,
Tone
-- 
Jožef Stefan Institute, Ljubljana, Slovenia





More information about the users mailing list