[cig-commits] [commit] QA: ADIOS: Stop if unable to open or read from file. (160f992)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Mon Jan 20 07:11:53 PST 2014
Repository : ssh://geoshell/specfem3d
On branch : QA
Link : https://github.com/geodynamics/specfem3d/compare/4359ed56c14ef8f87387f46c8b705a1d395a40ba...8e7fca259d3e520c105549cfacfb92b6c83f8971
>---------------------------------------------------------------
commit 160f992e933caa8ebe01450b2f4ba99acaf26c6d
Author: Elliott Sales de Andrade <esalesde at physics.utoronto.ca>
Date: Sun Jan 19 19:45:37 2014 -0500
ADIOS: Stop if unable to open or read from file.
There's no need to print anything because the verbosity setting of ADIOS
means it will print out an error message itself.
>---------------------------------------------------------------
160f992e933caa8ebe01450b2f4ba99acaf26c6d
src/generate_databases/model_gll_adios.F90 | 2 ++
src/generate_databases/model_ipati_adios.F90 | 2 ++
src/generate_databases/read_partition_files_adios.F90 | 3 +++
src/shared/combine_vol_data_adios_impl.f90 | 7 +++++++
src/specfem3D/read_forward_arrays_adios.F90 | 2 ++
src/specfem3D/read_mesh_databases_adios.F90 | 10 ++++++++++
6 files changed, 26 insertions(+)
diff --git a/src/generate_databases/model_gll_adios.F90 b/src/generate_databases/model_gll_adios.F90
index ac0dc3d..2db5b2f 100644
--- a/src/generate_databases/model_gll_adios.F90
+++ b/src/generate_databases/model_gll_adios.F90
@@ -75,6 +75,7 @@ subroutine model_gll_adios(myrank,nspec,LOCAL_PATH)
call adios_read_init_method (ADIOS_READ_METHOD_BP, MPI_COMM_WORLD, &
"verbose=1", ier)
call adios_read_open_file (handle, database_name, 0, MPI_COMM_WORLD, ier)
+ if (ier /= 0) call stop_all()
!------------------------.
! Get the 'chunks' sizes |
@@ -97,6 +98,7 @@ subroutine model_gll_adios(myrank,nspec,LOCAL_PATH)
! Perform read and close the adios file |
!---------------------------------------'
call adios_perform_reads(handle, ier)
+ if (ier /= 0) call stop_all()
call adios_read_close(handle,ier)
call adios_read_finalize_method(ADIOS_READ_METHOD_BP, ier)
diff --git a/src/generate_databases/model_ipati_adios.F90 b/src/generate_databases/model_ipati_adios.F90
index 01030d0..6a9eaac 100644
--- a/src/generate_databases/model_ipati_adios.F90
+++ b/src/generate_databases/model_ipati_adios.F90
@@ -191,6 +191,7 @@ subroutine read_model_vp_rho_adios (myrank, nspec, LOCAL_PATH, &
call adios_read_init_method (ADIOS_READ_METHOD_BP, MPI_COMM_WORLD, &
"verbose=1", ier)
call adios_read_open_file (handle, database_name, 0, MPI_COMM_WORLD, ier)
+ if (ier /= 0) call stop_all()
!------------------------.
! Get the 'chunks' sizes |
@@ -210,6 +211,7 @@ subroutine read_model_vp_rho_adios (myrank, nspec, LOCAL_PATH, &
! Perform read and close the adios file |
!---------------------------------------'
call adios_perform_reads(handle, ier)
+ if (ier /= 0) call stop_all()
call adios_read_close(handle,ier)
call adios_read_finalize_method(ADIOS_READ_METHOD_BP, ier)
end subroutine read_model_vp_rho_adios
diff --git a/src/generate_databases/read_partition_files_adios.F90 b/src/generate_databases/read_partition_files_adios.F90
index 4bdcf89..3679c71 100644
--- a/src/generate_databases/read_partition_files_adios.F90
+++ b/src/generate_databases/read_partition_files_adios.F90
@@ -68,6 +68,7 @@ subroutine read_partition_files_adios()
call adios_read_init_method (ADIOS_READ_METHOD_BP, MPI_COMM_WORLD, &
"verbose=1", ier)
call adios_read_open_file (handle, database_name, 0, MPI_COMM_WORLD, ier)
+ if (ier /= 0) call stop_all()
!------------------------.
! Get the 'chunks' sizes |
@@ -149,6 +150,7 @@ subroutine read_partition_files_adios()
endif
! Perform the read, so we can use the values.
call adios_perform_reads(handle, ier)
+ if (ier /= 0) call stop_all()
NSPEC_AB = nelmnts_ext_mesh
NSPEC2D_BOTTOM = nspec2D_bottom_ext
@@ -346,6 +348,7 @@ subroutine read_partition_files_adios()
my_interfaces_ext_mesh, ier)
call adios_perform_reads(handle, ier)
+ if (ier /= 0) call stop_all()
call adios_read_close(handle,ier)
call adios_read_finalize_method(ADIOS_READ_METHOD_BP, ier)
diff --git a/src/shared/combine_vol_data_adios_impl.f90 b/src/shared/combine_vol_data_adios_impl.f90
index 856ed11..ad190ff 100644
--- a/src/shared/combine_vol_data_adios_impl.f90
+++ b/src/shared/combine_vol_data_adios_impl.f90
@@ -132,8 +132,10 @@ subroutine init_adios(value_file_name, mesh_file_name, &
"verbose=1", ier)
call adios_read_open_file(mesh_handle, trim(mesh_file_name), 0, &
MPI_COMM_WORLD, ier)
+ if (ier /= 0) call stop_all()
call adios_read_open_file(value_handle, trim(value_file_name), 0, &
MPI_COMM_WORLD, ier)
+ if (ier /= 0) call stop_all()
end subroutine init_adios
@@ -172,6 +174,7 @@ subroutine read_scalars_adios_mesh(mesh_handle, iproc, NGLOB_AB, NSPEC_AB, &
call adios_schedule_read(mesh_handle, sel, "x_global/offset", 0, 1, &
x_global_offset, ier)
call adios_perform_reads(mesh_handle, ier)
+ if (ier /= 0) call stop_all()
end subroutine read_scalars_adios_mesh
@@ -194,6 +197,7 @@ subroutine read_ibool_adios_mesh(mesh_handle, ibool_offset, &
call adios_schedule_read(mesh_handle, sel, "ibool/array", 0, 1, &
ibool, ier)
call adios_perform_reads(mesh_handle, ier)
+ if (ier /= 0) call stop_all()
end subroutine read_ibool_adios_mesh
@@ -221,6 +225,7 @@ subroutine read_coordinates_adios_mesh(mesh_handle, x_global_offset, &
call adios_schedule_read(mesh_handle, sel, "z_global/array", 0, 1, &
zstore, ier)
call adios_perform_reads(mesh_handle, ier)
+ if (ier /= 0) call stop_all()
end subroutine read_coordinates_adios_mesh
@@ -245,6 +250,7 @@ subroutine read_double_values_adios(value_handle, var_name, ibool_offset, &
call adios_schedule_read(value_handle, sel, trim(var_name) // "/array", 0, 1, &
dat, ier)
call adios_perform_reads(value_handle, ier)
+ if (ier /= 0) call stop_all()
end subroutine read_double_values_adios
@@ -269,6 +275,7 @@ subroutine read_float_values_adios(value_handle, var_name, ibool_offset, &
call adios_schedule_read(value_handle, sel, trim(var_name) // "/array", 0, 1, &
dat, ier)
call adios_perform_reads(value_handle, ier)
+ if (ier /= 0) call stop_all()
end subroutine read_float_values_adios
end module combine_vol_data_adios_mod
diff --git a/src/specfem3D/read_forward_arrays_adios.F90 b/src/specfem3D/read_forward_arrays_adios.F90
index ae5f172..dba9680 100644
--- a/src/specfem3D/read_forward_arrays_adios.F90
+++ b/src/specfem3D/read_forward_arrays_adios.F90
@@ -88,6 +88,7 @@ subroutine read_forward_arrays_adios()
call adios_read_init_method (ADIOS_READ_METHOD_BP, MPI_COMM_WORLD, &
"verbose=1", ier)
call adios_read_open_file (handle, database_name, 0, MPI_COMM_WORLD, ier)
+ if (ier /= 0) call stop_all()
!------------------------.
! Get the 'chunks' sizes |
@@ -364,6 +365,7 @@ subroutine read_forward_arrays_adios()
! Perform the reads and close the ADIOS 'external_mesh.bp' file |
!---------------------------------------------------------------'
call adios_perform_reads(handle, ier)
+ if (ier /= 0) call stop_all()
call adios_read_close(handle,ier)
call adios_read_finalize_method(ADIOS_READ_METHOD_BP, ier)
diff --git a/src/specfem3D/read_mesh_databases_adios.F90 b/src/specfem3D/read_mesh_databases_adios.F90
index 85d1051..43f1a73 100644
--- a/src/specfem3D/read_mesh_databases_adios.F90
+++ b/src/specfem3D/read_mesh_databases_adios.F90
@@ -50,6 +50,7 @@ subroutine read_mesh_for_init(nspec, nglob)
call adios_read_init_method (ADIOS_READ_METHOD_BP, MPI_COMM_WORLD, &
"verbose=1", ier)
call adios_read_open_file (handle, database_name, 0, MPI_COMM_WORLD, ier)
+ if (ier /= 0) call stop_all()
!------------------------------------.
! Read variables from the adios file |
@@ -62,6 +63,7 @@ subroutine read_mesh_for_init(nspec, nglob)
! Perform the reads and close the adios file |
!--------------------------------------------'
call adios_perform_reads(handle, ier)
+ if (ier /= 0) call stop_all()
call adios_read_close(handle,ier)
call adios_read_finalize_method(ADIOS_READ_METHOD_BP, ier)
@@ -154,6 +156,7 @@ subroutine read_mesh_databases_adios()
call adios_read_init_method (ADIOS_READ_METHOD_BP, MPI_COMM_WORLD, &
"verbose=1", ier)
call adios_read_open_file (handle, database_name, 0, MPI_COMM_WORLD, ier)
+ if (ier /= 0) call stop_all()
!------------------------------------------------------------------.
! Get scalar values. Might be differents for different processors. |
@@ -166,6 +169,7 @@ subroutine read_mesh_databases_adios()
call adios_schedule_read(handle, sel, "/nspec", 0, 1, NSPEC_AB, ier)
call adios_schedule_read(handle, sel, "/nglob", 0, 1, NGLOB_AB, ier)
call adios_perform_reads(handle, ier)
+ if (ier /= 0) call stop_all()
!----------------------------------------------.
! Fetch values to compute the simulation type. |
@@ -191,6 +195,7 @@ subroutine read_mesh_databases_adios()
ispec_is_poroelastic, ier)
! Perform the read, so we can use the values.
call adios_perform_reads(handle, ier)
+ if (ier /= 0) call stop_all()
! number of acoustic elements in this partition
nspec_acoustic = count(ispec_is_acoustic(:))
! all processes will have acoustic_simulation set if any flag is .true.
@@ -328,6 +333,7 @@ subroutine read_mesh_databases_adios()
endif
! Perform the read, so we can use the values.
call adios_perform_reads(handle, ier)
+ if (ier /= 0) call stop_all()
!------------------------.
@@ -1633,6 +1639,7 @@ subroutine read_mesh_databases_adios()
! Perform the reads and close the ADIOS 'external_mesh.bp' file |
!---------------------------------------------------------------'
call adios_perform_reads(handle, ier)
+ if (ier /= 0) call stop_all()
call adios_read_close(handle,ier)
call adios_read_finalize_method(ADIOS_READ_METHOD_BP, ier)
@@ -1757,6 +1764,7 @@ subroutine read_moho_mesh_adjoint_adios()
call adios_read_init_method (ADIOS_READ_METHOD_BP, MPI_COMM_WORLD, &
"verbose=1", ier)
call adios_read_open_file (handle, database_name, 0, MPI_COMM_WORLD, ier)
+ if (ier /= 0) call stop_all()
!------------------------------------------------------------------.
! Get scalar values. Might be differents for different processors. |
@@ -1769,6 +1777,7 @@ subroutine read_moho_mesh_adjoint_adios()
call adios_schedule_read(handle, sel, "/nspec2d_moho", 0, 1, &
NSPEC2D_MOHO, ier)
call adios_perform_reads(handle, ier)
+ if (ier /= 0) call stop_all()
!----------------------------------------------.
! Fetch values to compute the simulation type. |
@@ -1872,6 +1881,7 @@ subroutine read_moho_mesh_adjoint_adios()
! Perform the reads and close the ADIOS 'external_mesh.bp' file |
!---------------------------------------------------------------'
call adios_perform_reads(handle, ier)
+ if (ier /= 0) call stop_all()
call adios_read_close(handle,ier)
call adios_read_finalize_method(ADIOS_READ_METHOD_BP, ier)
More information about the CIG-COMMITS
mailing list