Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

IMSL LIBRARIES 6.0 openmp

Carolina_F_
Beginner
745 Views

Hi,

I'm trying to parallelize, with openmp style, my code (invel fortran 11.0 on visual studio 2005): # of loops (omp do) in which I use DLCONF (IMSL math libraries 6.0)

The fuction to be minimized in  DLCONF is little bit complicated and takes some global variables 'value. The point is that, I would like that it takes the  value assigned (as private) under the omp do file.

Is there no way to get dlconf to use the variables' value assigned by omp do?

Under IMSL version 7.0, is it different?

Thank your for your support,

CF
 

0 Kudos
2 Replies
Arjen_Markus
Honored Contributor II
745 Views

Well, global values are - by definition - global and therefore not private.

What you could try instead is something along these lines:

subroutine minimize_my_function( global_but_private_variable )
      type(whatever) :: global_but_private_variable

      call dlconf( ..., my_function, ... )   ! Insert correct argument list

contains 
real function my_function( x )
      my_function = x**2 + global_but_private_variable%a * x
end function my_function
end subroutine minimize_my_function

And use this minimize_my_function routine in the OMP loop with the variable global_but_private_variable declared via an OMP private clause. I am not entirely sure whether OMP knows all about derived types. I guess plain ones (no allocatables or pointers) will be "easy".

The feature used in the above code is that an internal routine like my_function can access the variables defined in the scope of the containing routine.

 

 

 

 

0 Kudos
Carolina_F_
Beginner
745 Views

Thank you so much arjenmarkus,

I'll try to implement it,

Best,

CF

0 Kudos
Reply