- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page