diff --git a/README.mic_offload b/README.mic_offload new file mode 100644 index 000000000..514c60428 --- /dev/null +++ b/README.mic_offload @@ -0,0 +1,18 @@ +Configuring TAU for MIC offload applications. + +TAU can track both the host and mic sides of a MIC offloaded application. + +1. Configure TAU with both '-arch=mic_linux' and '-arch=x86_64'. + +2. Set TAU makefile to x86_64 Makefile. Set TAU option '-optMICOffload', compile +and link application with the TAU compiler wrappers. + +4. Set TAU environment variable: TAU_MIC_OFFLOAD=1, and MIC_PROXY_FS_ROOT=`pwd` +then run the application. + +5. Host profile will be written out as profile.0.0.* and MIC profiles will be +written out as profile.0..*. + +NOTE: MIC offloading does not work with opari/pomp. Because it obfuscates the +instrumentation process the compiler can not tell which portions of the +measurement library needs to be compiled for the MIC architecture. diff --git a/examples/mic/Makefile b/examples/mic/Makefile new file mode 100644 index 000000000..da170b8a3 --- /dev/null +++ b/examples/mic/Makefile @@ -0,0 +1,22 @@ +default: offload + +sample_native.o: sample.c + tau_cc.sh -openmp -mmic -c $< -o $@ + +sample_host.o: sample.c + tau_cc.sh -openmp -no-offload -c $< -o $@ + +sample.o: sample.c + tau_cc.sh -openmp -c $< -o $@ + +native: sample_native.o + tau_cc.sh -openmp -mmic sample_native.o -o $@ + +host: sample_host.o + tau_cc.sh -openmp -no-offload sample_host.o -o $@ + +offload: sample.o + tau_cc.sh -tau_options='-optVerbose -optMICOffload' -openmp sample.o -o $@ + +clean: + rm -f *.o native host offload diff --git a/examples/mic/sample.c b/examples/mic/sample.c new file mode 100755 index 000000000..c36bbdd25 --- /dev/null +++ b/examples/mic/sample.c @@ -0,0 +1,38 @@ +#include +#include + +#define ITERATIONS 1000000000 + +__attribute__((target(mic))) float compute_pi(int start) +{ + float pi = 0.0f; + float p16 = 1; + int i; +#pragma omp parallel for private(i) reduction(+:pi) + for (i=start; i