Author Topic: Running batch jobs in command line  (Read 3988 times)

0 Members and 1 Guest are viewing this topic.

Aadhityan

  • Guest
Running batch jobs in command line
« on: August 22, 2017, 13:29 »
I want to run batch jobs in command line mode. Any scripts available to run files sequentially without using job manager. I am using parallel computing.

Offline Daniele Stradi

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 286
  • Country: dk
  • Reputation: 3
    • View Profile
Re: Running batch jobs in command line
« Reply #1 on: August 22, 2017, 13:54 »
The script depends a lot on the environment where you want to run the calculation.

If you run on a cluster with e.g. PBS, you should be able to preview the submission script by clicking on the corresponding machine in the Machine Manager, then on Edit->Preview Script. It should be possible to use the same script also from the terminal.

If it is Linux on your local machine, use the following script "mpi_atkpython".

#!/bin/bash
export OMP_NUM_THREADS=1
export OMP_DYNAMIC=FALSE

MY_MPI=/home/stradi/QuantumWise/VNL-ATK-2017.0/libexec/mpiexec.hydra
MY_PYTHON=/home/stradi/QuantumWise/VNL-ATK-2017.0/bin/atkpython

N="-n $1"

$MY_MPI $N  $MY_PYTHON $2


The variables MY_MPI and MY_PYTHON should point at the MPI executable and at the atkpython executable, respectively.

To run the script "calculation.py" on 4 processors, type:

mpi_atkpython 4  calculation.py

Regards,
Daniele.


Aadhityan

  • Guest
Re: Running batch jobs in command line
« Reply #2 on: August 26, 2017, 09:11 »
Actually I want to run than one python script(file) serially. currently I am using this command to run one file

mpiexec -n 4 -f  /..../machinefile atkpython /.../input1.py >  /.../input1.log

I  mean I want to give more than one file for input. So if one file calculation over, it should take another file automatically. i.e. input2.py, input3.py etc.

Offline Ulrik G. Vej-Hansen

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 426
  • Country: dk
  • Reputation: 9
    • View Profile
Re: Running batch jobs in command line
« Reply #3 on: August 28, 2017, 12:21 »
Sounds like you could try with a simple shell-script, like explained here: http://www.linfo.org/create_shell_1.html

in your case it would probably just be something like:
mpiexec -n 4 -f  /..../machinefile atkpython /.../input1.py >  /.../input1.log
mpiexec -n 4 -f  /..../machinefile atkpython /.../input2.py >  /.../input2.log
etc.