Newsgroups: comp.parallel
From: "Andrew Mc.Ghee" <mcghee@sun.mech.uq.edu.au>
Subject: Fujitsu VPP300 C compiler
Organization: Mechanical Engineering, UQ
Date: 30 Jan 1997 14:16:44 GMT
Message-ID: <5cqagc$g5n@server1.ctc.com>

This posting may not be entirely relevant to this newsgroup, if anyone
could re-direct me to where I can find assistance with this problem I
would be most appreciative.

I am specifically looking for someone with experience with the C
compiler on the Fujitsu VPP300 supercomputers - and more exactly, with
some knowledge of the vecorization aspects of this compiler.

We are trying to port software that runs in MPI over to this hardware
but are having difficulty in ensuring that the C compiler addequately
recognizes that it can vectorize code. We believe that the problem may
be that we do not know all the switches available to force the compiler
to correctly vectorize the code. If anyone can shed light on our
problem, please contact us,

I've attached a small test snippet of code below to show the problem we
face, esentially are able to vectorize the code when it is a single
loop, bu when we introduce a dual loop, the compiler loses the plot (and
so do we...), any ideas, or suggestions how to aleviate the problem?
(The only solution we can presently think of at the moment is to remove
the inner loop into a routine call, to fool the compiler into not
recognizing that it is an inner loop, but I believe that we shouldn't
have to do this)

For note for those interested, but not familiar with the VPP300, lines
that have the flag "v" on them have been successfully vectorized by the
compiler.

regards,
Andrew Mc.Ghee
Mechanical Engineering
University of Queensland

----------------- CUT HERE ------- 8< -------

The problem is involving imbedded loops, it appears that the compiler does
not correctly (or is over-cautious) when I use nested loops.
An example is that the following loop vectorizes;

00000023    /*    for (ix = ixmin; ix <= ixmax; ix++) { */
00000024        HF = B->HF[ix];
00000025            if(B->axisymm == 1) { /* 2D AXISYMMETRIC FLOW */
00000026 v              for(iy = iymin; iy < iymax+1; iy++) {
00000027 v                  kev = 0.5 * (iU * iU + iV * iV);
00000028 v                  ybarv = 0.5 * (Vtx_L[iy].Y + Vtx_R[iy].Y);
00000029 v                  HF[iy].F_r = iRHO * iU * ybarv;
00000030 v                  HF[iy].G_r = iRHO * iV * ybarv;
00000031 v                  HF[iy].F_ru= (iRHO * iU * iU + iP) * ybarv;
00000032 v                  HF[iy].G_ru= iRHO * iU * iV * ybarv;
00000033 v                  HF[iy].F_rv= iRHO * iV * iU * ybarv;
00000034 v                  HF[iy].G_rv= (iRHO * iV * iV + iP) * ybarv;
00000035 v                  HF[iy].F_rE= (iRHO * iU * iE + iP * iU) * ybarv;
00000036 v                  HF[iy].G_rE= (iRHO * iV * iE + iP * iV) * ybarv;
00000037 v              }
00000038            }
00000039     /*   } */

But does not when nested within another loop;

00000023        for (ix = ixmin; ix <= ixmax; ix++) {
00000024        HF = B->HF[ix];
00000025            if(B->axisymm == 1) { /* 2D AXISYMMETRIC FLOW */
00000026                for(iy = iymin; iy < iymax+1; iy++) {
00000027                    kev = 0.5 * (iU * iU + iV * iV);
00000028                    ybarv = 0.5 * (Vtx_L[iy].Y + Vtx_R[iy].Y);
00000029                    HF[iy].F_r = iRHO * iU * ybarv;
00000030                    HF[iy].G_r = iRHO * iV * ybarv;
00000031                    HF[iy].F_ru= (iRHO * iU * iU + iP) * ybarv;
00000032                    HF[iy].G_ru= iRHO * iU * iV * ybarv;
00000033                    HF[iy].F_rv= iRHO * iV * iU * ybarv;
00000034                    HF[iy].G_rv= (iRHO * iV * iV + iP) * ybarv;
00000035                    HF[iy].F_rE= (iRHO * iU * iE + iP * iU) * ybarv;
00000036                    HF[iy].G_rE= (iRHO * iV * iE + iP * iV) * ybarv;
00000037                }
00000038            }
00000039        }

Producing the following error messages;

  "temp.c", line 26: This loop is not vectorized since loop structure is
complicated. 
  "temp.c", line 26: The direction of while condition and the direction of
loop variable change of this loop may be reverse, so this loop is not
vectorizable.

--
Articles to parallel@ctc.com (Administrative: bigrigg@ctc.com)
Archive: http://www.hensa.ac.uk/parallel/internet/usenet/comp.parallel


