Job Manager for local execution of QuantumATK scripts¶
Table of Contents:
- Execute QuantumATK simualtions via the Job Manager
- Serial execution
- MPI parallelization
- Machine Manager
Execute QuantumATK simualtions via the Job Manager¶
In this section you will learn how to use the Job Manager for local execution of QuantumATK scripts. Specifically, you will learn about queuing, running and managing QuantumATK jobs.
Create a new empty project and download the example script
which runs an ATK-DFT calculation with very many k-points (31x31x31).
The Job Settings widget has three basic panels:
- Job properties;
- Use separate temporary directory (set this to allow using a non-default working directory for running the job. Note, results will not be appended to existing hdf5 or nc files, but instead a new file will be created.)
Set these settings according to your needs, and click OK.
The job output of course appears on the QuantumATK LabFloor after job execution.
Back in the Job Manager, the Property–Value list shows all details of the settings used for job execution, including
- path to the QuantumATK executable;
- name of the Python script and the log file.
- threading and other prallelization options.
Remember that the default job type is “Threaded parallel (Single process)”. You can change this to “Serial” or “Multiprocess parallel” before starting the job.
In the Job Settings window select a Serial job type as shown in the below figure to run on a single porcess with no threading. In fact, note that threading is turned off (number of threads is 1), and MPI parallelization is not available.
If you check the system load during local execution in serial, you should see that the serial job launches only a single computing task on a single CPU core.
Only one core is used at a time, but the hardware process manager may move the task between cores from time to time.
In the Job Settings window select a Threaded parallel (single process) job type as shown in the below figure to run on a single process with threading.
Threading is one way to parallelize a computational job. QuantumATK uses Intel MKL for openMP threading. Note that we do in general recommend MPI parallelization over threading for parallelizing DFT calculations. However, threading is often more efficient for parallelizing ATK-ForceField calculations.
Download the script
cnt.py, which uses ATK-ForceField to calculate
the dynamical matrix of a multiwall carbon nanotube.
Execute it using the Job Manager, and choose job type “Threaded parallel (single process)”. It should be pretty fast.
If you check the system load during execution of the calculation, you should see that only a single atkpython process is started, even though several cores appear to be busy. This is because the work load of the one process is split into a number of threads that may be distributed on more cores.
Download the script
cnt.py to test the performance of a ATK-ForceField simulations using threading.
This specific example will calculate the dynamical matrix of a multiwall carbon nanotube.
If you also run the calculation in serial, you will see that the wall-clock
time used for evaluating ATK-ForceField forces may decrease significantly
when threading is switched on. In the example shown below, the time spent
on force calculations is roughly halved.
If you are running ATK 2016 or earlier you need to have MPI installed on your local machine.
Both the Linux and Windows versions are compiled against Intel MPI library.
Since ATK 2017 Intel’s
mpiexec.hydra is provided on both Windows and Linux versios - this is the recommended way to run QuantumATK in parallel.
In Job Settings choose Multiprocess parallel and e.g. 4 MPI processes.
Running from the command line¶
If you wish to run QuantumATK in parallel from the command line you can use the
mpiexec.hydra binary shipped with QuantumATK and located in the folder
libexec/mpiexec.hydra present in your installation folder.
In this case you can run parallel jobs with:
$ QW_INSTALLATION_PATH/libexec/mpiexec.hydra -n 4 atkpython atk_script.py
QW_INSTALLATION_PATH/libexec/ in your
$ export PATH=QW_INSTALLATION_PATH/libexec:$PATH
This way you will automatically pick up the
binary shipped with QuantumATK:
$ mpiexec.hydra -n 4 atkpython atk_script.py
It may sometimes be convenient to have a predefined local machine that is set up with MPI parallelization as default mode. You can easily add such a machine yourself.
Then edit the default job settings of the new machine in the window that pops up:
- Name the machine, e.g. “Local (2017.0) - 4 MPI”.
- Select Multiprocess Parallel as job type.
- Make sure threading is turned off (Number of threads = 1)
- Choose the default number of processors, e.g. 4.
- Click OK to add the new machine to the Machine Manager.