-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmic-launch.sh
executable file
·35 lines (32 loc) · 1.04 KB
/
mic-launch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# Launch a program on MIC cards and host CPUs in symmetric mode.
#
# Environmental variables used:
# HOST_THREADS -- No. of threads for host CPUs
# MIC_THREADS -- No. of threads for MIC cards
# CMD_PATH -- Path to program binaries
# CMD_HOST -- Program binary (CPU version)
# CMD_MIC -- Program binary (MIC version)
# CMD_FLAGS -- Optional flags for the program
# MIC_KMP_AFFINITY -- KMP_AFFINITY for MIC cards
ARCH=`uname -m`
if [ $ARCH == "x86_64" ]
then
unset I_MPI_PMI_LIBRARY
export OMP_NUM_THREADS=$HOST_THREADS
if (( $DEBUG ))
then
echo "Running (on x86_64) [$PMI_RANK]: ${CMD_PATH}${CMD_HOST} $CMD_FLAGS"
fi
${CMD_PATH}${CMD_HOST} $CMD_FLAGS
elif [ $ARCH == "k1om" ]
then
export OMP_NUM_THREADS=$MIC_THREADS
export KMP_AFFINITY=$MIC_KMP_AFFINITY
export LD_LIBRARY_PATH=${MKLROOT}/lib/mic:${MKLROOT}/../compiler/lib/mic:$LD_LIBRARY_PATH
if (( $DEBUG ))
then
echo "Running (on MIC) [$PMI_RANK]: ${CMD_PATH}${CMD_MIC} $CMD_FLAGS"
fi
${CMD_PATH}${CMD_MIC} $CMD_FLAGS
fi