

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# 例
<a name="examples"></a>

次の設定例はSlurm、、Torque、および ス AWS Batch ケジューラを使用した AWS ParallelCluster 設定を示しています。

**注記**  
バージョン 2.11.5 AWS ParallelCluster 以降、 は SGEまたは スTorqueケジューラの使用をサポートしていません。

**Contents**
+ [

## Slurm Workload Manager (`slurm`)
](#example.slurm)
+ [

## Son of Grid Engine (`sge`) および Torque Resource Manager (`torque`)
](#example.torque)
+ [

## AWS Batch (`awsbatch`)
](#example.awsbatch)

## Slurm Workload Manager (`slurm`)
<a name="example.slurm"></a>

次の例では、`slurm` スケジューラでクラスターを起動します。この例では、1 つのクラスターを 2 つのジョブキューで起動します。最初のキュー `spot` には、初期状態で 2 つの `t3.micro` スポットインスタンスが用意されています。最大で 10 インスタンスまで拡張でき、10 分間ジョブが実行されなかった場合には最小で 1 インスタンスまで拡張することができます ([`scaledown_idletime`](scaling-section.md#scaledown-idletime) 設定で調整可能)。2 番目のキューである `ondemand` は、インスタンスがない状態からスタートし、最大で 5 台の `t3.micro` オンデマンドインスタンスまで拡張することができます。

```
[global]
update_check = true
sanity_check = true
cluster_template = slurm

[aws]
aws_region_name = <your AWS リージョン>

[vpc public]
master_subnet_id = <your subnet>
vpc_id = <your VPC>

[cluster slurm]
key_name = <your EC2 keypair name>
base_os = alinux2                   # optional, defaults to alinux2
scheduler = slurm
master_instance_type = t3.micro     # optional, defaults to t3.micro
vpc_settings = public
queue_settings = spot,ondemand

[queue spot]
compute_resource_settings = spot_i1
compute_type = spot                 # optional, defaults to ondemand

[compute_resource spot_i1]
instance_type = t3.micro
min_count = 1                       # optional, defaults to 0
initial_count = 2                   # optional, defaults to 0

[queue ondemand]
compute_resource_settings = ondemand_i1

[compute_resource ondemand_i1]
instance_type = t3.micro
max_count = 5                       # optional, defaults to 10
```

## Son of Grid Engine (`sge`) および Torque Resource Manager (`torque`)
<a name="example.torque"></a>

**注記**  
この例では、 AWS ParallelCluster バージョン 2.11.4 以前のバージョンにのみ適用されます。バージョン 2.11.5 以降は、 AWS ParallelCluster では SGE または Torque スケジューラの使用はサポートしていません。

次の例では、`torque` または `sge` のスケジューラでクラスターを起動します。SGE を使用するには、`scheduler = torque` を `scheduler = sge` に変更します。サンプルの設定では、最大 5 つの同時ノード が許可され、10 分間ジョブが実行されない場合、2 つにスケールダウンします。

```
[global]
update_check = true
sanity_check = true
cluster_template = torque

[aws]
aws_region_name = <your AWS リージョン>

[vpc public]
master_subnet_id = <your subnet>
vpc_id = <your VPC>

[cluster torque]
key_name = <your EC2 keypair name>but they aren't eligible for future updates
base_os = alinux2                   # optional, defaults to alinux2
scheduler = torque                  # optional, defaults to sge
master_instance_type = t3.micro     # optional, defaults to t3.micro
vpc_settings = public
initial_queue_size = 2              # optional, defaults to 0
maintain_initial_size = true        # optional, defaults to false
max_queue_size = 5                  # optional, defaults to 10
```

**注記**  
バージョン 2.11.5 AWS ParallelCluster 以降、 は SGEまたは スTorqueケジューラの使用をサポートしていません。これらのバージョンを使用する場合は、引き続き使用するか、 AWS サービスおよびサポートチームによる AWS サポートのトラブルシューティングを行うことができます。

## AWS Batch (`awsbatch`)
<a name="example.awsbatch"></a>

次の例では、`awsbatch` スケジューラでクラスターを起動します。ジョブリソースのニーズに基いて、より良いインスタンスタイプを選択するように設定されています。

サンプルの設定では、最大 40 の同時 vCPU が許可され、10 分間 ([`scaledown_idletime`](scaling-section.md#scaledown-idletime) 設定で調整可能) ジョブが実行されない場合、ゼロにスケールダウンします。

```
[global]
update_check = true
sanity_check = true
cluster_template = awsbatch

[aws]
aws_region_name = <your AWS リージョン>

[vpc public]
master_subnet_id = <your subnet>
vpc_id = <your VPC>

[cluster awsbatch]
scheduler = awsbatch
compute_instance_type = optimal # optional, defaults to optimal
min_vcpus = 0                   # optional, defaults to 0
desired_vcpus = 0               # optional, defaults to 4
max_vcpus = 40                  # optional, defaults to 20
base_os = alinux2               # optional, defaults to alinux2, controls the base_os of
                                # the head node and the docker image for the compute fleet
key_name = <your EC2 keypair name>
vpc_settings = public
```