"Fossies" - the Fresh Open Source Software Archive

Member "berkeley_upc-2019.4.2/upc-tests/gwu-npb-upc/BTIO/add.c" (27 May 2019, 1130 Bytes) of package /linux/misc/berkeley_upc-2019.4.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "add.c" see the Fossies "Dox" file reference documentation.

    1 /*--------------------------------------------------------------------
    2   NAS Parallel Benchmarks 2.3 UPC version - BT source code tree
    3   2004 - GWU - HPCL -- check bt.c for complete information
    4   --------------------------------------------------------------------*/
    5 
    6 #include <stdio.h>
    7 #include <upc_relaxed.h>
    8 #include "functions.h"
    9 
   10 void add(void)
   11 {
   12   int c, i, j, k, m;
   13 
   14   /*--------------------------------------------------------------------
   15     --------------------------------------------------------------------*/
   16   
   17   /*--------------------------------------------------------------------
   18     c addition of update to the vector u
   19     c-------------------------------------------------------------------*/
   20   for (c = 0; c < ncells; c++ )
   21     {
   22       for (i = startc[c][0]; i < cell_size[c][0]-endc[c][0]; i++)
   23     {
   24       for (j = startc[c][1]; j < cell_size[c][1]-endc[c][1]; j++)
   25         {
   26           for (k = startc[c][2]; k < cell_size[c][2]-endc[c][2]; k++)
   27         {
   28           for (m = 0; m < 5; m++)
   29             {
   30               u_priv_d(c,i+2,j+2,k+2,m) = 
   31             u_priv_d(c,i+2,j+2,k+2,m) + 
   32             rhs_priv_d(c,i+1,j+1,k+1,m);
   33             }
   34         }
   35         }
   36     }
   37     }
   38 }