https://support.beocat.ksu.edu/BeocatDocs/index.php?title=Kstat.convert&feed=atom&action=historyKstat.convert - Revision history2024-03-28T19:36:38ZRevision history for this page on the wikiMediaWiki 1.39.6https://support.beocat.ksu.edu/BeocatDocs/index.php?title=Kstat.convert&diff=695&oldid=prevMozes: Created page with "=== Converting your qsub script for sbatch using <I>kstat.convert</I> === If you already have a qsub script, I have created a new perl program called kstat.convert that will..."2020-08-31T18:40:05Z<p>Created page with "=== Converting your qsub script for sbatch using <I>kstat.convert</I> === If you already have a qsub script, I have created a new perl program called kstat.convert that will..."</p>
<p><b>New page</b></p><div>=== Converting your qsub script for sbatch using <I>kstat.convert</I> ===<br />
<br />
If you already have a qsub script, I have created a new perl program called kstat.convert that will automatically convert your qsub script over to an sbatch script.<br />
<br />
<B>kstat.convert --sge qsub_script.sh --slurm slurm_script.sh</B><br />
<br />
Below is an example of a simple qsub script and the resulting sbatch script after conversion.<br />
<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
#$ -j y<br />
#$ -cwd<br />
#$ -N netpipe<br />
#$ -P KSU-CIS-HPC<br />
<br />
#$ -l mem=4G<br />
#$ -l h_rt=100:00:00<br />
#$ -pe single 32<br />
<br />
#$ -M eid@ksu.edu<br />
#$ -m ab<br />
<br />
mpirun -np $NSLOTS NPmpi -o np.out<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash -l<br />
#SBATCH --job-name=netpipe<br />
<br />
#SBATCH --mem-per-cpu=4G # Memory per core, use --mem= for memory per node<br />
#SBATCH --time=4-04:00:00 # Use the form DD-HH:MM:SS<br />
#SBATCH --nodes=1<br />
#SBATCH --ntasks-per-node=32<br />
<br />
#SBATCH --mail-user=eid@ksu.edu<br />
#SBATCH --mail-type=ALL # same as =BEGIN,FAIL,END<br />
<br />
mpirun -np $SLURM_NPROCS NPmpi -o np.out<br />
</syntaxhighlight><br />
<br />
The sbatch file uses <B>#SBATCH</B> to identify command options for the scheduler where the qsub file uses <B>#$</B>. Most options are similar but simply use a different syntax. The memory can still be defined on a per core basis as with SGE, or you can use <B>--mem=128G</B> to specify the total memory per node if you'd prefer. The <B>--nodes=</B> and <B>--ntasks-per-node=</B> provide an easy way to request the core configuration you want. If your code can be distributed across multiple nodes and you don't care what the arrangement is, you can instead just specify the number of cores using <B>--ntasks=</B>. For more in depth documentation on converting from SGE to Slurm follow the links below:<br />
<br />
https://srcc.stanford.edu/sge-slurm-conversion<BR><br />
https://slurm.schedmd.com/sbatch.html</div>Mozes