[cig-commits] r19262 - in seismo/2D/SPECFEM2D/trunk/src: meshfem2D specfem2D

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Fri Dec 2 09:54:15 PST 2011


Author: dkomati1
Date: 2011-12-02 09:54:15 -0800 (Fri, 02 Dec 2011)
New Revision: 19262

Modified:
   seismo/2D/SPECFEM2D/trunk/src/meshfem2D/save_databases.f90
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.f90
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90
Log:
added a check about the fact that one uses more than one Database file and one processus when running an MPI simulation


Modified: seismo/2D/SPECFEM2D/trunk/src/meshfem2D/save_databases.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/meshfem2D/save_databases.f90	2011-12-02 13:49:12 UTC (rev 19261)
+++ seismo/2D/SPECFEM2D/trunk/src/meshfem2D/save_databases.f90	2011-12-02 17:54:15 UTC (rev 19262)
@@ -100,8 +100,8 @@
     call write_partition_database(15, iproc, nspec, num_material, ngnod, 1)
 
 
-    write(15,*) 'npgeo'
-    write(15,*) npgeo
+    write(15,*) 'npgeo nproc'
+    write(15,*) npgeo,nproc
 
     write(15,*) 'gnuplot interpol'
     write(15,*) gnuplot,interpol

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.f90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.f90	2011-12-02 13:49:12 UTC (rev 19261)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.f90	2011-12-02 17:54:15 UTC (rev 19262)
@@ -45,7 +45,7 @@
 
 
   subroutine read_databases_init(myrank,ipass, &
-                  simulation_title,SIMULATION_TYPE,NOISE_TOMOGRAPHY,SAVE_FORWARD,npgeo, &
+                  simulation_title,SIMULATION_TYPE,NOISE_TOMOGRAPHY,SAVE_FORWARD,npgeo,nproc, &
                   gnuplot,interpol,NTSTEP_BETWEEN_OUTPUT_INFO, &
                   output_postscript_snapshot,output_color_image,colors,numbers, &
                   meshvect,modelvect,boundvect,cutsnaps,subsamp_postscript,sizemax_arrows, &
@@ -65,7 +65,7 @@
 
   integer :: myrank,ipass
   character(len=60) simulation_title
-  integer :: SIMULATION_TYPE,NOISE_TOMOGRAPHY,npgeo
+  integer :: SIMULATION_TYPE,NOISE_TOMOGRAPHY,npgeo,nproc
   integer :: colors,numbers,subsamp_postscript,seismotype,imagetype
   logical :: SAVE_FORWARD,gnuplot,interpol,output_postscript_snapshot, &
     output_color_image
@@ -154,7 +154,7 @@
   read(IIN,*) SIMULATION_TYPE, NOISE_TOMOGRAPHY, SAVE_FORWARD
 
   read(IIN,"(a80)") datlin
-  read(IIN,*) npgeo
+  read(IIN,*) npgeo,nproc
 
   read(IIN,"(a80)") datlin
   read(IIN,*) gnuplot,interpol

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90	2011-12-02 13:49:12 UTC (rev 19261)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/specfem2D.F90	2011-12-02 17:54:15 UTC (rev 19262)
@@ -677,7 +677,7 @@
 
 ! for MPI and partitioning
   integer  :: ier
-  integer  :: nproc
+  integer  :: nproc,nproc_read_from_database
   integer  :: myrank
   character(len=150) :: outputname,outputname2
 
@@ -888,12 +888,16 @@
   call initialize_simulation(nproc,myrank,NUMBER_OF_PASSES, &
                   ninterface_acoustic,ninterface_elastic,ninterface_poroelastic)
 
+#ifdef USE_MPI
+  if(nproc <= 1) stop 'should have nproc > 1 when running an MPI simulation'
+#endif
+
   ! starts reading in Database file
   ! it is necessary to duplicate this call before the loop on ipass = 1,NUMBER_OF_PASSES
   ! because we need to read the value of logical flag PERFORM_CUTHILL_MCKEE
   ipass = 1
   call read_databases_init(myrank,ipass, &
-                  simulation_title,SIMULATION_TYPE,NOISE_TOMOGRAPHY,SAVE_FORWARD,npgeo, &
+                  simulation_title,SIMULATION_TYPE,NOISE_TOMOGRAPHY,SAVE_FORWARD,npgeo,nproc_read_from_database, &
                   gnuplot,interpol,NTSTEP_BETWEEN_OUTPUT_INFO, &
                   output_postscript_snapshot,output_color_image,colors,numbers, &
                   meshvect,modelvect,boundvect,cutsnaps,subsamp_postscript,sizemax_arrows, &
@@ -905,6 +909,10 @@
                   factor_subsample_image,USE_SNAPSHOT_NUMBER_IN_FILENAME,DRAW_WATER_CONSTANT_BLUE_IN_JPG,US_LETTER, &
                   POWER_DISPLAY_COLOR,PERFORM_CUTHILL_MCKEE,SU_FORMAT,USER_T0, &
                   ADD_PERIODIC_CONDITIONS,PERIODIC_horiz_dist,PERIODIC_DETECT_TOL)
+#ifdef USE_MPI
+  if(nproc_read_from_database <= 1) stop 'should have nproc_read_from_database > 1 when running an MPI simulation'
+#endif
+  if(nproc /= nproc_read_from_database) stop 'must always have nproc == nproc_read_from_database'
 
 #ifndef USE_MPI
   if(PERFORM_CUTHILL_MCKEE) then
@@ -919,7 +927,7 @@
 
   ! starts reading in Database file
     if(ipass > 1) call read_databases_init(myrank,ipass, &
-                      simulation_title,SIMULATION_TYPE,NOISE_TOMOGRAPHY,SAVE_FORWARD,npgeo, &
+                      simulation_title,SIMULATION_TYPE,NOISE_TOMOGRAPHY,SAVE_FORWARD,npgeo,nproc_read_from_database, &
                       gnuplot,interpol,NTSTEP_BETWEEN_OUTPUT_INFO, &
                       output_postscript_snapshot,output_color_image,colors,numbers, &
                       meshvect,modelvect,boundvect,cutsnaps,subsamp_postscript,sizemax_arrows, &



More information about the CIG-COMMITS mailing list