OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager.
-
date post
20-Dec-2015 -
Category
Documents
-
view
219 -
download
0
Transcript of OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager.
![Page 1: OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager.](https://reader036.fdocuments.in/reader036/viewer/2022062421/56649d4e5503460f94a2df5d/html5/thumbnails/1.jpg)
OpenMP 3.0 Feature:Error Detection CapabilityOpenMP 3.0 Feature:Error Detection Capability
Kang Su GatlinVisual C++ Program Manager
![Page 2: OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager.](https://reader036.fdocuments.in/reader036/viewer/2022062421/56649d4e5503460f94a2df5d/html5/thumbnails/2.jpg)
Why?Why?
OpenMP as it stands today is great for HPCOpenMP as it stands today is less appropriate for server side or enterprise applicationsThere is simply no mechanism for error recovery – or even detection
![Page 3: OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager.](https://reader036.fdocuments.in/reader036/viewer/2022062421/56649d4e5503460f94a2df5d/html5/thumbnails/3.jpg)
IdeasIdeas
We say “ideas” and not “proposals”Not even half-baked
Exception basedCall-back function basedError-code based
![Page 4: OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager.](https://reader036.fdocuments.in/reader036/viewer/2022062421/56649d4e5503460f94a2df5d/html5/thumbnails/4.jpg)
The ProblemThe Problem
#pragma omp parallel// Code here
#pragma omp barrier// Code here
#pragma omp critical// Code here
![Page 5: OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager.](https://reader036.fdocuments.in/reader036/viewer/2022062421/56649d4e5503460f94a2df5d/html5/thumbnails/5.jpg)
Idea 1: An Exception Based ApproachIdea 1: An Exception Based Approach
Define an OpenMP Exception Class:class OMPException {…};
Use try/catch around select constructsint foo() {
try {
#pragma omp parallel
// Code here
}
catch (OMPException *e) {
// Code here
}
![Page 6: OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager.](https://reader036.fdocuments.in/reader036/viewer/2022062421/56649d4e5503460f94a2df5d/html5/thumbnails/6.jpg)
Idea 1: Exception Based ApproachIdea 1: Exception Based Approach
ProsSeems easy to implementExtensible
The exception can have info about what happened
ConsOnly C++, not supported in CCan have large perf degredation
![Page 7: OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager.](https://reader036.fdocuments.in/reader036/viewer/2022062421/56649d4e5503460f94a2df5d/html5/thumbnails/7.jpg)
Idea 2: Error Code Based ApproachIdea 2: Error Code Based Approach
Add a new clause to directivesThis one sets an error code in a passed address of type OMPError when error occurs
OMPError *ompErr = new OMPError;
#pragma omp parallel for error(ompErr)
![Page 8: OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager.](https://reader036.fdocuments.in/reader036/viewer/2022062421/56649d4e5503460f94a2df5d/html5/thumbnails/8.jpg)
Idea 2: Error Code Based ApproachIdea 2: Error Code Based Approach
ProsAlso seems easy to implementSupports all languagesVery general
ConsMaybe violates the “even works as expected compiled serially”Code to handle error is added directly to computational portion of code
![Page 9: OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager.](https://reader036.fdocuments.in/reader036/viewer/2022062421/56649d4e5503460f94a2df5d/html5/thumbnails/9.jpg)
Idea 3: Callback-Based ApproachIdea 3: Callback-Based Approach
Add a new clause to directives:
#pragma omp parallel error_callback(error, flag)
void error(int *flag) { // User code here}
![Page 10: OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager.](https://reader036.fdocuments.in/reader036/viewer/2022062421/56649d4e5503460f94a2df5d/html5/thumbnails/10.jpg)
Idea 3: Callback-Based ApproachIdea 3: Callback-Based Approach
ProsLittle performance impact if no errorCode is kept away from site of the computation
ConsLess extensibleNot really clear if it really does anything useful, but I like callbacks
![Page 11: OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager.](https://reader036.fdocuments.in/reader036/viewer/2022062421/56649d4e5503460f94a2df5d/html5/thumbnails/11.jpg)
II WW
OO
MM PP