#!/usr/bin/env bash
HOME_PATH=/work/home/hepj
WORK_PATH=${HOME_PATH}/bert-pytorch/2node-run-pre
which python3
source env.sh
hostfile=./hostfile
node=$(cat $hostfile|sort|uniq |wc -l)
np=$(($node*8))

nodename=$(cat $hostfile |sed -n "1p")
dist_url=`echo $nodename | awk '{print $1}'`

mpirun -np ${np} --hostfile hostfile-$SLURM_JOB_ID  --bind-to none --mca btl_tcp_if_include $dist_url ${WORK_PATH}/2nodes_single_process_pre1.sh $dist_url $node

