openmp 3.0 feature: error detection capability kang su gatlin visual c++ program manager

11
OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager

Post on 20-Dec-2015

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OpenMP 3.0 Feature: Error Detection Capability Kang Su Gatlin Visual C++ Program Manager

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

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

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

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

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

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

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

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

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

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

II WW

OO

MM PP