Running HPC-X on SR-IOV enabled HPC instances in Azure
Published Aug 02 2019 08:15 PM 2,427 Views
Microsoft

Cluster Setup:

To setup the cluster please follow the steps in the simple_hpc_pbs example. This will deploy a cluster that can be used for this example

 

Once your cluster is up and running and you are logged in to the headnode you are ready to proceed.

 

First, we will start with building Hello world using HPC-X

 

# Setup the directory path
mkdir -p ~/mpi/hello
cd ~/mpi/hello

# Download hello.c wget https://www.open-mpi.org/papers/workshop-2006/hello.c

# Setup HPC-X environment
hpcx_dir=$(ls -atr /opt | grep hpcx-* | tail -n1)
module use /opt/$hpcx_dir/modulefiles
module load hpcx

# Build hello executable
mpicc -o hello hello.c

# Find the PKEY
PKEY=`cat /sys/class/infiniband/mlx5_0/ports/1/pkeys/* | grep -v 0000 | grep -v 0x7fff`
PKEY=`echo ${PKEY/0x8/0x0}`
echo "PKEY: $PKEY"

# Find the hosts that were provisioned
pbsnodes -avS | grep ^comp | awk '{print $1}' > hostfile.txt

# Run your hello executable using mpirun
mpirun -np 2 -hostfile hostfile.txt -x UCX_IB_PKEY=$PKEY -x UCX_NET_DEVICES=mlx5_0:1 hello
Hello, World. I am 1 of 2
Hello, World. I am 0 of 2

 

This concludes this example. Please let me know if you have any questions or would like to see additional examples on the latest Azure specialized compute (H, HB, and HC) instances.

 

 

Version history
Last update:
‎Jul 31 2019 01:15 PM
Updated by: