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

Current eOn code and boinc distributed computing

Moderator: moderators

Post Reply
ban123
Posts: 6
Joined: Tue Oct 24, 2017 8:31 am

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

Post by ban123 » Tue Dec 05, 2017 2:58 pm

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.

gump_813
Posts: 26
Joined: Sat Mar 14, 2009 3:29 am

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

Post by gump_813 » Wed Dec 06, 2017 3:23 pm

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_account | 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.

ban123
Posts: 6
Joined: Tue Oct 24, 2017 8:31 am

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

Post by ban123 » Fri Dec 08, 2017 12:13 am

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.

graeme
Site Admin
Posts: 1634
Joined: Tue Apr 26, 2005 4:25 am
Location: University of Texas at Austin
Contact:

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

Post by graeme » Fri Dec 08, 2017 12:26 am

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.

ban123
Posts: 6
Joined: Tue Oct 24, 2017 8:31 am

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

Post by ban123 » Fri Dec 08, 2017 1:06 am

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."

graeme
Site Admin
Posts: 1634
Joined: Tue Apr 26, 2005 4:25 am
Location: University of Texas at Austin
Contact:

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

Post by graeme » Fri Dec 08, 2017 1:11 pm

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.

ban123
Posts: 6
Joined: Tue Oct 24, 2017 8:31 am

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

Post by ban123 » Mon Dec 11, 2017 5:29 pm

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.

graeme
Site Admin
Posts: 1634
Joined: Tue Apr 26, 2005 4:25 am
Location: University of Texas at Austin
Contact:

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

Post by graeme » Mon Dec 11, 2017 5:34 pm

Ok, good. You should run "eon" (the server) from the main directory. The eon server is responsible for running the eon client.

ban123
Posts: 6
Joined: Tue Oct 24, 2017 8:31 am

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

Post by ban123 » Mon Dec 11, 2017 5:34 pm

I forgot to mention that, I am trying to run this example "akmc-cu100mrr-vasp"

Post Reply