Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > Re: Using exter...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 23 Topic 8180 of 8775
Post > Topic >>

Re: Using external subroutines in OpenMP?

by jomarbueyes@[EMAIL PROTECTED] Apr 26, 2008 at 10:36 PM

On Apr 26, 6:12 am, Sebastian Hanigk <han...@[EMAIL PROTECTED]
> wrote:
> jomarbue...@[EMAIL PROTECTED]
 writes:
> > Can someone clue me on how to call external subroutines from within a
> > parallel construct? As I understand, the OpenMP standard states that
> > all variables local to subroutines and functions within a parallel
> > construct are private.
>
> Essentially your called routines should be thread-safe (reentrant),
> i.e. no external state, global data access secured with mutexes, ...
>
> Write those routines like you would write subprograms in a functional
> language (no side effects, result depends only on passed arguments, no
> argument modification) and you get reentrancy for free.
>
> Sebastian

Dear Sebastian,

Thank you for your answer. The subroutines are indeed written in as
functional language. They are old Fortran 77 subroutines translated to
Fortran 90. The subroutines us neither "save" nor "common" (or modules
either). As you suggest the subroutines and main program are compiled
as reentrant ("-reentrancy threaded" in the ifort compiler) and the
results depend only on the passed arguments. However, one of the
purposes of the subroutines is in-place computation. One of the
arguments has to be changed by the subroutine. This is one of the
reasons I use the copy-in, copy-out approach giving each thread a
private array or a different ****tion of an array declared shared.
Neither approached worked.

Thanks again for your suggestions.

Jomar
 




 23 Posts in Topic:
Using external subroutines in OpenMP?
jomarbueyes@[EMAIL PROTEC  2008-04-25 18:36:24 
Re: Using external subroutines in OpenMP?
Reinhold Bader <Bader@  2008-04-26 11:26:33 
Re: Using external subroutines in OpenMP?
Sebastian Hanigk <hani  2008-04-26 13:12:32 
Re: Using external subroutines in OpenMP?
glen herrmannsfeldt <g  2008-04-26 09:01:53 
Re: Using external subroutines in OpenMP?
Sebastian Hanigk <hani  2008-04-26 19:29:05 
Re: Using external subroutines in OpenMP?
Charles Coldwell <cold  2008-04-27 11:27:29 
Re: Using external subroutines in OpenMP?
Sebastian Hanigk <hani  2008-04-27 17:45:31 
Re: Using external subroutines in OpenMP?
Charles Coldwell <cold  2008-04-27 22:26:50 
Re: Using external subroutines in OpenMP?
jomarbueyes@[EMAIL PROTEC  2008-04-26 22:25:35 
Re: Using external subroutines in OpenMP?
jomarbueyes@[EMAIL PROTEC  2008-04-26 22:36:54 
Re: Using external subroutines in OpenMP?
jomarbueyes@[EMAIL PROTEC  2008-04-26 22:44:18 
Re: Using external subroutines in OpenMP?
jomarbueyes@[EMAIL PROTEC  2008-04-27 07:53:59 
Re: Using external subroutines in OpenMP?
Sebastian Hanigk <hani  2008-04-27 17:38:32 
Re: Using external subroutines in OpenMP?
Charles Coldwell <cold  2008-04-27 22:14:11 
Re: Using external subroutines in OpenMP?
"James Van Buskirk&q  2008-04-27 17:04:45 
Re: Using external subroutines in OpenMP?
Charles Coldwell <cold  2008-04-28 11:19:45 
Re: Using external subroutines in OpenMP?
jomarbueyes@[EMAIL PROTEC  2008-04-28 08:47:32 
Re: Using external subroutines in OpenMP?
Charles Coldwell <cold  2008-04-29 12:08:17 
Re: Using external subroutines in OpenMP?
jomarbueyes@[EMAIL PROTEC  2008-04-28 09:26:26 
Re: Using external subroutines in OpenMP?
Tobias Burnus <burnus@  2008-04-28 09:57:56 
Re: Using external subroutines in OpenMP?
jomarbueyes@[EMAIL PROTEC  2008-04-28 15:21:19 
Re: Using external subroutines in OpenMP?
jomarbueyes@[EMAIL PROTEC  2008-04-28 19:34:56 
Re: Using external subroutines in OpenMP?
jomarbueyes@[EMAIL PROTEC  2008-04-29 07:46:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 8:36:02 CDT 2008.