- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I've a general question about F90. I've heard thatlots of "if ... else" statements slow down the code?
Especially with optimization and when one is trying to parallel the code.
Is this true? Or is this too general to define?
thanks!
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In general, yes, it would. Conditional statements pose difficulty for parallelization and vectorization, and a long series of IF-THEN can also cause instruction cache misses and other effects. But if that's what makes the code clearest, then use it.
This is not unique to Fortran - it would apply to any language.
This is not unique to Fortran - it would apply to any language.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In general, yes, it would. Conditional statements pose difficulty for parallelization and vectorization, and a long series of IF-THEN can also cause instruction cache misses and other effects. But if that's what makes the code clearest, then use it.
This is not unique to Fortran - it would apply to any language.
This is not unique to Fortran - it would apply to any language.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page