On task directive

General OpenMP discussion

On task directive

Postby gonski » Mon Feb 11, 2008 8:48 pm

Code: Select all
integer tp
!$omp threadprivate(tp)
         integer var
         tp=1
!$omp parallel
!$omp task
         tp = tp + 1
!$omp task
!$omp end task
         var = tp ! value does not change after write above
!$omp end task
!$omp end parallel

         end


Why the compiling the above code gives the following errors (here intel compiler v10 is used):

ifort 1.f -fpp -openmp -o nspff
fortcom: Error: 1.f, line 6: Invalid directive.
!$omp task
^
fortcom: Error: 1.f, line 8: Invalid directive.
!$omp task
^
fortcom: Error: 1.f, line 9: Syntax error, found IDENTIFIER 'TASK' when expecting one of: PARALLELDO PARALLELSECTIONS PARALLELWORKSHARE PARALLEL SINGLE CRITICAL MASTER DO ...
!$omp end task
----------^
fortcom: Error: 1.f, line 11: Syntax error, found IDENTIFIER 'TASK' when expecting one of: PARALLELDO PARALLELSECTIONS PARALLELWORKSHARE PARALLEL SINGLE CRITICAL MASTER DO ...
!$omp end task
----------^
fortcom: Error: 1.f, line 9: This OpenMP END directive does not match the OpenMP block directive at the top of the stack.
!$omp end task
----------^
fortcom: Error: 1.f, line 11: Misplaced part of an OpenMP parallel directive.
!$omp end task
----------^
fortcom: Error: 1.f, line 12: Misplaced part of an OpenMP parallel directive.
!$omp end parallel
----------^
compilation aborted for 1.f (code 1)
make: *** [nspff] Error 1
gonski
 
Posts: 26
Joined: Fri Jan 18, 2008 10:58 pm

Re: On task directive

Postby ejd » Wed Feb 13, 2008 10:25 am

I do not work for Intel, so I can not tell you when they will have an implementation that supports the OpenMP V3 spec. For that matter, the OpenMP V3 spec has not yet been approved and won't be yet for a couple of months. In any case, Intel had implemented their own tasking before. It is known as taskq and is somewhat different from the form that will be in OpenMP V3. It is documented in their manuals and has the form:

Code: Select all
#pragma intel omp taskq [clause[[,]clause]...]
structured-block

Note the difference in the directive format. This is Intel specific, so they have denoted it as such.
ejd
 
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am

Re: On task directive

Postby gonski » Wed Feb 13, 2008 2:09 pm

Thanks. It seems taskq is only available in intel c/c++.
gonski
 
Posts: 26
Joined: Fri Jan 18, 2008 10:58 pm


Return to Using OpenMP

Who is online

Users browsing this forum: Google [Bot] and 9 guests