Re: forall and do loop



*** Hendrickson wrote:

I think it's generally a mistake to use FORALL unless you have some
good reason. Clarity of code is a good reason, so is [hardware
specific] optimization. The main (only?) "problem" with FORALL
is that people are surprised by the general need for temporaries
when storing.


From this, I'd like to conclude that FORALL performance problems are to be expected "only?" when there is possible overlap between the right and left sides of assignments (putting aside the question of whether OpenMP parallel could work effectively with FORALL).
After 15 years of f90 compilers, we still can't count on compilers trying the known strategies to avoid temporaries in array assignments, or even cleaning up the code when they recognize opportunity to eliminate a temporary. With relatively infrequent usage of FORALL and greater potential complexity, such problems remain likely.
.


Quantcast