Skip to content

Commit

Permalink
Add another option to obtain batch size and remove OMP set while not …
Browse files Browse the repository at this point in the history
…multinodes mode or using KNM

Change-Id: Id10dc909d9abd8719a837bce464c833838f4b0a2
  • Loading branch information
manofmountain committed Dec 1, 2017
1 parent a124ef8 commit 31b9d9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions scripts/run_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ function obtain_batch_size
echo "Error: log file $log_file does not exist..."
exit 1
fi
if [ $numnodes -eq 1 ]; then
batch_size=`cat $log_file | grep shape | sed -n "3, 1p" | awk '{print $(NF-4)}'`
else
batch_size=`cat $log_file | grep SetMinibatchSize | sed -n "1, 1p" | awk '{print $(NF)}'`
batch_size=`cat $log_file | grep shape | sed -n "3, 1p" | awk '{print $(NF-4)}'`
batch_size_opt=`cat $log_file | grep SetMinibatchSize | sed -n "1, 1p" | awk '{print $(NF)}'`
if [[ $batch_size_opt != "" ]]; then
batch_size=$batch_size_opt
fi
echo "batch size: $batch_size"
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/set_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,17 @@ function set_openmp_envs
export OMP_NUM_THREADS=${numthreads_per_proc}
export KMP_HW_SUBSET=1t
affinitystr="proclist=[0-5,$((5+numservers+reserved_cores+1))-$((maxcores-1))],granularity=thread,explicit"
export KMP_AFFINITY=$affinitystr
else
# For single node only set for KNM
if [ "${cpu_model}" == "knm" ]; then
export KMP_BLOCKTIME=10000000
export MKL_ENABLE_INSTRUCTIONS=AVX512_MIC_E1
export OMP_NUM_THREADS=${numthreads_per_proc}
affinitystr="compact,1,0,granularity=fine"
export KMP_AFFINITY=$affinitystr
fi
fi
export KMP_AFFINITY=$affinitystr

echo "Number of OpenMP threads: ${numthreads_per_proc}"
}
Expand Down

0 comments on commit 31b9d9f

Please sign in to comment.