This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Loop Vectorization


Hi Tim,

I am currently using MPICH.   I could try MPICH in combination with OMP, but the number of processors on my workstation are currently maxed out.
The most computationally intensive loop uses derived data types within the loops that are nested 3 deep:  

do concurrent (k=mg(mlev)%kb,mg(mlev):ke:1)
do concurrent (j=mg(mlev)%jb,mg(mlev):je:1)
do concurrent (i=mg(mlev)%ib,mg(mlev):ie:2)
residual= …
mgamr(mlev,ilev)%subdomain(n)%array(i,j,k)=residual …
enddo 
enddo
enddo

It is a fragment of a Gauss-Seidel iteration.  mlev is the multigrid level.  ilev is the AMR level.  n is the subdomain.  The data dependency is eliminated by red-black ordering with a stride of 2 in the innermost loop.   The innermost loop is not vectorizing.   The specific compiler output is “note: not vectorized: control flow in loop.”

Thank you, Doug.

> On Jun 20, 2016, at 12:53 AM, Tim Prince <n8tm@aol.com> wrote:
> 
> On 6/20/2016 2:11 AM, Tobias Burnus wrote:
>> Hello,
>> 
>> sdcycling wrote:
>>> I am using gfortran to build a finite-difference code.   How do I tell
>>> whether a do loop is being vectorized?
>> Try the -fopt-info-... options of GCC, in particular
>> -fopt-info-vec-optimized
>> 
>>> Also, how do I use compiler directives in gfortran to indicate that a
>>> do loop does not have any data dependencies?
>> 
>> Not as directive, but using Fortran's "DO CONCURRENT" instead of a
>> normal DO will imply this.
>> 
> !$ omp simd may be useful, if your objective is simd vectorization.
> 
> 
> -- 
> Tim Prince


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]