0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Rocky Linux 9でSlurmのセットアップ

Posted at

Rocky Linux 9.4にSlurmをセットアップする際のメモ

サーバ環境

計算サーバは1台でヘッドノード兼用とする。
ホスト名はHostA。
4コア使用。
ジョブ記録用DBのMariaDBは使用しない。
作業はrootで行う。

ホスト名の設定

ホスト名が設定されているか

# hostname

で確認する。設定されていない場合は下記の用に設定する。

# hostnamectl set-hostname HostA
# systemctl restart systemd-hostnamed

ループバックアドレスにホスト名を設定しておく。(ネットワークのアドレスでもOK)
/etc/hostsに

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 HostA

とHostAを追加する。

パッケージのインストール

# dnf groupinstall "Development Tools" -y
# dnf install -y epel-release
# dnf install -y munge munge-devel \
    slurm slurm-slurmctld slurm-slurmd \
    slurm-perlapi slurm-devel

MUNGE認証の設定

# /usr/sbin/create-munge-key
# systemctl enable --now munge

Slurmの設定

/etc/slurm/slurm.conf を編集してホスト名とCPU数を変更する。

SlurmctldHost=HostA
NodeName=HostA CPUs=4 State=UNKNOWN

Slurmのユーザーとディレクトリを作成

# useradd -m slurm
# mkdir -p /var/spool/slurm/state /var/spool/slurmd /var/log/slurm
# chown -R slurm: /var/spool/slurm /var/spool/slurmd /var/log/slurm

サービスの起動

# systemctl enable --now slurmctld
# systemctl enable --now slurmd

動作確認(一般ユーザで実行)

$ sinfo           # ノード状態の確認
$ squeue          # ジョブの確認
$ srun hostname   # 簡単なジョブの実行

$ vi test.sh
#!/bin/bash
pwd

$ sbatch test.sh       # 簡単なジョブの投入
$ sbatch -c 4 test.sh  # 複数CPU使用のジョブの投入
$ ls slurm-*.out       # 出力ファイル確認
$ sbatch -c 5 test.sh  # 複数CPU使用のジョブの投入
$ squeue               # ジョブが実行されないことを確認
$ scancel [ジョブ番号]  # ジョブの削除
$ squeue               # ジョブの削除を確認
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?