#!/bin/bash 

. ./config.sh

NODES='isc17-c02,isc17-c03,isc17-c04,isc17-c05,isc17-c06,isc17-c07,isc17-c08,isc17-c09,isc17-c11,isc17-c12,isc17-c13,isc17-c14,isc17-c15,isc17-c18,isc17-c22,isc17-c01'


#for NN in ${NN_ARR[@]}; do 

for NN in 1; do 
    LUSTRE_TESTFILE="$TD/sharedread${NN}/file"
    TESTDIR="$(dirname $LUSTRE_TESTFILE)"
    mkdir $TESTDIR
    lfs setstripe -c $(($NN * 2)) $TESTDIR

    MPIEXEC_PARAMS="-ppn 8 -np $((8*$NN)) -hosts isc17-c04,isc17-c05 "
    MPIEXEC_PARAMS+="-genv MV2_NUM_HCAS 1 -genv MV2_CPU_BINDING_LEVEL core -genv MV2_CPU_BINDING_POLICY scatter"

    IOR_PARAMS="-i 1 -s 1 -t $((16 * 1024 * 1024)) -b $(($DATASIZE / 8)) -o $LUSTRE_TESTFILE -a MPIIO -e -g -k "
    IOR_PARAMS+="-D 60 -O stoneWallingWearOut=1 "

    ./drop_caches.sh
    set +x
    $MPIEXEC $MPIEXEC_PARAMS $IOR $IOR_PARAMS -w
    set -x

#    ./drop_caches.sh
#    set +x
#    $MPIEXEC $MPIEXEC_PARAMS $IOR $IOR_PARAMS -r
#    set -x
done
