-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for MIC offloading. The process to get TAU working on both th…
…e host and device at the same time is a little messy--in part because of gaps in Intel's MIC software stack which should hopefully be resolved in future releases. See README.mic_offload and examples/mic for the steps to instrument offload applications. This does not work with opari. Given the convoluted pomp instrumentation method this would be a substatial amount of work to extend to MIC offloading. Former-commit-id: 099cf96afddf8b94ae981c336c59ddc0756260f0
- Loading branch information
Scott Biersdorff
committed
Aug 30, 2012
1 parent
d15bf72
commit cc35bc6
Showing
7 changed files
with
87 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.<pid>.*. | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include <stdio.h> | ||
#include <math.h> | ||
|
||
#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<start+ITERATIONS/2; i++) | ||
{ | ||
p16 = pow(16,i); | ||
pi += 1.0/p16 * (4.0/(8*i + 1) - 2.0/(8*i + 4) - | ||
1.0/(8*i + 5) - 1.0/(8*i + 6)); | ||
} | ||
return pi; | ||
} | ||
|
||
int main() | ||
{ | ||
float pi = 0.0f; | ||
|
||
//First offload half the computation to the mic card. | ||
#pragma offload target (mic) | ||
{ | ||
pi = compute_pi(0); | ||
} | ||
|
||
//Compute the second half on the host. | ||
{ | ||
pi += compute_pi(ITERATIONS/2); | ||
} | ||
|
||
printf("Approximation of PI: %.20f.\n", pi); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters