run.shのサンプル

OpenPBSおよびSlurmで使用するrun.shファイルのサンプルです

本ページのサンプルでは、以下の条件を想定したrun.shファイルのサンプルを示しています。

  • /home/calculation/ の中に.shファイルが保存されている
  • リソース: 1ノード、32CPUs、メモリ500GB
  • ジョブ名: pbs_samplejobまたはslrum_samplejob
  • Wall Time: 10分
  • mpirunコマンドを用い、run.shファイルと同じディレクトリにある実行ファイル(sample_job.exe)を実行する

実行環境(ノード数など)、実行ディレクトリ、実行ファイル名、などを適切にご設定の上、ご使用ください。

OpenPBSの場合

#!/bin/bash
#PBS -N pbs_samplejob
#PBS -l select=1:ncpus=32:mem=500gb
#PBS -l walltime=00:10:00

#Please write an appropriate directory
cd ${PBS_O_WORKDIR}

#Please write your execution command
mpirun ./sample_job.exe

Slurmの場合

#!/bin/bash
#SBATCH --job-name=slrum_samplejob
#SBATCH -N 1
#SBATCH -n 32
#SBATCH --mem=500G
#SBATCH --time=00:10:00

#Please write an appropriate directory
cd ${SLURM_SUBMIT_DIR}

#Please write your execution command
mpirun ./sample_job.exe