#!/bin/bash 

. ./config.sh


#for NN in ${NN_ARR[@]}; do 
    #TESTFILE="$TD/sharedread${NN}/file"
NN=16
    TESTFILE="ime:///gsfs/jtacquaviva/file_read"
    if [ ! -f $TESTFILE ]; then 
        TESTDIR="$(dirname $TESTFILE)"
        mkdir $TESTDIR
        #lfs setstripe -c $(($NN * 2)) $TESTDIR

        MPIEXEC_PARAMS="-ppn 8 -np $((8*$NN)) --hosts $(hosts $NN) "
        MPIEXEC_PARAMS+="-genv MV2_NUM_HCAS 1 -genv MV2_CPU_BINDING_LEVEL core -genv MV2_CPU_BINDING_POLICY scatter "
        MPIEXEC_PARAMS+="-genv RDMAV_FORK_SAFE 1 "
        MPIEXEC_PARAMS+="-genv RDMAV_HUGEPAGES_SAFE 1 "
        IOR_PARAMS="-i 1 -s 1 -t $((16 * 1024 * 1024)) -b $(($DATASIZE / 8)) -o $TESTFILE -a IME -e -g -k "
        #IOR_PARAMS+="-D 60 -O stoneWallingWearOut=1 "

        #./drop_caches.sh
        set -x
        $MPIEXEC $MPIEXEC_PARAMS $IOR $IOR_PARAMS -w
        set +x
    else
        echo "skip $TESTFILE"
    fi
#done
