Deploy Multi-Region HPC clusters in Azure with CycleCloud

Published Apr 05 2022 11:31 AM 744 Views
Microsoft

CycleCloud Multi-Region Cluster OverviewCycleCloud Multi-Region Cluster Overview

 

 

Overview

High Performance Computing (HPC) clusters in Azure are almost exclusively deployed per Azure Region (ie. East US, South Central US, West Europe, etc).  Data gravity usually drives this as your data should be as close to the compute as possible to reduce latency.  If a need arises to use a different Region the default answer is to create a new/separate cluster in the Region and manage multiple clusters.  This additional management overhead isn't always desired and many customers ask how to create a single cluster that can span multiple Azure regions.  This blog will provide an example of how to create a Multi-Region Slurm cluster using Azure CycleCloud (CC).

 

What are some drivers for creating a Multi-Region HPC cluster?

  • Capacity. Sometimes a single Azure Region can not accommodate the quantity of compute cores needed. In this case the loosely coupled workload can be split across multiple regions to get access to all the compute cores requested.
  • Specialty Compute (ie. GPU, FPGA, Infiniband).  Your organization created an Azure environment in a specific Region (ie. East US 2) and later requires specialty compute VMs not available in that Region. Examples of these are high end GPU VMs (ie. NDv4), FPGA VMs (ie. NP) or HPC VMs (ie. HB & HC).
  • Public Datasets. Azure hosts numerous Public Data Sets but they are generally specific to Regions (ie. West US 2). You may have an HPC cluster and Data Lake configured in South Central US but need a compute queue/partition in West US 2 to optimize use of the Public Data Set (ie. Genomics Data Lake).

REQUIREMENTS

  • Azure CC UI has filters to restrict configuring resources to a single region.  To create a Multi-Region Cluster with CC requires all "Parameters" typically configured in the UI to be hardcoded in the cluster template file or a parameters file.  The configured template file and parameters will be imported to CC as a cluster instance using the CC CLI.
  • Networking connectivity must exist between head node (aka "scheduler") in Region1 and compute nodes in Region2.  The easiest way to accomplish this is with VNET Peering between VNET-2 in Region-2 and VNET-1 in Region-1 (Refer to drawing above).  The cluster parameters file will need to specify both the Region and VNET for each node/nodearray definition (NOTE: these are typically defined once in the template [[ node defaults]] section).  Example Azure CLI commands for VNET Peering:

 

 

#FOLLOWING EXAMPLE ASSUMES BOTH VNETS IN SAME RESOURCE GROUP
#CREATE VNET PEERING FROM VNET-1 TO VNET-2
az network vnet peering create -g MyResourceGroup -n VNET1ToVNET2 \
    --vnet-name VNET-1 --remote-vnet VNET-2 --allow-vnet-access

#CREATE VNET PEERING FROM VNET-2 TO VNET-1
az network vnet peering create -g MyResourceGroup -n VNET2ToVNET1 \
    --vnet-name VNET-2 --remote-vnet VNET-1 --allow-vnet-access

 

 

  • Name resolution is another key requirement to enable a Multi-Region cluster.  Traditionally CC will provide name resolution by managing the /etc/hosts file on each cluster node with pre-populated hostnames in the format ip-0A0A0004, which is a hash of the node IP address (ie. 0A0A0004 > 10.10.0.4).  This has been updated in CC v8.2.1 and Slurm Project version 2.5.x to use Azure DNS instead, which allows use of custom hostnames (for Nodes/VMs) and prefix (for NodeArray/VMSS).  For a Multi-Region cluster this must to be taken a step further with use of an Azure Private DNS Zone linked to VNET-1 and VNET-2.  For example:

 

 

# CREATE PRIVATE DNS ZONE
az network private-dns zone create -g MyResourceGroup \
   -n private.ccmr.net

#LINK VNETS TO PRIVATE DNS ZONE
az network private-dns link vnet create -g MyResourceGroup -n CCMRClusterLink1 \
   -z private.ccmr.net -v VNET-1 -e true

az network private-dns link vnet create -g MyResourceGroup -n CCMRClusterLink2 \
   -z private.ccmr.net -v VNET-2 -e true

 

 

