Ignore:
Timestamp:
Mar 31, 2016, 12:01:42 PM (9 years ago)
Author:
alain
Message:

Cosmetic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/ocean/main.c

    r806 r813  
    1515/*************************************************************************/
    1616
    17 /*************************************************************************/
    18 /*                                                                       */
    19 /*  SPLASH Ocean Code                                                    */
    20 /*                                                                       */
    21 /*  This application studies the role of eddy and boundary currents in   */
    22 /*  influencing large-scale ocean movements.  This implementation uses   */
    23 /*  dynamically allocated four-dimensional arrays for grid data storage. */
    24 /*                                                                       */
    25 /*  Main parameters are :                                                */
    26 /*                                                                       */
    27 /*     - M : Simulate MxM ocean. M must be (power of 2) +2.              */
    28 /*     - N : N = number of threads. N must be power of 4.                */
    29 /*     - E : E = error tolerance for iterative relaxation.               */
    30 /*     - R : R = distance between grid points in meters.                 */
    31 /*     - T : T = timestep in seconds.                                    */
    32 /*                                                                       */
    33 /*************************************************************************/
    34 
    3517///////////////////////////////////////////////////////////////////////////
    36 // This is the porting of the SLASH Ocean application on the GIET-VM
    37 // operating system, for the TSAR manycores architecture.
    38 // Done by Alain greiner (march 2016).
     18//  This is the port of the SPLASH OCEAN application on the GIET-VM
     19//  operating system, for the TSAR manycores architecture.
     20//  Done by Alain greiner (march 2016).
     21//
     22//  This application studies the role of eddy and boundary currents in 
     23//  influencing large-scale ocean movements.  This implementation uses   
     24//  dynamically allocated four-dimensional arrays for grid data storage,
     25//  distributed in all clusters (one square sub-grid per thread).
     26//  The two main parameters are :                                             
     27//     - M : MxM define the grid size. M must be (power of 2) +2.           
     28//     - N : N = number of threads. N must be power of 4.
     29//  Other parameters are :
     30//     - E : E = error tolerance for iterative relaxation.   
     31//     - R : R = distance between grid points in meters.   
     32//     - T : T = timestep in seconds.                   
    3933///////////////////////////////////////////////////////////////////////////
    4034
     35// parameters
    4136#define DEFAULT_M        258
    4237#define DEFAULT_E        1e-7
    4338#define DEFAULT_T    28800.0
    4439#define DEFAULT_R    20000.0
     40
     41// constants
    4542#define UP               0
    4643#define DOWN             1
     
    5148#define DOWNLEFT         6
    5249#define DOWNRIGHT        7
    53 #define PAGE_SIZE     4096
    5450#define MAX_THREADS   1024
    5551
     
    167163    start_time = giet_proctime();
    168164
     165    // allocate shared TTY & initialise tty_lock
     166    giet_tty_alloc( 1 );     
     167    lock_init( &tty_lock);
     168
    169169    // compute number of threads : nprocs
    170170    // as we want one thread per processor, it depends on the
     
    191191                         "[OCEAN ERROR] mesh_y_size and mesh_y_size must be equal");
    192192
    193     // check the ocean size : M*M grid / (M-2) mut be power of 2
    194 
    195193    giet_pthread_assert( (im == 34)  || (im == 66)  || (im == 130) ||
    196194                         (im == 258) || (im == 514) || (im == 1026),
    197195                         "[OCEAN ERROR] grid side must be 34,66,130,258,514,1026");
    198    
    199     // initialise distributed heap
    200     for ( x = 0 ; x < mesh_x_size ; x++ )
    201     {
    202         for ( y = 0 ; y < mesh_y_size ; y++ )
    203         {
    204             heap_init( x , y );
    205         }
    206     }
    207 
    208     // allocate shared TTY & initialise tty_lock
    209     giet_tty_alloc( 1 );     
    210     lock_init( &tty_lock);
    211196
    212197    giet_tty_printf("\n[OCEAN] simulation with W-cycle multigrid solver\n"
     
    215200                    mesh_x_size , mesh_y_size , procs_per_cluster, im , jm );
    216201
    217     // initialise distributed barrier
     202    // initialise distributed heap
     203    for ( x = 0 ; x < mesh_x_size ; x++ )
     204    {
     205        for ( y = 0 ; y < mesh_y_size ; y++ )
     206        {
     207            heap_init( x , y );
     208        }
     209    }
     210
     211        // initialise distributed barrier
    218212    sqt_barrier_init( &barrier , mesh_x_size , mesh_y_size , procs_per_cluster );
    219213
     
    522516    char string[256];
    523517
    524     snprintf( string , 256 , "/home/ocean_%d_%d_%d" ,
    525               mesh_x_size , mesh_y_size , procs_per_cluster );
     518    snprintf( string , 256 , "/home/ocean_%d_%d_%d_%d_d" ,
     519              mesh_x_size , mesh_y_size , procs_per_cluster , DEFAULT_M , DEFAULT_M );
    526520
    527521    // open instrumentation file
Note: See TracChangeset for help on using the changeset viewer.