Tasks nbn nbn nb30 2692537 way too

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: children tasks generated since the beginning of the current (implicit or explicit) task. !   The taskwait directive specifies a wait on the completion of direct children tasks, not all descendent tasks. Example: nfib // nfib counts the number of nodes in the fib call tree int nfib(long n) { long i, j; if (n<2) return 1; else { #pragma omp task shared(i) i=nfib(n- 1); #pragma omp task shared(j) j=nfib(n- 2); #pragma omp taskwait return i+j+1; } } nfib’s main int main(int argc, char **argv){ … #pragma...
View Full Document

This note was uploaded on 02/12/2014 for the course CS 475 taught by Professor Staff during the Fall '08 term at Colorado State.

Ask a homework question - tutors are online