- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Will the local data inFortran's pure subroutines ever "cross wires" due to parallel read-modify-write in different threads?
- Balises:
- Intel® Fortran Compiler
Lien copié
7 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
If you're using /parallel or OpenMP that is coded properly, there should not be a problem. Pure routines really aren't anything special in this regard.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Yes, I have an OMP PARALLEL DO loop. The loop index is used to specify a different element of an array. Only that specific element is passed into the pure subroutine. So all the affected data from outside the pure subroutine is preperly segreated by thread.
The real question is - does the locally declared data in the called subroutine need to have OMP directives to prevent interaction between threads?
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
By default,. all variables are "automatic" (stack allocated) when OpenMP is used. So unless you did something that woild force static allocation (SAVE or initialization), nothing should need to be done.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Does the POINTER attribute cause a variable to be STATIC when there is no initialization?
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
No.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Does theTARGET attribute cause a variable to be STATIC when there is no initialization?
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
No. The only thing that forces static allocation for local variables is the SAVE attribute, either explicit or implicit. The only way you get SAVE implicitly is with initialization.

Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable