-
Notifications
You must be signed in to change notification settings - Fork 154
Relax the statement order for symbol/$-variable declarations - #296
Conversation
coveralls
commented
Oct 26, 2018
In issue #188 you mention wanting to put ModuleOption noparallel anywhere, but noparallel is not in the allowed list of this commit. Is there a problem with that option?
tueda
commented
Jul 7, 2022
Maybe I just forgot to add noparallel, or maybe some problem; I don't remember exactly. For consistency, other module options could be added, too.
On the other hand, if in one module both local and noparallel are specified, then it indicates some conflicts between a part that should be parallelized and a part that should be executed in the non-parallel mode. Errors/warnings could be useful in such cases.
benruijl
commented
Jul 7, 2022
Can we simply allow all ModuleOptions to be specified anywhere in the module?
tueda
commented
Jul 11, 2022
Maybe it would not be a problem if we give warnings/errors for inconsistent use of ModuleOptions, for example using both local and noparallel or polyratfun twice with different functions/options. The latter is dangerous because it occurs when two subroutines (procedures called in a module) assume different polyratfuns and probably leads to a wrong result.
jodavies
commented
Jul 11, 2022
What is actually inconsistent about using both local and noparallel? This should be in the end equivalent to running the code with form or tform -w1 should it not?
tueda
commented
Jul 11, 2022
Yes, you are right. But this potentially indicates a performance issue (parallel part and no-parallel part in a module mistakenly), which is easily found if one has to write ModuleOptions only at the end of a module while may be difficult to recognize when ModuleOptions are distributed over a big module, especially inside procedures.
jodavies
commented
Nov 7, 2024
I think it would be interesting to resurrect this for v5?
tueda
commented
Jun 20, 2025
Actually, which ordering relaxations should we include in version 5? Do we have consensus?
jodavies
commented
Jun 20, 2025
Certainly the dollar-related moduleoptions were a request at the workshop. What does your code comment mean by "mixed statements"?
vermaseren
commented
Jun 20, 2025
via email
tueda
commented
Jun 20, 2025
@jodavies, by "mixed statements", I meant statements with the MIXED flag. One problem is that we now also have the MIXED2 flag.
@vermaseren, you mean all declarations and all moduleoptions are free to be relocated?? Or are exceptions only between declarations and moduleoptions? (But it is not so useful...)
jodavies
commented
Jun 20, 2025
OK, so this means only print and printtable? The MIXED2 flag does not appear to have any associated statements?
tueda
commented
Jun 20, 2025
Yes. So the question is the purpose of MIXED2. Maybe it was created for these declarations and module options?
tueda
commented
Dec 1, 2025
I will open a follow-up PR that only relaxes the allowed positions of ModuleOption for $-variables (e.g., ModuleOption local). This could be adopted in version 5.
From a forgotten Issue #188. We don't need to follow the FORTRAN style for symbol/$-variable declaration: