
\section*{Example mapping}

Input code\ldots
\begin{verbatim}
  REAL B (N)
  REAL A (N, N)

  FORALL (I = 1 : N, J = 1 : N)
    a (I, J) = FUN1 (I) + (b (J) + FUN2 (J))
  ENDFORALL
\end{verbatim}
translation\ldots
\begin{verbatim}
  array float b [i_b]
  array float a [i_a, j_a]

  array float temp1 [i_b] ;
  // temp1 = b [j] + fun2(j) ;
  where(i_b)
    temp1 = b + fun2(i_b) ;

  array float temp2 [j_a] ;
  remap(temp2, temp1) ;       // communication !

  // a [i, j] = fun1(i) + temp2 [j] ;
  where(i_a) {
    float temp3 = fun1(i_a) ;
    where(i_b)
      a = temp3 + temp2 ;
  }
\end{verbatim}

