[cig-commits] r21496 - seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D
lefebvre at geodynamics.org
lefebvre at geodynamics.org
Mon Mar 11 15:16:51 PDT 2013
Author: lefebvre
Date: 2013-03-11 15:16:51 -0700 (Mon, 11 Mar 2013)
New Revision: 21496
Added:
seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/adios_manager.F90
Modified:
seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/finalize_simulation.f90
seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/initialize_simulation.f90
Log:
Routines to initialize and finalize ADIOS.
Initialize_simulation also calls the routines to read and broadcast 'ADIOS_ENABLED'
new file: src/specfem3D/adios_manager.F90
modified: src/specfem3D/finalize_simulation.f90
modified: src/specfem3D/initialize_simulation.f90
Added: seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/adios_manager.F90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/adios_manager.F90 (rev 0)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/adios_manager.F90 2013-03-11 22:16:51 UTC (rev 21496)
@@ -0,0 +1,47 @@
+!=====================================================================
+!
+! S p e c f e m 3 D G l o b e V e r s i o n 5 . 1
+! --------------------------------------------------
+!
+! Main authors: Dimitri Komatitsch and Jeroen Tromp
+! Princeton University, USA
+! and University of Pau / CNRS / INRIA, France
+! (c) Princeton University / California Institute of Technology and University of Pau / CNRS / INRIA
+! April 2011
+!
+! This program is free software; you can redistribute it and/or modify
+! it under the terms of the GNU General Public License as published by
+! the Free Software Foundation; either version 2 of the License, or
+! (at your option) any later version.
+!
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+! GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License along
+! with this program; if not, write to the Free Software Foundation, Inc.,
+! 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+!
+!=====================================================================
+
+!> @brief Initialize ADIOS and setup the xml output file
+subroutine adios_setup()
+ use adios_write_mod, only: adios_init
+
+ implicit none
+ integer :: adios_err
+
+ call adios_init ("./DATA/par_header.xml", adios_err);
+end subroutine adios_setup
+
+!> @brief Finalize ADIOS. Must be called once everything is written down.
+subroutine adios_cleanup()
+ use adios_write_mod, only: adios_finalize
+ use specfem_par
+
+ implicit none
+ integer :: adios_err
+
+ call adios_finalize (myrank, adios_err)
+end subroutine adios_cleanup
Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/finalize_simulation.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/finalize_simulation.f90 2013-03-11 22:16:45 UTC (rev 21495)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/finalize_simulation.f90 2013-03-11 22:16:51 UTC (rev 21496)
@@ -268,4 +268,7 @@
! synchronize all the processes to make sure everybody has finished
call sync_all()
+ if (ADIOS_ENABLED) then
+ call adios_cleanup()
+ endif
end subroutine finalize_simulation
Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/initialize_simulation.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/initialize_simulation.f90 2013-03-11 22:16:45 UTC (rev 21495)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/initialize_simulation.f90 2013-03-11 22:16:51 UTC (rev 21496)
@@ -107,7 +107,8 @@
! GPU_MODE: parameter is optional, may not be in the Par_file
call read_gpu_mode(GPU_MODE)
-
+ ! ADIOS_ENABLED: parameter is optional, may not be in the Par_file
+ call read_adios_enabled(ADIOS_ENABLED)
endif
! distributes parameters from master to all processes
@@ -147,6 +148,8 @@
! broadcasts optional GPU_MODE
call broadcast_gpu_parameters(myrank,GPU_MODE)
+ ! broadcasts optional ADIOS_ENABLED
+ call broadcast_adios_parameters(myrank,ADIOS_ENABLED)
! get the base pathname for output files
call get_value_string(OUTPUT_FILES, 'OUTPUT_FILES', 'OUTPUT_FILES')
@@ -315,6 +318,18 @@
if(myrank == 0 ) call initialize_vtkwindow(GPU_MODE)
endif
+ ! save simulation info to ADIOS header
+ if (ADIOS_ENABLED) then
+ call adios_setup()
+ endif
+ if (ADIOS_ENABLED) then
+ ! TODO use only one ADIOS group to write simulation parameters
+ ! i.e. merge write_solver... write_par_... into
+ ! write_specfem3D_globe_adios_header()
+ !call write_solver_info_header_ADIOS()
+ call write_par_file_header_ADIOS()
+ endif
+
end subroutine initialize_simulation
!
More information about the CIG-COMMITS
mailing list