<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Submit Jobs :: Ay Docs</title>
    <link>https://ops.docs.72602.space/csp/zhejianglab/slurm/cheatsheet/submit_job/index.html</link>
    <description>3 Type Jobs srun is used to submit a job for execution or initiate job steps in real time.&#xA;Example run shell srun -N2 bin/hostname run script srun -N1 test.sh exec into slurmd node srun -w slurm-lensing-slurm-slurmd-cpu-2 --pty /bin/bash sbatch is used to submit a job script for later execution. The script will typically contain one or more srun commands to launch parallel tasks.&#xA;Example&#xA;submit a batch job sbatch -N2 -w &#34;compute[01-02]&#34; -o job.stdout /data/jobs/batch-job.slurm batch-job.slurm #!/bin/bash #SBATCH -N 1 #SBATCH --job-name=cpu-N1-batch #SBATCH --partition=compute #SBATCH --mail-type=end #SBATCH --mail-user=xxx@email.com #SBATCH --output=%j.out #SBATCH --error=%j.err srun -l /bin/hostname #you can still write srun &lt;command&gt; in here srun -l pwd submit a parallel task to process differnt data partition sbatch /data/jobs/parallel.slurm parallel.slurm #!/bin/bash #SBATCH -N 2 #SBATCH --job-name=cpu-N2-parallel #SBATCH --partition=compute #SBATCH --time=01:00:00 #SBATCH --array=1-4 # 定义任务数组，假设有4个分片 #SBATCH --ntasks-per-node=1 # 每个节点只运行一个任务 #SBATCH --output=process_data_%A_%a.out #SBATCH --error=process_data_%A_%a.err TASK_ID=${SLURM_ARRAY_TASK_ID} DATA_PART=&#34;data_part_${TASK_ID}.txt&#34; #make sure you have that file if [ -f ${DATA_PART} ]; then echo &#34;Processing ${DATA_PART} on node $(hostname)&#34; # python process_data.py --input ${DATA_PART} else echo &#34;File ${DATA_PART} does not exist!&#34; fi how to split file split -l 1000 data.txt data_part_ &amp;&amp; mv data_part_aa data_part_1 &amp;&amp; mv data_part_ab data_part_2 salloc is used to allocate resources for a job in real time. Typically this is used to allocate resources and spawn a shell. The shell is then used to execute srun commands to launch parallel tasks.</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate></lastBuildDate>
    <atom:link href="https://ops.docs.72602.space/csp/zhejianglab/slurm/cheatsheet/submit_job/index.xml" rel="self" type="application/rss+xml" />
  </channel>
</rss>