Changeset 813 for soft/giet_vm/applications/ocean
- Timestamp:
- Mar 31, 2016, 12:01:42 PM (9 years ago)
- Location:
- soft/giet_vm/applications/ocean
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/ocean/Makefile
r800 r813 20 20 INCLUDES = -I. -I../.. -I../../giet_libs -I../../giet_xml 21 21 22 LIB_DEPS = ../../build/libs/libuser.a 22 LIB_DEPS = ../../build/libs/libuser.a ../../build/libmath.a 23 23 24 24 CFLAGS := -O2 -g -Wall -fomit-frame-pointer -mno-gpopt -fno-delete-null-pointer-checks … … 28 28 .PHONY: clean 29 29 30 appli.elf: $(OBJS) $(APP_NAME).ld $(LIBS_DEPS) 30 appli.elf: $(OBJS) $(APP_NAME).ld $(LIBS_DEPS) $(APP_NAME).py 31 31 $(LD) -o $@ -T $(APP_NAME).ld $(OBJS) $(LIBS) 32 32 $(DU) -D $@ > $@.txt -
soft/giet_vm/applications/ocean/main.c
r806 r813 15 15 /*************************************************************************/ 16 16 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 35 17 /////////////////////////////////////////////////////////////////////////// 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. 39 33 /////////////////////////////////////////////////////////////////////////// 40 34 35 // parameters 41 36 #define DEFAULT_M 258 42 37 #define DEFAULT_E 1e-7 43 38 #define DEFAULT_T 28800.0 44 39 #define DEFAULT_R 20000.0 40 41 // constants 45 42 #define UP 0 46 43 #define DOWN 1 … … 51 48 #define DOWNLEFT 6 52 49 #define DOWNRIGHT 7 53 #define PAGE_SIZE 409654 50 #define MAX_THREADS 1024 55 51 … … 167 163 start_time = giet_proctime(); 168 164 165 // allocate shared TTY & initialise tty_lock 166 giet_tty_alloc( 1 ); 167 lock_init( &tty_lock); 168 169 169 // compute number of threads : nprocs 170 170 // as we want one thread per processor, it depends on the … … 191 191 "[OCEAN ERROR] mesh_y_size and mesh_y_size must be equal"); 192 192 193 // check the ocean size : M*M grid / (M-2) mut be power of 2194 195 193 giet_pthread_assert( (im == 34) || (im == 66) || (im == 130) || 196 194 (im == 258) || (im == 514) || (im == 1026), 197 195 "[OCEAN ERROR] grid side must be 34,66,130,258,514,1026"); 198 199 // initialise distributed heap200 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_lock209 giet_tty_alloc( 1 );210 lock_init( &tty_lock);211 196 212 197 giet_tty_printf("\n[OCEAN] simulation with W-cycle multigrid solver\n" … … 215 200 mesh_x_size , mesh_y_size , procs_per_cluster, im , jm ); 216 201 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 218 212 sqt_barrier_init( &barrier , mesh_x_size , mesh_y_size , procs_per_cluster ); 219 213 … … 522 516 char string[256]; 523 517 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 ); 526 520 527 521 // open instrumentation file
Note: See TracChangeset
for help on using the changeset viewer.