TABLE OF CONTENTS


41-slurm-simple

DESCRIPTION

This example shows how to instruct PWTK to submit calculations to SLURM job scheduler (via "sbatch"). This script is run as:

    pwtk slurm_simple.pwtk

REMARK

For the other supported job schedulers, the usage is analogous, i.e., instead of the ::pwtk::SLURM command, use one of ::pwtk::LSF, ::pwtk::PBS, or ::pwtk::LL.

EXAMPLE SOURCE FILE

slurm-simple.pwtk

SOURCE

# scripts are submitted to SLURM job scheduler with the ::pwtk::SLURM command

SLURM {
    # here is the PWTK script that will be submitted to the Slurm job scheduler    
    import Si.pwtk

    # scan a parameter with ::pwtk::scanpar
    
    scanpar e [seq 10.0 4 22.0] {
        SYSTEM "ecutwfc = $e, ecutrho = 4*$e"
        
        # here we use:
        # * ::pwtk::runPW to run pw.x calculation
        # * ::pwtk::pwo::totene to extract total energy (pwo_totene is a shortcut)
        # * ::pwtk::write to write total energy to a file        

        write totene.dat [pwo_totene [runPW scf.Si_e$e]]
    }
    
    # close the 'totene.dat' file with ::pwtk::finish
    finish totene.dat
}


# Instead of a script encapsulated within the curly braces, a PWTK
# script file can be specified on the SLURM command line, e.g.:

SLURM convergence-tests-Cu.pwtk

REMARKS

1. Each SLURM command in the script implies a separate submission to the Slurm job scheduler, implying that within a single PWTK script, one can submit multiple jobs to Slurm.

2. Alternatively to the SLURM command, submission to the SLURM job scheduler can be achieved from the terminal command-line using a plain PWTK script file (i.e. not containing the SLURM command) with:

    pwtk --slurm convergence-tests-Cu.pwtk

or

    pwtk --slurm=PROFILE convergence-tests-Cu.pwtk

where 'PROFILE' is the name of the user-defined Slurm profile (see ::pwtk::SLURM and the 42-slurm-configurable example).