IMPLEMENT

  1. The remaining portion assumes you have a working CC environment setup with CC CLI installed and VM quota in both Regions
  2. Acquire the sample template from GitHub repo.  No need to clone the entire repo, just download the Slurm Multi-Region template and accompanying Parameters file
  3. Edit the parameters file ( slurm-multiregion-params-min.json ) in your editor of choice (ie. Visual Studio Code, vim, etc)
    1.  Credentials is the common name of the CC credential in your environment.  This can be found in your CC GUI or CC CLI command:  cyclecloud account list
    2. Primary* represents the scheduler and HTC partition, whereas Secondary* represents the HPC partition
    3.  Update PrimarySubnet ,PrimaryRegion , SecondarySubnet & SecondaryRegion
      1. *Subnet is of the format resource-group-name/vnet-name/subnet-name (the template has a placeholder name)
      2. *Region Name can be found with the azure-cli command az account list-locations -o table
    4.  Update HPCMachineType , MaxHPCExecuteCoreCountHTCMachineType &MaxHTCExecuteCoreCount as necessary
    5.  Save your updates and exit
  4. Edit the template file ( slurm-multiregion-git.txt ) and replace private.ccmr.net with your specific Private DNS Zone name
  5. Upload your modified template file to your CC server as follows:
    1. cyclecloud import_cluster slurm-multigregion-cluster -c Slurm -f slurm-multiregion-git.txt -p slurm-multiregion-params-min.json
      1. slurm-multigregion-cluster = a name for the cluster chosen by you (no spaces)
      2. -c Slurm = name of the cluster defined in the template file (ie. line #6)
      3. -f slurm-multiregion-git.txt = file name of the template to upload
      4. -p slurm-multiregion-params-min.json = file name of the parameters file to upload
  6. Submit a test job to the Region2 VM ( sbatch mpi.sh )
    #!/bin/bash
    #SBATCH --job-name=mpiMultiRegion
    #SBATCH --partition=hpc
    #SBATCH -N 2
    #SBATCH -n 120 # 60 MPI processes per node
    #SBATCH --chdir /tmp
    #SBATCH --exclusive
    
    set -x
    source /etc/profile.d/modules.sh
    module load mpi/hpcx
    echo "SLURM_JOB_NODELIST = " $SLURM_JOB_NODELIST
    
    # Assign the number of processors
    NPROCS=$SLURM_NTASKS
    
    #Run the job
    mpirun -n $NPROCS --report-bindings echo "hello world!"
    
    mv slurm-${SLURM_JOB_ID}.out $HOME
    NOTE:  the default Slurm working directory is the path from which the job was submitted, typically the user home directory.  As the home directory will likely be in Region1 its important to explicitly set a working dir to something local to Region2.  In the above example I set it to the VM local /tmp (#SBATCH --chdir /tmp) and added a line at the end to move the Slurm output file to the user home directory.
  7. Review the output file in your home directory (ie. slurm-2.out for JobID 2)

 

CONCLUSION

With careful planning and implementation it is possible to create a Slurm Multi-Region cluster with Azure CycleCloud.  This blog is not all inclusive and there is likely additional customization required for a customer specific environment, such as adding mounts (ie. datasets) specific to the workflow in Region2.  

%3CLINGO-SUB%20id%3D%22lingo-sub-3061269%22%20slang%3D%22en-US%22%3EDeploy%20Multi-Region%20HPC%20clusters%20in%20Azure%20with%20CycleCloud%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3061269%22%20slang%3D%22en-US%22%3E%3CH3%20id%3D%22toc-hId--1461466498%22%20id%3D%22toc-hId--1437247318%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22CycleCloud%20Multi-Region%20Cluster%20Overview%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F340375i6F566A577E1BB552%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ccmr_overview%22%20alt%3D%22CycleCloud%20Multi-Region%20Cluster%20Overview%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ECycleCloud%20Multi-Region%20Cluster%20Overview%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1026046335%22%20id%3D%22toc-hId-1050265515%22%3EOverview%3C%2FH3%3E%0A%3CP%3EHigh%20Performance%20Computing%20(HPC)%20clusters%20in%20Azure%20are%20almost%20exclusively%20deployed%20per%20Azure%20Region%20(ie.%20East%20US%2C%20South%20Central%20US%2C%20West%20Europe%2C%20etc).%26nbsp%3B%20Data%20gravity%20usually%20drives%20this%20as%20your%20data%20should%20be%20as%20close%20to%20the%20compute%20as%20possible%20to%20reduce%20latency.%26nbsp%3B%20If%20a%20need%20arises%20to%20use%20a%20different%20Region%20the%20default%20answer%20is%20to%20create%20a%20new%2Fseparate%20cluster%20in%20the%20Region%20and%20manage%20multiple%20clusters.%26nbsp%3B%20This%20additional%20management%20overhead%20isn't%20always%20desired%20and%20many%20customers%20ask%20how%20to%20create%20a%20single%20cluster%20that%20can%20span%20multiple%20Azure%20regions.%26nbsp%3B%20This%20blog%20will%20provide%20an%20example%20of%20how%20to%20create%20a%20Multi-Region%20Slurm%20cluster%20using%20Azure%20CycleCloud%20(CC).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--781408128%22%20id%3D%22toc-hId--757188948%22%3EWhat%20are%20some%20drivers%20for%20creating%20a%20Multi-Region%20HPC%20cluster%3F%3C%2FH3%3E%0A%3CUL%20dir%3D%22auto%22%3E%0A%3CLI%3E%3CEM%3E%3CSTRONG%3ECapacity%3C%2FSTRONG%3E%3C%2FEM%3E.%20Sometimes%20a%20single%20Azure%20Region%20can%20not%20accommodate%20the%20quantity%20of%20compute%20cores%20needed.%20In%20this%20case%20the%20loosely%20coupled%20workload%20can%20be%20split%20across%20multiple%20regions%20to%20get%20access%20to%20all%20the%20compute%20cores%20requested.%3C%2FLI%3E%0A%3CLI%3E%3CEM%3E%3CSTRONG%3ESpecialty%20Compute%20(ie.%20GPU%2C%20FPGA%2C%20Infiniband)%3C%2FSTRONG%3E%3C%2FEM%3E.%26nbsp%3B%20Your%20organization%20created%20an%20Azure%20environment%20in%20a%20specific%20Region%20(ie.%20East%20US%202)%20and%20later%20requires%20specialty%20compute%20VMs%20not%20available%20in%20that%20Region.%20Examples%20of%20these%20are%20high%20end%20GPU%20VMs%20(ie.%20NDv4)%2C%20FPGA%20VMs%20(ie.%20NP)%20or%20HPC%20VMs%20(ie.%20HB%20%26amp%3B%20HC).%3C%2FLI%3E%0A%3CLI%3E%3CEM%3E%3CSTRONG%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Fopen-datasets%2F%23overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPublic%20Datasets%3C%2FA%3E%3C%2FSTRONG%3E%3C%2FEM%3E.%20Azure%20hosts%20numerous%20Public%20Data%20Sets%20but%20they%20are%20generally%20specific%20to%20Regions%20(ie.%20West%20US%202).%20You%20may%20have%20an%20HPC%20cluster%20and%20Data%20Lake%20configured%20in%20South%20Central%20US%20but%20need%20a%20compute%20queue%2Fpartition%20in%20West%20US%202%20to%20optimize%20use%20of%20the%20Public%20Data%20Set%20(ie.%20US%20Labor%20Force%20Statistics).%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH3%20id%3D%22toc-hId-1706104705%22%20id%3D%22toc-hId-1730323885%22%3EREQUIREMENTS%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3EAzure%20CC%20UI%20has%20filters%20to%20limit%20resources%20to%20a%20single%20region.%26nbsp%3B%20To%20create%20a%20Multi-Region%20Cluster%20with%20CC%20will%20require%20all%20%22Parameters%22%20typically%20configured%20in%20the%20UI%20to%20be%20hardcoded%20in%20the%20cluster%20template%20file.%26nbsp%3B%20The%20configured%20template%20file%20will%20be%20imported%20to%20CC%20as%20a%20cluster%20instance.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ENetworking%20connectivity%3C%2FSTRONG%3E%20must%20exist%20between%20head%20node%20(aka%20%22scheduler%22)%20in%20Region1%20and%20compute%20nodes%20in%20Region2.%26nbsp%3B%20The%20easiest%20way%20to%20accomplish%20this%20is%20with%20%3CA%20title%3D%22Azure%20VNET%20Peering%20Docs%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-network%2Fvirtual-network-peering-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EVNET%20Peering%3C%2FA%3E%20between%20VNET-2%20in%20Region-2%20and%20VNET-1%20in%20Region-1%20(Refer%20to%20drawing%20above).%26nbsp%3B%20The%20cluster%20template%20file%20will%20need%20to%20specify%20both%20the%20Region%20and%20VNET%20for%20each%20node%2Fnodearray%20definition%20(%3CSTRONG%3ENOTE%3C%2FSTRONG%3E%3A%20these%20are%20typically%20defined%20once%20in%20the%20template%20%3CFONT%20color%3D%22%23808080%22%3E%5B%5B%20node%20defaults%5D%5D%3C%2FFONT%3E%20section).%26nbsp%3B%20Example%20Azure%20CLI%20commands%20for%20VNET%20Peering%3A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3E%23FOLLOWING%20EXAMPLE%20ASSUMES%20BOTH%20VNETS%20IN%20SAME%20RESOURCE%20GROUP%0A%23CREATE%20VNET%20PEERING%20FROM%20VNET-1%20TO%20VNET-2%0Aaz%20network%20vnet%20peering%20create%20-g%20MyResourceGroup%20-n%20VNET1ToVNET2%20%5C%0A%20%20%20%20--vnet-name%20VNET-1%20--remote-vnet%20VNET-2%20--allow-vnet-access%0A%0A%23CREATE%20VNET%20PEERING%20FROM%20VNET-2%20TO%20VNET-1%0Aaz%20network%20vnet%20peering%20create%20-g%20MyResourceGroup%20-n%20VNET2ToVNET1%20%5C%0A%20%20%20%20--vnet-name%20VNET-2%20--remote-vnet%20VNET-1%20--allow-vnet-access%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EName%20resolution%3C%2FSTRONG%3E%20is%20another%20key%20requirement%20to%20enable%20a%20Multi-Region%20cluster.%26nbsp%3B%20Traditionally%20CC%20will%20provide%20name%20resolution%20by%20managing%20the%20%3CEM%3E%2Fetc%2Fhosts%3C%2FEM%3E%20file%20on%20each%20cluster%20node%20with%20pre-populated%20hostnames%20in%20the%20format%26nbsp%3B%3CEM%3Eip-0A0A0004%3C%2FEM%3E%2C%20which%20is%20a%20hash%20of%20the%20node%20IP%20address%20(ie.%200A0A0004%20%3D%3D%2010.10.0.4).%26nbsp%3B%20This%20has%20been%20updated%20in%20CC%20v8.2.1%20and%20Slurm%20Project%20version%202.5.x%20to%20default%20to%20using%20Azure%20DNS%20instead%2C%20which%20allows%20use%20of%20custom%20hostnames%20(for%20Nodes%2FVMs)%20and%20prefix%20(for%20NodeArray%2FVMSS).%26nbsp%3B%20For%20a%20Multi-Region%20cluster%20this%20has%20to%20be%20taken%20a%20step%20further%20with%20use%20of%20an%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdns%2Fprivate-dns-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Private%20DNS%20Zone%3C%2FA%3E%20linked%20to%20VNET-1%20and%20VNET-2.%26nbsp%3B%20For%20example%3A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3E%23%20CREATE%20PRIVATE%20DNS%20ZONE%0Aaz%20network%20private-dns%20zone%20create%20-g%20MyResourceGroup%20%5C%0A%20%20%20-n%20private.ccmr.net%0A%0A%23LINK%20VNETS%20TO%20PRIVATE%20DNS%20ZONE%0Aaz%20network%20private-dns%20link%20vnet%20create%20-g%20MyResourceGroup%20-n%20CCMRClusterLink1%20%5C%0A%20%20%20-z%20private.ccmr.net%20-v%20VNET-1%20-e%20true%0A%0Aaz%20network%20private-dns%20link%20vnet%20create%20-g%20MyResourceGroup%20-n%20CCMRClusterLink2%20%5C%0A%20%20%20-z%20private.ccmr.net%20-v%20VNET-2%20-e%20true%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--101349758%22%20id%3D%22toc-hId--77130578%22%3EIMPLEMENT%3C%2FH3%3E%0A%3COL%3E%0A%3CLI%3EThe%20remaining%20portion%20assumes%20you%20have%20a%20working%20CC%20environment%20setup%20with%20CC%20CLI%20installed%20and%20VM%20quota%20in%20both%20Regions%3C%2FLI%3E%0A%3CLI%3EAcquire%20the%20sample%20template%20from%20GitHub%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fthemorey%2Fcyclecloud-multiregion-cluster%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Erepo%3C%2FA%3E.%26nbsp%3B%20No%20need%20to%20clone%20the%20entire%20repo%2C%20just%20download%20the%20%3CA%20href%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fthemorey%2Fcyclecloud-multiregion-cluster%2Fmain%2Ftemplates%2Fslurm-multiregion-git.txt%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ESlurm%20Multi-Region%20template%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3EEdit%20the%20template%20in%20your%20editor%20of%20choice%20(ie.%20Visual%20Studio%20Code%2C%20vim%2C%20etc)%3COL%20class%3D%22lia-list-style-type-lower-alpha%22%3E%0A%3CLI%3E%26nbsp%3BSearch%20and%20replace%26nbsp%3B%3CCODE%3Eprivate.ccmr.net%3C%2FCODE%3E%26nbsp%3Bwith%20your%20specific%20Private%20DNS%20Zone%20name%3C%2FLI%3E%0A%3CLI%3E%26nbsp%3BUpdate%20all%3CCODE%3ESubnetId%3C%2FCODE%3E%26nbsp%3Band%3CCODE%3ERegion%3C%2FCODE%3E%26nbsp%3Bconfiguration%20values%20with%20your%20specific%20information%26nbsp%3B%3COL%3E%0A%3CLI%3E%3CCODE%3ESubnetId%3C%2FCODE%3Eis%20of%20the%20format%3CCODE%3Eresource-group-name%2Fvnet-name%2Fsubnet-name%3C%2FCODE%3E(the%20template%20has%20a%20placeholder%20name)%3C%2FLI%3E%0A%3CLI%3E%3CCODE%3ERegion%3C%2FCODE%3E%26nbsp%3BName%20can%20be%20found%20with%20the%20azure-cli%20command%3CCODE%3Eaz%20account%20list-locations%20-o%20table%3C%2FCODE%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3CLI%3E%26nbsp%3BSearch%20for%20all%20occurrences%20of%26nbsp%3B%3CCODE%3EDefaultValue%3C%2FCODE%3E%26nbsp%3Band%20verify%20info%20(ie.%20VM%20types%2C%20VM%2FCore%20counts%2C%20OS%20Image%20versions%2C%20etc)%3C%2FLI%3E%0A%3CLI%3E%26nbsp%3BSearch%20for%3CCODE%3Ehpc-gbb%3C%2FCODE%3E%2C%20uncomment%20the%20line%20and%20add%20the%20name%20of%20your%20credential%20(CC%20cli%20command%3A%3CCODE%3Ecyclecloud%20account%20list%3C%2FCODE%3E)%3C%2FLI%3E%0A%3CLI%3E%26nbsp%3Bthe%20default%20template%20places%20the%20scheduler%2Fhead%20node%20and%20HTC%20partition%20in%20Region1%20and%20the%20HPC%20partition%20in%20Region2.%26nbsp%3B%20This%20can%20modified%20as%20needed.%3C%2FLI%3E%0A%3CLI%3E%26nbsp%3BSave%20your%20updates%20and%20exit%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3CLI%3EUpload%20your%20modified%20template%20file%20to%20your%20CC%20server%20as%20follows%3A%3COL%20class%3D%22lia-list-style-type-lower-alpha%22%3E%0A%3CLI%3E%3CCODE%3Ecyclecloud%20import_cluster%20slurm-multigregion-cluster%20-c%20Slurm%20-f%20slurm-multiregion-git.txt%3C%2FCODE%3E%0A%3COL%3E%0A%3CLI%3E%3CCODE%3Eslurm-multigregion-cluster%3C%2FCODE%3E%26nbsp%3B%3D%20a%20name%20for%20the%20cluster%20given%20by%20you%20(no%20spaces)%3C%2FLI%3E%0A%3CLI%3E%3CCODE%3E-c%20Slurm%3C%2FCODE%3E%26nbsp%3B%3D%20name%20of%20the%20cluster%20defined%20in%20the%20template%20file%20(ie.%20line%20%236)%3C%2FLI%3E%0A%3CLI%3E%3CCODE%3E-f%20slurm-multiregion-git.txt%3C%2FCODE%3E%26nbsp%3B%3D%20file%20name%20of%20the%20template%20to%20upload%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3CLI%3ESubmit%20a%20test%20job%20to%20the%20Region2%20VM%20(%3CCODE%3Esbatch%20mpi.sh%3C%2FCODE%3E%3A(%3C%2Fimg%3E%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3E%23!%2Fbin%2Fbash%0A%23SBATCH%20--job-name%3DmpiMultiRegion%0A%23SBATCH%20--partition%3Dhpc%0A%23SBATCH%20-N%202%0A%23SBATCH%20-n%20120%20%23%2060%20MPI%20processes%20per%20node%0A%23SBATCH%20--chdir%20%2Fmnt%2Fresource%0A%23SBATCH%20--exclusive%0A%0Aset%20-x%0A%0Amodule%20load%20mpi%2Fhpcx%0Aecho%20%22SLURM_JOB_NODELIST%20%3D%20%22%20%24SLURM_JOB_NODELIST%0A%0A%23%20Assign%20the%20number%20of%20processors%0ANPROCS%3D%24SLURM_NTASKS%0A%0A%23Run%20the%20job%0Ampirun%20-n%20%24NPROCS%20--report-bindings%20echo%20%22hello%20world!%22%0A%0Amv%20slurm-%24%7BSLURM_JOB_ID%7D.out%20%24HOME%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CPRE%3E%3CFONT%20style%3D%22font-family%3A%20SegoeUI%2C%20Lato%2C%20'Helvetica%20Neue'%2C%20Helvetica%2C%20Arial%2C%20sans-serif%3B%20background-color%3A%20%23ffffff%3B%20font-size%3A%2016px%3B%20white-space%3A%20normal%3B%22%20color%3D%22%23FF0000%22%3E%3CSTRONG%3ENOTE%3C%2FSTRONG%3E%3C%2FFONT%3E%3CSPAN%20style%3D%22background-color%3A%20%23ffffff%3B%20color%3A%20%23333333%3B%20font-size%3A%2016px%3B%20white-space%3A%20normal%3B%22%3E%3A%26nbsp%3B%20the%20default%20Slurm%20working%20directory%20is%20the%20path%20from%20which%20the%20job%20was%20submitted%2C%20typically%20the%20user%20home%20directory.%26nbsp%3B%20As%20the%20home%20directory%20will%20likely%20be%20in%20Region1%20its%20important%20to%20explicitly%20set%20a%20working%20dir%20to%20something%20local%20to%20Region2.%26nbsp%3B%20In%20the%20above%20example%20I%20set%20it%20to%20the%20VM%20local%20SSD%20(%3C%2FSPAN%3E%3CCODE%20style%3D%22white-space%3A%20normal%3B%22%3E%23SBATCH%20--chdir%20%2Fmnt%2Fresource%3C%2FCODE%3E%3CSPAN%20style%3D%22background-color%3A%20%23ffffff%3B%20color%3A%20%23333333%3B%20font-size%3A%2016px%3B%20white-space%3A%20normal%3B%22%3E)%20and%20added%20a%20line%20at%20the%20end%20to%20move%20the%20Slurm%20output%20file%20to%20the%20user%20home%20directory.%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-3061269%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20title%3D%22Azure%20CycleCloud%20Multi-Region%20Cluster%20Overview%22%20href%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fthemorey%2Fcyclecloud-multiregion-cluster%2Fmain%2Fimages%2Fccmr_overview.png%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EAzure%20CycleCloud%20Multi-Region%20Cluster%20Overview%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3061269%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20HPC%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Feb 16 2022 06:37 AM
Updated by: