Page 1 of 1

how to change the submission script from "qsub" to "slurm (sbatch) queue system

Posted: Tue Dec 05, 2017 2:58 pm
by ban123
Dear All,

I was trying to taste this example file "akmc-cu100mrr-vasp" in eON code. I have installed the eonclient. I have checked that within this example, there are three scripts: submit_job.sh, queued_job.sh, cancel_job.sh. Also, there is another script in "potfiles", runvasp.sh. So in the "runvasp.sh", I have changed the script like the way I used to run VASP using slurm (sbatch) system.
#!/bin/bash
#SBATCH --account=XXXX
#SBATCH -t 01:00:00

module load vasp/5.4.1
mpprun -n 16 vasp

Now can anyone please explain to me how to alter this "submit_job.sh, queued_job.sh, cancel_job.sh". In "slurm" system to submit job we use "sbatch sub.sh" command, to cancel "scancel jobid", to check job "squeue -u username". I did not understand the line in submit_job.sh "qsub -V -b y -j y -o ll_out -S /bin/bash -N "$1" -wd "$2" -pe mpi24"

Looking forward to hearing from you.

Re: how to change the submission script from "qsub" to "slurm (sbatch) queue system

Posted: Wed Dec 06, 2017 3:23 pm
by gump_813
Hi,

the submit_job.sh should be something like this:

#!/bin/bash
sbatch -A your_account -J "$1" -D "$2" -o ll_out -t "01:00:00" path_to_eonclient/eonclient |awk '{print $4}'

make sure the script return the job_id. If not, you need to change $4 in awk to specify the column of sbatch output that contains the job_id. Since job submission is handled in this script, so your run_vasp.sh script should only have commands to run vasp:

#!/bin/bash
module load vasp/5.4.1
mpprun -n vasp


for queued_job.sh, just change qstat to squeue
#!/bin/bash
squeue -u your_user_name | awk '$1~/^[0-9]/ {print $1}'

Still make sure it returns the job_id (I tested it on NERSC cori)


for cancel_job.sh
#!/bin/bash
scancel $@

Hopefully, these scripts work for you.

Re: how to change the submission script from "qsub" to "slurm (sbatch) queue system

Posted: Fri Dec 08, 2017 12:13 am
by ban123
thanks gump_813 for your prompt action.
I have just tried now, but after submitting "submit_job.sh", like,

sbatch submit_job.sh

it has returned the text with job id:
Submitted batch job 171111

then after few seconds it stopped, then I have checked the slurm file corresponds to that job id, it showed
"sbatch: error: This does not look like a batch script. The first
sbatch: error: line must start with #! followed by the path to an interpreter.
sbatch: error: For instance: #!/bin/sh
"
Is it something that "eonclient" does not look like bash script? I have checked that "eonclient" is a binary file.

Re: how to change the submission script from "qsub" to "slurm (sbatch) queue system

Posted: Fri Dec 08, 2017 12:26 am
by graeme
check that you have this line first in your submit_job.sh file,
#!/bin/bash
and that the command sbatch can be found by in the minimal path of bash. If it is not, try adding the full path to the sbatch command.

Re: how to change the submission script from "qsub" to "slurm (sbatch) queue system

Posted: Fri Dec 08, 2017 1:06 am
by ban123
yes my first line containing, "#!/bin/bash", like this
#!/bin/bash
sbatch --account=snicXXXXX -J "$1" -D "$2" -o ll_out -t "11:00:00" /home/x_sadba/eon-2342/client/eonclient |awk '{print $4}'

but still when I am executing submit_job.sh file, like
./submit_job.sh
it is showing
"sbatch: error: This does not look like a batch script. The first
sbatch: error: line must start with #! followed by the path to an interpreter.
sbatch: error: For instance: #!/bin/sh
"
Is it like that need to use "#!/bin/bash" in binary "eonclient"? I have tried with "--wrap" option, but it is showing "error: Script arguments are not permitted with the --wrap option."

Re: how to change the submission script from "qsub" to "slurm (sbatch) queue system

Posted: Fri Dec 08, 2017 1:11 pm
by graeme
See if you can debug this - it will be easier for you since you can do tests on your own system.

First, make sure that bash is located in /bin, i.e. that /bin/bash exists.

Make sure that submit_job.sh is executable. Then try running the script directory with two arguments. The first is irrelevant and the second can be the local directory ".". You can also try running the sbatch command directly to make sure that works.

I expect that you will be able to fix this with a few tests, or find someone nearby who has some experience with simple bash scripts.

Re: how to change the submission script from "qsub" to "slurm (sbatch) queue system

Posted: Mon Dec 11, 2017 5:29 pm
by ban123
Dear Graeme
Thanks for your response. Yes, I have fixed that part.
If I execute the submit_job.sh (./submit_job.sh), now it returns the jobid.
But still not able to run that example file, it shows this "error: Unknown job: akmc":

EON Client
VERSION: rexported
BUILD DATE: Tue Dec 5 15:26:29 CET 2017

Hostname: n93
OS: Linux
Arch: x86_64
PID: 52808
DIR: /home/ban/eon-2342/examples/akmc-cu100mrr-vasp

Loading parameter file config.ini
* [Main] job: akmc
* [Main] temperature: 300
* [Main] random_seed: 500
* [Main] checkpoint: true
* [Main] finite_difference: 0.1
* [Potential] potential: vasp
* [Debug] write_movies: True
* [Structure Comparison] distance_difference: 0.2
* [Structure Comparison] neighbor_cutoff: 3.4
* [Structure Comparison] energy_difference: 0.1
* [Structure Comparison] indistinguishable_atoms: true
* [Optimizer] opt_method: lbfgs
* [Optimizer] converged_force: 0.02
* [Optimizer] max_iterations: 250
* [Prefactor] default_value: 1e12
* [Parallel Replica] dephase_time: 250
* [Saddle Search] method: dynamics
* [Saddle Search] dynamics_temperature: 800
error: Unknown job: akmc

So I am wondering, to submit the job should I execute the "submit_job.sh" or just call "eon" from the working directory.

Re: how to change the submission script from "qsub" to "slurm (sbatch) queue system

Posted: Mon Dec 11, 2017 5:34 pm
by graeme
Ok, good. You should run "eon" (the server) from the main directory. The eon server is responsible for running the eon client.

Re: how to change the submission script from "qsub" to "slurm (sbatch) queue system

Posted: Mon Dec 11, 2017 5:34 pm
by ban123
I forgot to mention that, I am trying to run this example "akmc-cu100mrr-vasp"

Re: how to change the submission script from "qsub" to "slurm (sbatch) queue system

Posted: Thu Jun 27, 2019 8:18 am
by Enamullah
Dear Sir/Madam,
Can you please help me in submitting the parallel jobs for NEB calculation.
I have created a 'test' folder which contains, 00,01...06 sub folder containing POSCAR files each (no. of images are 5) . The 'test' folder also contain the required input files for the calculation e.g. INCAR, POTCAR, KPOINTS and job.sh files.
My normal job script(job.sh) is like the following

===================================
#!/bin/sh
#BSUB -q all
#BSUB -e %J.err
#BSUB -o %J.out
#BSUB -R "span[ptile=24]"
#BSUB -n 40

cd $LS_SUBCWD

source /etc/profile.d/intel.sh
mpirun /share/soft/vasp_intelmpi/bin/vasp5.3.5/vasp > log
====================================================

I want to submit the parallel jobs. Can you kindly suggest me what should I change in my job.sh file.

Thank You

Re: how to change the submission script from "qsub" to "slurm (sbatch) queue system

Posted: Thu Jun 27, 2019 2:11 pm
by graeme
The submit script can remain the same for an NEB calculation; you just need to add the IMAGES tag to your INCAR file.