Refine Config

Refine Base Config

We will reuse the guided configuration we just created different clusters. No matter which cluster we create, we can refine the config to already have some common settings.

cd ${HOME}
cp .parallelcluster/config pcluster-base.ini

Adjust Basic Configuration

Postinstall

Let us add the post-install configuration. Here’s some magic command that sets the post-install.sh script for ParallelCluster to execute.

cat pcluster-base.ini \
      |wildq -i ini -M '."cluster default".s3_read_resource = "arn:aws:s3:::*"' \
      |wildq -i ini -M '."cluster default".post_install = "s3://BUCKET_NAME/post.install.sh"' \
      |wildq -i ini -M '."cluster default".post_install_args = "BUCKET_NAME"' \
      |sed -e "s/BUCKET_NAME/${BUCKET_NAME}/" \
      |sponge pcluster-base.ini

Headnode

cat pcluster-base.ini \
      |wildq -i ini -M '."cluster default".master_instance_type = "m5.2xlarge"' \
      |sponge pcluster-base.ini

SSH Key

cat pcluster-base.ini \
      |wildq -i ini -M '."cluster default".key_name = "SSH_KEY"' \
      |sed -e "s/SSH_KEY/${SSH_KEY}/" \
      |sponge pcluster-base.ini

Remove Compute

We’ll remove the compute queue and compute environment create by pcluster configure. That will be replaced with specific settings later.

cat pcluster-base.ini \
      |wildq -i ini -M 'del(."queue compute")' \
      |wildq -i ini -M 'del(."compute_resource default")' \
      |sponge pcluster-base.ini

Hyperthreading

Some workloads benefit from hyperthreading; please consider disabling it depending on your workload. The default value is false which will enable hyperthreading.

cat pcluster-base.ini \
    |wildq -i ini -M '."queue compute".disable_hyperthreading = "true"' \
    |sponge pcluster-base.ini

Software Share

ParallelCluster exports a shared file-system from the headnode. /shared usually is 20GB in size. Pretty small for all the HPC apps.

cat pcluster-base.ini \
    |wildq -i ini -M '."cluster default".ebs_settings = "shared"' \
    |wildq -i ini -M '."ebs shared".volume_size = "250"' \
    |wildq -i ini -M '."ebs shared".shared_dir = "/shared"' \
    |wildq -i ini -M '."ebs shared".volume_type = "gp2"' \
    |sponge pcluster-base.ini

FSx

In case you need a fast, shared filesystem you can enable FSx for Lustre using this snippet:

cat pcluster-base.ini \
    |wildq -i ini -M '."cluster default".fsx_settings = "myfsx"' \
    |wildq -i ini -M '."fsx myfsx".shared_dir = "/fsx"' \
    |wildq -i ini -M '."fsx myfsx".storage_capacity = "1200"' \
    |sponge pcluster-base.ini

Operating System

Depending on your use-case you might want to change the OS. The default is Amazonlinux 2 (alinux2).

cat pcluster-base.ini \
    |wildq -i ini -M '."cluster default".base_os = "alinux2"' \
    |sponge pcluster-base.ini

Instance Root Volume Size

cat pcluster-base.ini \
    |wildq -i ini -M '."cluster default".compute_root_volume_size = "100"' \
    |wildq -i ini -M '."cluster default".master_root_volume_size = "100"' \
    |sponge pcluster-base.ini