From 5c6fac3282f4781a5f366fa37890371656397175 Mon Sep 17 00:00:00 2001 From: Greg Eisenhauer Date: Wed, 20 Mar 2024 10:27:42 -0400 Subject: [PATCH] WIP: Make Fortran tests fail with a non-zero exit code (#4097) * Make Fortran tests fail with a non-zero exit code Co-authored-by: anagainaru --- bindings/C/adios2/c/adios2_c_variable.cpp | 8 - source/adios2/common/ADIOSTypes.cpp | 17 + source/adios2/common/ADIOSTypes.h | 1 + source/adios2/core/VariableBase.h | 4 - .../adios2/engine/dataman/DataManReader.tcc | 5 +- .../adios2/engine/dataman/DataManWriter.tcc | 5 +- .../format/dataman/DataManSerializer.h | 4 +- .../format/dataman/DataManSerializer.tcc | 9 +- .../fortran/TestAdios2BindingsFortranIO.F90 | 35 +- .../bindings/fortran/TestBPMemorySpace.F90 | 30 +- .../bindings/fortran/TestBPMemorySpaceGPU.F90 | 30 +- .../fortran/TestBPReadGlobalsByName.F90 | 11 +- .../TestBPWriteMemorySelectionRead2D.F90 | 210 +++++++-- .../TestBPWriteMemorySelectionRead3D.F90 | 210 +++++++-- .../fortran/TestBPWriteReadAttributes.F90 | 407 ++++++++++++++---- .../fortran/TestBPWriteReadHeatMap2D.F90 | 30 +- .../fortran/TestBPWriteReadHeatMap3D.F90 | 30 +- .../fortran/TestBPWriteReadHeatMap4D.F90 | 30 +- .../fortran/TestBPWriteReadHeatMap5D.F90 | 30 +- .../fortran/TestBPWriteReadHeatMap6D.F90 | 30 +- .../fortran/TestBPWriteTypesByName.F90 | 120 ++++-- .../fortran/TestBPWriteTypesLocal.F90 | 185 ++++++-- .../fortran/TestBPWriteVariableAttributes.F90 | 12 +- .../bindings/fortran/TestNullEngine.F90 | 13 +- .../adios2/bindings/fortran/TestRemove.F90 | 135 ++++-- .../fortran/operation/TestBPWriteReadSZ2D.F90 | 40 +- .../fortran/operation/TestBPWriteReadSZ3D.F90 | 40 +- .../operation/TestBPWriteReadZfp2D.F90 | 40 +- .../operation/TestBPWriteReadZfp2DRemove.F90 | 20 +- .../engine/bp/TestBPFortranToCppWriter.F90 | 5 +- .../engine/staging-common/TestCommonReadF.F90 | 225 ++++++++-- 31 files changed, 1560 insertions(+), 411 deletions(-) diff --git a/bindings/C/adios2/c/adios2_c_variable.cpp b/bindings/C/adios2/c/adios2_c_variable.cpp index f17b8c44ae..a8d02bf5ad 100644 --- a/bindings/C/adios2/c/adios2_c_variable.cpp +++ b/bindings/C/adios2/c/adios2_c_variable.cpp @@ -79,11 +79,7 @@ adios2_error adios2_set_shape(adios2_variable *variable, const size_t ndims, con adios2::MemorySpace adios2_ToMemorySpace(const adios2_memory_space Cmem) { -#ifdef ADIOS2_HAVE_GPU_SUPPORT adios2::MemorySpace mem = adios2::MemorySpace::Detect; -#else - adios2::MemorySpace mem = adios2::MemorySpace::Host; -#endif switch (Cmem) { @@ -104,11 +100,7 @@ adios2::MemorySpace adios2_ToMemorySpace(const adios2_memory_space Cmem) adios2_memory_space adios2_FromMemorySpace(const adios2::MemorySpace mem) { -#ifdef ADIOS2_HAVE_GPU_SUPPORT adios2_memory_space Cmem = adios2_memory_space_detect; -#else - adios2_memory_space Cmem = adios2_memory_space_host; -#endif switch (mem) { diff --git a/source/adios2/common/ADIOSTypes.cpp b/source/adios2/common/ADIOSTypes.cpp index 5fbdb69216..51dc8b2ca4 100644 --- a/source/adios2/common/ADIOSTypes.cpp +++ b/source/adios2/common/ADIOSTypes.cpp @@ -18,6 +18,23 @@ namespace adios2 { +std::string ToString(MemorySpace value) +{ + switch (value) + { + case MemorySpace::Detect: + return "MemorySpace::Detect"; + case MemorySpace::Host: + return "MemorySpace::Host"; +#ifdef ADIOS2_HAVE_GPU_SUPPORT + case MemorySpace::GPU: + return "MemorySpace::GPU"; +#endif + default: + return "ToString: Unknown MemorySpace"; + } +} + std::string ToString(ShapeID value) { switch (value) diff --git a/source/adios2/common/ADIOSTypes.h b/source/adios2/common/ADIOSTypes.h index 817e4da2b1..5d9eeb2624 100644 --- a/source/adios2/common/ADIOSTypes.h +++ b/source/adios2/common/ADIOSTypes.h @@ -355,6 +355,7 @@ std::string ToString(SelectionType value); std::string ToString(DataType type); std::string ToString(const Dims &dims); std::string ToString(const Box &box); +std::string ToString(const MemorySpace value); /** * os << [adios2_type] enables output of adios2 enums/classes directly diff --git a/source/adios2/core/VariableBase.h b/source/adios2/core/VariableBase.h index dc410ec78d..5b585d46a2 100644 --- a/source/adios2/core/VariableBase.h +++ b/source/adios2/core/VariableBase.h @@ -52,11 +52,7 @@ class VariableBase const size_t m_ElementSize; /* User requested memory space */ -#ifdef ADIOS2_HAVE_GPU_SUPPORT MemorySpace m_MemSpace = MemorySpace::Detect; -#else - MemorySpace m_MemSpace = MemorySpace::Host; -#endif #if defined(ADIOS2_HAVE_KOKKOS) || defined(ADIOS2_HAVE_GPU_SUPPORT) ArrayOrdering m_BaseLayout; ArrayOrdering m_ArrayLayout = ArrayOrdering::Auto; diff --git a/source/adios2/engine/dataman/DataManReader.tcc b/source/adios2/engine/dataman/DataManReader.tcc index 9edd962b96..df1af3ac67 100644 --- a/source/adios2/engine/dataman/DataManReader.tcc +++ b/source/adios2/engine/dataman/DataManReader.tcc @@ -31,12 +31,13 @@ void DataManReader::GetSyncCommon(Variable &variable, T *data) template void DataManReader::GetDeferredCommon(Variable &variable, T *data) { + auto varMemSpace = variable.GetMemorySpace(data); if (m_IO.m_ArrayOrder == ArrayOrdering::RowMajor) { while (true) { int ret = m_Serializer.GetData(data, variable.m_Name, variable.m_Start, - variable.m_Count, m_CurrentStep, variable.m_MemSpace, + variable.m_Count, m_CurrentStep, varMemSpace, variable.m_MemoryStart, variable.m_MemoryCount); if (ret == 0) { @@ -57,7 +58,7 @@ void DataManReader::GetDeferredCommon(Variable &variable, T *data) while (true) { int ret = m_Serializer.GetData(data, variable.m_Name, start, count, m_CurrentStep, - variable.m_MemSpace, memstart, memcount); + varMemSpace, memstart, memcount); if (ret == 0) { break; diff --git a/source/adios2/engine/dataman/DataManWriter.tcc b/source/adios2/engine/dataman/DataManWriter.tcc index f9996e4678..ba5f1a6974 100644 --- a/source/adios2/engine/dataman/DataManWriter.tcc +++ b/source/adios2/engine/dataman/DataManWriter.tcc @@ -31,10 +31,11 @@ void DataManWriter::PutSyncCommon(Variable &variable, const T *values) template void DataManWriter::PutDeferredCommon(Variable &variable, const T *values) { + auto varMemSpace = variable.GetMemorySpace(values); variable.SetData(values); if (m_IO.m_ArrayOrder == ArrayOrdering::RowMajor) { - m_Serializer.PutData(variable, m_Name, CurrentStep(), m_MpiRank, ""); + m_Serializer.PutData(variable, m_Name, CurrentStep(), m_MpiRank, varMemSpace, ""); } else { @@ -49,7 +50,7 @@ void DataManWriter::PutDeferredCommon(Variable &variable, const T *values) std::reverse(memstart.begin(), memstart.end()); std::reverse(memcount.begin(), memcount.end()); m_Serializer.PutData(variable.m_Data, variable.m_Name, shape, start, count, memstart, - memcount, variable.m_MemSpace, m_Name, CurrentStep(), m_MpiRank, "", + memcount, varMemSpace, m_Name, CurrentStep(), m_MpiRank, "", variable.m_Operations); } diff --git a/source/adios2/toolkit/format/dataman/DataManSerializer.h b/source/adios2/toolkit/format/dataman/DataManSerializer.h index 4e2c2ada6a..8e3247667f 100644 --- a/source/adios2/toolkit/format/dataman/DataManSerializer.h +++ b/source/adios2/toolkit/format/dataman/DataManSerializer.h @@ -110,8 +110,8 @@ class DataManSerializer // another wrapper for PutData which accepts adios2::core::Variable template void PutData(const core::Variable &variable, const std::string &doid, const size_t step, - const int rank, const std::string &address, VecPtr localBuffer = nullptr, - JsonPtr metadataJson = nullptr); + const int rank, const MemorySpace varMemSpace, const std::string &address, + VecPtr localBuffer = nullptr, JsonPtr metadataJson = nullptr); // attach attributes to local pack void AttachAttributesToLocalPack(); diff --git a/source/adios2/toolkit/format/dataman/DataManSerializer.tcc b/source/adios2/toolkit/format/dataman/DataManSerializer.tcc index e3fd9b29d3..4060b93681 100644 --- a/source/adios2/toolkit/format/dataman/DataManSerializer.tcc +++ b/source/adios2/toolkit/format/dataman/DataManSerializer.tcc @@ -76,13 +76,14 @@ void DataManSerializer::CalculateMinMax(const T *data, const Dims &count, template void DataManSerializer::PutData(const core::Variable &variable, const std::string &doid, - const size_t step, const int rank, const std::string &address, - VecPtr localBuffer, JsonPtr metadataJson) + const size_t step, const int rank, const MemorySpace memSpace, + const std::string &address, VecPtr localBuffer, + JsonPtr metadataJson) { PERFSTUBS_SCOPED_TIMER_FUNC(); PutData(variable.GetData(), variable.m_Name, variable.m_Shape, variable.m_Start, - variable.m_Count, variable.m_MemoryStart, variable.m_MemoryCount, variable.m_MemSpace, - doid, step, rank, address, variable.m_Operations, localBuffer, metadataJson); + variable.m_Count, variable.m_MemoryStart, variable.m_MemoryCount, memSpace, doid, step, + rank, address, variable.m_Operations, localBuffer, metadataJson); } template diff --git a/testing/adios2/bindings/fortran/TestAdios2BindingsFortranIO.F90 b/testing/adios2/bindings/fortran/TestAdios2BindingsFortranIO.F90 index 24c648d10f..7bb5ffb3a6 100644 --- a/testing/adios2/bindings/fortran/TestAdios2BindingsFortranIO.F90 +++ b/testing/adios2/bindings/fortran/TestAdios2BindingsFortranIO.F90 @@ -60,7 +60,10 @@ subroutine testing_adios_io_finalize() ! FIXME, shouldn't we be able to do this by handle? call adios2_remove_io(result, adios, "TestIo", ierr) - if ((ierr /= 0) .or. (result .neqv. .true.)) stop "FAIL: adios2_remove_io" + if ((ierr /= 0) .or. (result .neqv. .true.)) then + write(*,*) "FAIL: adios2_remove_io" + stop 1 + end if call testing_adios_finalize() end subroutine testing_adios_io_finalize @@ -88,18 +91,27 @@ subroutine testing_adios_io_engine() call adios2_set_engine(io, "file", ierr) call adios2_io_engine_type(engine_type, io, ierr) - if (engine_type /= "file") stop "FAIL adios2_io_engine_type" + if (engine_type /= "file") then + write(*,*) "FAIL adios2_io_engine_type" + stop 1 + end if deallocate(engine_type) call adios2_open(engine, io, "ftypes.bp", adios2_mode_write, ierr) - if (engine%type /= "BP5Writer") stop "FAIL engine%type" + if (engine%type /= "BP5Writer") then + write(*,*) "FAIL engine%type" + stop 1 + end if ! // FIXME, I'd like to check that the engine type itself is correct, but ! // there's no (function-style) API to get it ! // FIXME, I'd like to check the engine's name, but there's no API to get it call adios2_io_engine_type(engine_type, io, ierr) - if (engine_type /= "file") stop "FAIL adios2_io_engine_type" + if (engine_type /= "file") then + write(*,*) "FAIL adios2_io_engine_type" + stop 1 + end if deallocate(engine_type) call testing_adios_io_finalize() @@ -123,18 +135,27 @@ subroutine testing_adios_io_engine_default() call adios2_set_engine(io, "", ierr) call adios2_io_engine_type(engine_type, io, ierr) - if (engine_type /= "") stop "FAIL adios2_io_engine_type" + if (engine_type /= "") then + write(*,*) "FAIL adios2_io_engine_type" + stop 1 + end if deallocate(engine_type) call adios2_open(engine, io, "ftypes.bp", adios2_mode_write, ierr) - if (engine%type /= "BP5Writer") stop "FAIL engine%type" + if (engine%type /= "BP5Writer") then + write(*,*) "FAIL engine%type" + stop 1 + end if ! // FIXME, I'd like to check that the engine type itself is correct, but ! // there's no (function-style) API to get it ! // FIXME, I'd like to check the engine's name, but there's no API to get it call adios2_io_engine_type(engine_type, io, ierr) - if (engine_type /= "") stop "FAIL adios2_io_engine_type" + if (engine_type /= "") then + write(*,*) "FAIL adios2_io_engine_type" + stop 1 + end if deallocate(engine_type) call testing_adios_io_finalize diff --git a/testing/adios2/bindings/fortran/TestBPMemorySpace.F90 b/testing/adios2/bindings/fortran/TestBPMemorySpace.F90 index e22cb67438..fbec8267c4 100644 --- a/testing/adios2/bindings/fortran/TestBPMemorySpace.F90 +++ b/testing/adios2/bindings/fortran/TestBPMemorySpace.F90 @@ -13,14 +13,26 @@ program TestBPMemorySpace start_dims(1) = 0 count_dims(1) = 10 - if( adios%valid .eqv. .true. ) stop 'Invalid adios default' - if( variable%valid .eqv. .true. ) stop 'Invalid variables default' + if( adios%valid .eqv. .true. ) then + write(*,*) 'Invalid adios default' + stop 1 + end if + if( variable%valid .eqv. .true. ) then + write(*,*) 'Invalid variables default' + stop 1 + end if call adios2_init(adios, ierr) - if( adios%valid .eqv. .false. ) stop 'Invalid adios2_init' + if( adios%valid .eqv. .false. ) then + write(*,*) 'Invalid adios2_init' + stop 1 + end if call adios2_declare_io(ioWrite, adios, "ioWrite", ierr) - if( ioWrite%valid .eqv. .false. ) stop 'Invalid adios2_declare_io' + if( ioWrite%valid .eqv. .false. ) then + write(*,*) 'Invalid adios2_declare_io' + stop 1 + end if call adios2_set_engine(ioWrite, 'File', ierr) @@ -31,11 +43,17 @@ program TestBPMemorySpace ! check that the default execution space is Detect call adios2_get_memory_space(mem, variable, ierr) - if (mem /= adios2_memory_space_detect) stop 'Invalid adios2_memory_space' + if (mem /= adios2_memory_space_detect) then + write(*,*) 'Invalid default adios2_memory_space' + stop 1 + end if ! check that the execution space is updated to Host call adios2_set_memory_space(variable, adios2_memory_space_host, ierr) call adios2_get_memory_space(mem, variable, ierr) - if (mem /= adios2_memory_space_host) stop 'Invalid adios2_memory_space' + if (mem /= adios2_memory_space_host) then + write(*,*) 'Invalid set adios2_memory_space' + stop 1 + end if end program TestBPMemorySpace diff --git a/testing/adios2/bindings/fortran/TestBPMemorySpaceGPU.F90 b/testing/adios2/bindings/fortran/TestBPMemorySpaceGPU.F90 index 64fb26755f..bffc935753 100644 --- a/testing/adios2/bindings/fortran/TestBPMemorySpaceGPU.F90 +++ b/testing/adios2/bindings/fortran/TestBPMemorySpaceGPU.F90 @@ -13,14 +13,26 @@ program TestBPMemorySpace start_dims(1) = 0 count_dims(1) = 10 - if( adios%valid .eqv. .true. ) stop 'Invalid adios default' - if( variable%valid .eqv. .true. ) stop 'Invalid variables default' + if( adios%valid .eqv. .true. ) then + write(*,*) 'Invalid adios default' + stop 1 + end if + if( variable%valid .eqv. .true. ) then + write(*,*) 'Invalid variables default' + stop 1 + end if call adios2_init(adios, ierr) - if( adios%valid .eqv. .false. ) stop 'Invalid adios2_init' + if( adios%valid .eqv. .false. ) then + write(*,*) 'Invalid adios2_init' + stop 1 + end if call adios2_declare_io(ioWrite, adios, "ioWrite", ierr) - if( ioWrite%valid .eqv. .false. ) stop 'Invalid adios2_declare_io' + if( ioWrite%valid .eqv. .false. ) then + write(*,*) 'Invalid adios2_declare_io' + stop 1 + end if call adios2_set_engine(ioWrite, 'File', ierr) @@ -31,11 +43,17 @@ program TestBPMemorySpace ! check that the default execution space is Detect call adios2_get_memory_space(mem, variable, ierr) - if (mem /= adios2_memory_space_detect) stop 'Invalid adios2_memory_space' + if (mem /= adios2_memory_space_detect) then + write(*,*) 'Invalid default adios2_memory_space' + stop 1 + end if ! check that the execution space is updated to GPU call adios2_set_memory_space(variable, adios2_memory_space_gpu, ierr) call adios2_get_memory_space(mem, variable, ierr) - if (mem /= adios2_memory_space_gpu) stop 'Invalid adios2_memory_space' + if (mem /= adios2_memory_space_gpu) then + write(*,*) 'Invalid set adios2_memory_space' + stop 1 + end if end program TestBPMemorySpace diff --git a/testing/adios2/bindings/fortran/TestBPReadGlobalsByName.F90 b/testing/adios2/bindings/fortran/TestBPReadGlobalsByName.F90 index 6c71157c77..d2fba7b634 100644 --- a/testing/adios2/bindings/fortran/TestBPReadGlobalsByName.F90 +++ b/testing/adios2/bindings/fortran/TestBPReadGlobalsByName.F90 @@ -38,7 +38,10 @@ program TestBPReadGlobalsByName call adios2_put(writer, "sml_outpsi", 0.295477_8, ierr) call adios2_close(writer, ierr) - if(ierr /= 0) stop 'Problems writing' + if(ierr /= 0) then + write(*,*) 'Problems writing' + stop 1 + end if call MPI_Barrier(MPI_COMM_WORLD, ierr) ! reader @@ -60,11 +63,13 @@ program TestBPReadGlobalsByName print *, irank, 'sml_outpsi', sml_outpsi if( diag_1d_nsp /= 1 ) then - stop 'diag_1d_nsp is not 1' + write(*,*) 'diag_1d_nsp is not 1' + stop 1 end if if( sml_outpsi /= 0.295477_8 ) then - stop 'sml_outpsi is not 0.295477' + write(*,*) 'sml_outpsi is not 0.295477' + stop 1 end if call MPI_Finalize(ierr) diff --git a/testing/adios2/bindings/fortran/TestBPWriteMemorySelectionRead2D.F90 b/testing/adios2/bindings/fortran/TestBPWriteMemorySelectionRead2D.F90 index fe56398890..6e37bc44b7 100644 --- a/testing/adios2/bindings/fortran/TestBPWriteMemorySelectionRead2D.F90 +++ b/testing/adios2/bindings/fortran/TestBPWriteMemorySelectionRead2D.F90 @@ -156,64 +156,172 @@ program TestBPWriteMemorySelectionRead2D expected_max = current_step call adios2_inquire_variable(vars_in(1), ioGet, 'var_i1', ierr) - if( vars_in(1)%valid .eqv. .false. ) stop 'i1 invalid error' - if( vars_in(1)%name /= 'var_i1' ) stop 'i1 name error' - if( vars_in(1)%type /= adios2_type_integer1 ) stop 'i1 type error' - if( vars_in(1)%ndims /= 2 ) stop 'i1 dims error' + if( vars_in(1)%valid .eqv. .false. ) then + write(*,*) 'i1 invalid error' + stop 1 + end if + if( vars_in(1)%name /= 'var_i1' ) then + write(*,*) 'i1 name error' + stop 1 + end if + if( vars_in(1)%type /= adios2_type_integer1 ) then + write(*,*) 'i1 type error' + stop 1 + end if + if( vars_in(1)%ndims /= 2 ) then + write(*,*) 'i1 dims error' + stop 1 + end if call adios2_variable_min(min_i1, vars_in(1), ierr) - if(min_i1 /= expected_min ) stop 'i1 min error' + if(min_i1 /= expected_min ) then + write(*,*) 'i1 min error' + stop 1 + end if call adios2_variable_max(max_i1, vars_in(1), ierr) - if(max_i1 /= expected_max ) stop 'i1 max error' + if(max_i1 /= expected_max ) then + write(*,*) 'i1 max error' + stop 1 + end if call adios2_inquire_variable(vars_in(2), ioGet, 'var_i2', ierr) - if( vars_in(2)%valid .eqv. .false. ) stop 'i2 invalid error' - if( vars_in(2)%name /= 'var_i2' ) stop 'i2 name error' - if( vars_in(2)%type /= adios2_type_integer2 ) stop 'i2 type error' - if( vars_in(2)%ndims /= 2 ) stop 'i2 dims error' + if( vars_in(2)%valid .eqv. .false. ) then + write(*,*) 'i2 invalid error' + stop 1 + end if + if( vars_in(2)%name /= 'var_i2' ) then + write(*,*) 'i2 name error' + stop 1 + end if + if( vars_in(2)%type /= adios2_type_integer2 ) then + write(*,*) 'i2 type error' + stop 1 + end if + if( vars_in(2)%ndims /= 2 ) then + write(*,*) 'i2 dims error' + stop 1 + end if call adios2_variable_min(min_i2, vars_in(2), ierr) - if(min_i2 /= expected_min ) stop 'i2 min error' + if(min_i2 /= expected_min ) then + write(*,*) 'i2 min error' + stop 1 + end if call adios2_variable_max(max_i2, vars_in(2), ierr) - if(max_i2 /= expected_max ) stop 'i2 max error' + if(max_i2 /= expected_max ) then + write(*,*) 'i2 max error' + stop 1 + end if call adios2_inquire_variable(vars_in(3), ioGet, 'var_i4', ierr) - if( vars_in(3)%valid .eqv. .false. ) stop 'i4 invalid error' - if( vars_in(3)%name /= 'var_i4' ) stop 'i4 name error' - if( vars_in(3)%type /= adios2_type_integer4 ) stop 'i4 type error' - if( vars_in(3)%ndims /= 2 ) stop 'i4 dims error' + if( vars_in(3)%valid .eqv. .false. ) then + write(*,*) 'i4 invalid error' + stop 1 + end if + if( vars_in(3)%name /= 'var_i4' ) then + write(*,*) 'i4 name error' + stop 1 + end if + if( vars_in(3)%type /= adios2_type_integer4 ) then + write(*,*) 'i4 type error' + stop 1 + end if + if( vars_in(3)%ndims /= 2 ) then + write(*,*) 'i4 dims error' + stop 1 + end if call adios2_variable_min(min_i4, vars_in(3), ierr) - if(min_i4 /= expected_min ) stop 'i4 min error' + if(min_i4 /= expected_min ) then + write(*,*) 'i4 min error' + stop 1 + end if call adios2_variable_max(max_i4, vars_in(3), ierr) - if(max_i4 /= expected_max ) stop 'i4 max error' + if(max_i4 /= expected_max ) then + write(*,*) 'i4 max error' + stop 1 + end if call adios2_inquire_variable(vars_in(4), ioGet, 'var_i8', ierr) - if( vars_in(4)%valid .eqv. .false. ) stop 'i8 invalid error' - if( vars_in(4)%name /= 'var_i8' ) stop 'i8 name error' - if( vars_in(4)%type /= adios2_type_integer8 ) stop 'i8 type error' - if( vars_in(4)%ndims /= 2 ) stop 'i8 dims error' + if( vars_in(4)%valid .eqv. .false. ) then + write(*,*) 'i8 invalid error' + stop 1 + end if + if( vars_in(4)%name /= 'var_i8' ) then + write(*,*) 'i8 name error' + stop 1 + end if + if( vars_in(4)%type /= adios2_type_integer8 ) then + write(*,*) 'i8 type error' + stop 1 + end if + if( vars_in(4)%ndims /= 2 ) then + write(*,*) 'i8 dims error' + stop 1 + end if call adios2_variable_min(min_i8, vars_in(4), ierr) - if(min_i8 /= expected_min ) stop 'i8 min error' + if(min_i8 /= expected_min ) then + write(*,*) 'i8 min error' + stop 1 + end if call adios2_variable_max(max_i8, vars_in(4), ierr) - if(max_i8 /= expected_max ) stop 'i8 max error' + if(max_i8 /= expected_max ) then + write(*,*) 'i8 max error' + stop 1 + end if call adios2_inquire_variable(vars_in(5), ioGet, 'var_r4', ierr) - if( vars_in(5)%valid .eqv. .false. ) stop 'r4 invalid error' - if( vars_in(5)%name /= 'var_r4' ) stop 'r4 name error' - if( vars_in(5)%type /= adios2_type_real ) stop 'r4 type error' - if( vars_in(5)%ndims /= 2 ) stop 'r4 dims error' + if( vars_in(5)%valid .eqv. .false. ) then + write(*,*) 'r4 invalid error' + stop 1 + end if + if( vars_in(5)%name /= 'var_r4' ) then + write(*,*) 'r4 name error' + stop 1 + end if + if( vars_in(5)%type /= adios2_type_real ) then + write(*,*) 'r4 type error' + stop 1 + end if + if( vars_in(5)%ndims /= 2 ) then + write(*,*) 'r4 dims error' + stop 1 + end if call adios2_variable_min(min_r4, vars_in(5), ierr) - if(min_r4 /= float(expected_min) ) stop 'r4 min error' + if(min_r4 /= float(expected_min) ) then + write(*,*) 'r4 min error' + stop 1 + end if call adios2_variable_max(max_r4, vars_in(5), ierr) - if(max_r4 /= float(expected_max) ) stop 'r4 max error' + if(max_r4 /= float(expected_max) ) then + write(*,*) 'r4 max error' + stop 1 + end if call adios2_inquire_variable(vars_in(6), ioGet, 'var_r8', ierr) - if( vars_in(6)%valid .eqv. .false. ) stop 'r8 invalid error' - if( vars_in(6)%name /= 'var_r8' ) stop 'r8 name error' - if( vars_in(6)%type /= adios2_type_dp ) stop 'r8 type error' - if( vars_in(6)%ndims /= 2 ) stop 'r8 dims error' + if( vars_in(6)%valid .eqv. .false. ) then + write(*,*) 'r8 invalid error' + stop 1 + end if + if( vars_in(6)%name /= 'var_r8' ) then + write(*,*) 'r8 name error' + stop 1 + end if + if( vars_in(6)%type /= adios2_type_dp ) then + write(*,*) 'r8 type error' + stop 1 + end if + if( vars_in(6)%ndims /= 2 ) then + write(*,*) 'r8 dims error' + stop 1 + end if call adios2_variable_min(min_r8, vars_in(6), ierr) - if(min_r8 /= float(expected_min) ) stop 'r8 min error' + if(min_r8 /= float(expected_min) ) then + write(*,*) 'r8 min error' + stop 1 + end if call adios2_variable_max(max_r8, vars_in(6), ierr) - if(max_r8 /= float(expected_max) ) stop 'r8 max error' + if(max_r8 /= float(expected_max) ) then + write(*,*) 'r8 max error' + stop 1 + end if call adios2_get(bpReader, 'var_i1', in_data_i1, ierr) call adios2_get(bpReader, 'var_i2', in_data_i2, ierr) @@ -225,12 +333,30 @@ program TestBPWriteMemorySelectionRead2D do j=1,isize*ny do i=1,nx - if(in_data_i1(i,j) /= current_step) stop 'i1 read error' - if(in_data_i2(i,j) /= current_step) stop 'i2 read error' - if(in_data_i4(i,j) /= current_step) stop 'i4 read error' - if(in_data_i8(i,j) /= current_step) stop 'i8 read rerror' - if(in_data_r4(i,j) /= REAL(current_step, 4)) stop 'r4 read error' - if(in_data_r8(i,j) /= current_step) stop 'r8 read rerror' + if(in_data_i1(i,j) /= current_step) then + write(*,*) 'i1 read error' + stop 1 + end if + if(in_data_i2(i,j) /= current_step) then + write(*,*) 'i2 read error' + stop 1 + end if + if(in_data_i4(i,j) /= current_step) then + write(*,*) 'i4 read error' + stop 1 + end if + if(in_data_i8(i,j) /= current_step) then + write(*,*) 'i8 read rerror' + stop 1 + end if + if(in_data_r4(i,j) /= REAL(current_step, 4)) then + write(*,*) 'r4 read error' + stop 1 + end if + if(in_data_r8(i,j) /= current_step) then + write(*,*) 'r8 read rerror' + stop 1 + end if end do end do diff --git a/testing/adios2/bindings/fortran/TestBPWriteMemorySelectionRead3D.F90 b/testing/adios2/bindings/fortran/TestBPWriteMemorySelectionRead3D.F90 index 498c815f0e..a4721bf7dc 100644 --- a/testing/adios2/bindings/fortran/TestBPWriteMemorySelectionRead3D.F90 +++ b/testing/adios2/bindings/fortran/TestBPWriteMemorySelectionRead3D.F90 @@ -156,64 +156,172 @@ program TestBPWriteMemorySelectionRead3D expected_max = current_step call adios2_inquire_variable(vars_in(1), ioGet, 'var_i1', ierr) - if( vars_in(1)%valid .eqv. .false. ) stop 'i1 invalid error' - if( vars_in(1)%name /= 'var_i1' ) stop 'i1 name error' - if( vars_in(1)%type /= adios2_type_integer1 ) stop 'i1 type error' - if( vars_in(1)%ndims /= 3 ) stop 'i1 dims error' + if( vars_in(1)%valid .eqv. .false. ) then + write(*,*) 'i1 invalid error' + stop 1 + end if + if( vars_in(1)%name /= 'var_i1' ) then + write(*,*) 'i1 name error' + stop 1 + end if + if( vars_in(1)%type /= adios2_type_integer1 ) then + write(*,*) 'i1 type error' + stop 1 + end if + if( vars_in(1)%ndims /= 3 ) then + write(*,*) 'i1 dims error' + stop 1 + end if call adios2_variable_min(min_i1, vars_in(1), ierr) - if(min_i1 /= expected_min ) stop 'i1 min error' + if(min_i1 /= expected_min ) then + write(*,*) 'i1 min error' + stop 1 + end if call adios2_variable_max(max_i1, vars_in(1), ierr) - if(max_i1 /= expected_max ) stop 'i1 max error' + if(max_i1 /= expected_max ) then + write(*,*) 'i1 max error' + stop 1 + end if call adios2_inquire_variable(vars_in(2), ioGet, 'var_i2', ierr) - if( vars_in(2)%valid .eqv. .false. ) stop 'i2 invalid error' - if( vars_in(2)%name /= 'var_i2' ) stop 'i2 name error' - if( vars_in(2)%type /= adios2_type_integer2 ) stop 'i2 type error' - if( vars_in(2)%ndims /= 3 ) stop 'i2 dims error' + if( vars_in(2)%valid .eqv. .false. ) then + write(*,*) 'i2 invalid error' + stop 1 + end if + if( vars_in(2)%name /= 'var_i2' ) then + write(*,*) 'i2 name error' + stop 1 + end if + if( vars_in(2)%type /= adios2_type_integer2 ) then + write(*,*) 'i2 type error' + stop 1 + end if + if( vars_in(2)%ndims /= 3 ) then + write(*,*) 'i2 dims error' + stop 1 + end if call adios2_variable_min(min_i2, vars_in(2), ierr) - if(min_i2 /= expected_min ) stop 'i2 min error' + if(min_i2 /= expected_min ) then + write(*,*) 'i2 min error' + stop 1 + end if call adios2_variable_max(max_i2, vars_in(2), ierr) - if(max_i2 /= expected_max ) stop 'i2 max error' + if(max_i2 /= expected_max ) then + write(*,*) 'i2 max error' + stop 1 + end if call adios2_inquire_variable(vars_in(3), ioGet, 'var_i4', ierr) - if( vars_in(3)%valid .eqv. .false. ) stop 'i4 invalid error' - if( vars_in(3)%name /= 'var_i4' ) stop 'i4 name error' - if( vars_in(3)%type /= adios2_type_integer4 ) stop 'i4 type error' - if( vars_in(3)%ndims /= 3 ) stop 'i4 dims error' + if( vars_in(3)%valid .eqv. .false. ) then + write(*,*) 'i4 invalid error' + stop 1 + end if + if( vars_in(3)%name /= 'var_i4' ) then + write(*,*) 'i4 name error' + stop 1 + end if + if( vars_in(3)%type /= adios2_type_integer4 ) then + write(*,*) 'i4 type error' + stop 1 + end if + if( vars_in(3)%ndims /= 3 ) then + write(*,*) 'i4 dims error' + stop 1 + end if call adios2_variable_min(min_i4, vars_in(3), ierr) - if(min_i4 /= expected_min ) stop 'i4 min error' + if(min_i4 /= expected_min ) then + write(*,*) 'i4 min error' + stop 1 + end if call adios2_variable_max(max_i4, vars_in(3), ierr) - if(max_i4 /= expected_max ) stop 'i4 max error' + if(max_i4 /= expected_max ) then + write(*,*) 'i4 max error' + stop 1 + end if call adios2_inquire_variable(vars_in(4), ioGet, 'var_i8', ierr) - if( vars_in(4)%valid .eqv. .false. ) stop 'i8 invalid error' - if( vars_in(4)%name /= 'var_i8' ) stop 'i8 name error' - if( vars_in(4)%type /= adios2_type_integer8 ) stop 'i8 type error' - if( vars_in(4)%ndims /= 3 ) stop 'i8 dims error' + if( vars_in(4)%valid .eqv. .false. ) then + write(*,*) 'i8 invalid error' + stop 1 + end if + if( vars_in(4)%name /= 'var_i8' ) then + write(*,*) 'i8 name error' + stop 1 + end if + if( vars_in(4)%type /= adios2_type_integer8 ) then + write(*,*) 'i8 type error' + stop 1 + end if + if( vars_in(4)%ndims /= 3 ) then + write(*,*) 'i8 dims error' + stop 1 + end if call adios2_variable_min(min_i8, vars_in(4), ierr) - if(min_i8 /= expected_min ) stop 'i8 min error' + if(min_i8 /= expected_min ) then + write(*,*) 'i8 min error' + stop 1 + end if call adios2_variable_max(max_i8, vars_in(4), ierr) - if(max_i8 /= expected_max ) stop 'i8 max error' + if(max_i8 /= expected_max ) then + write(*,*) 'i8 max error' + stop 1 + end if call adios2_inquire_variable(vars_in(5), ioGet, 'var_r4', ierr) - if( vars_in(5)%valid .eqv. .false. ) stop 'r4 invalid error' - if( vars_in(5)%name /= 'var_r4' ) stop 'r4 name error' - if( vars_in(5)%type /= adios2_type_real ) stop 'r4 type error' - if( vars_in(5)%ndims /= 3 ) stop 'r4 dims error' + if( vars_in(5)%valid .eqv. .false. ) then + write(*,*) 'r4 invalid error' + stop 1 + end if + if( vars_in(5)%name /= 'var_r4' ) then + write(*,*) 'r4 name error' + stop 1 + end if + if( vars_in(5)%type /= adios2_type_real ) then + write(*,*) 'r4 type error' + stop 1 + end if + if( vars_in(5)%ndims /= 3 ) then + write(*,*) 'r4 dims error' + stop 1 + end if call adios2_variable_min(min_r4, vars_in(5), ierr) - if(min_r4 /= float(expected_min) ) stop 'r4 min error' + if(min_r4 /= float(expected_min) ) then + write(*,*) 'r4 min error' + stop 1 + end if call adios2_variable_max(max_r4, vars_in(5), ierr) - if(max_r4 /= float(expected_max) ) stop 'r4 max error' + if(max_r4 /= float(expected_max) ) then + write(*,*) 'r4 max error' + stop 1 + end if call adios2_inquire_variable(vars_in(6), ioGet, 'var_r8', ierr) - if( vars_in(6)%valid .eqv. .false. ) stop 'r8 invalid error' - if( vars_in(6)%name /= 'var_r8' ) stop 'r8 name error' - if( vars_in(6)%type /= adios2_type_dp ) stop 'r8 type error' - if( vars_in(6)%ndims /= 3 ) stop 'r8 dims error' + if( vars_in(6)%valid .eqv. .false. ) then + write(*,*) 'r8 invalid error' + stop 1 + end if + if( vars_in(6)%name /= 'var_r8' ) then + write(*,*) 'r8 name error' + stop 1 + end if + if( vars_in(6)%type /= adios2_type_dp ) then + write(*,*) 'r8 type error' + stop 1 + end if + if( vars_in(6)%ndims /= 3 ) then + write(*,*) 'r8 dims error' + stop 1 + end if call adios2_variable_min(min_r8, vars_in(6), ierr) - if(min_r8 /= float(expected_min) ) stop 'r8 min error' + if(min_r8 /= float(expected_min) ) then + write(*,*) 'r8 min error' + stop 1 + end if call adios2_variable_max(max_r8, vars_in(6), ierr) - if(max_r8 /= float(expected_max) ) stop 'r8 max error' + if(max_r8 /= float(expected_max) ) then + write(*,*) 'r8 max error' + stop 1 + end if call adios2_get(bpReader, 'var_i1', in_data_i1, ierr) call adios2_get(bpReader, 'var_i2', in_data_i2, ierr) @@ -226,12 +334,30 @@ program TestBPWriteMemorySelectionRead3D do k=1,isize*nz do j=1,ny do i=1,nx - if(in_data_i1(i,j,k) /= current_step) stop 'i1 read error' - if(in_data_i2(i,j,k) /= current_step) stop 'i2 read error' - if(in_data_i4(i,j,k) /= current_step) stop 'i4 read error' - if(in_data_i8(i,j,k) /= current_step) stop 'i8 read error' - if(in_data_r4(i,j,k) /= REAL(current_step, 4)) stop 'r4 read error' - if(in_data_r8(i,j,k) /= current_step) stop 'r8 read error' + if(in_data_i1(i,j,k) /= current_step) then + write(*,*) 'i1 read error' + stop 1 + end if + if(in_data_i2(i,j,k) /= current_step) then + write(*,*) 'i2 read error' + stop 1 + end if + if(in_data_i4(i,j,k) /= current_step) then + write(*,*) 'i4 read error' + stop 1 + end if + if(in_data_i8(i,j,k) /= current_step) then + write(*,*) 'i8 read error' + stop 1 + end if + if(in_data_r4(i,j,k) /= REAL(current_step, 4)) then + write(*,*) 'r4 read error' + stop 1 + end if + if(in_data_r8(i,j,k) /= current_step) then + write(*,*) 'r8 read error' + stop 1 + end if end do end do end do diff --git a/testing/adios2/bindings/fortran/TestBPWriteReadAttributes.F90 b/testing/adios2/bindings/fortran/TestBPWriteReadAttributes.F90 index d08ac47a5a..583aa83b77 100644 --- a/testing/adios2/bindings/fortran/TestBPWriteReadAttributes.F90 +++ b/testing/adios2/bindings/fortran/TestBPWriteReadAttributes.F90 @@ -45,7 +45,10 @@ program TestBPWriteAttributes call adios2_declare_io(ioWrite, adios, "ioWrite", ierr) do i=1,14 - if( attributes(i)%valid .eqv. .true. ) stop 'Invalid attribute default' + if( attributes(i)%valid .eqv. .true. ) then + write(*,*) 'Invalid attribute default' + stop 1 + end if end do ! single value @@ -93,12 +96,18 @@ program TestBPWriteAttributes data_R64, 3, ierr) do i=1,14 - if( attributes(i)%valid .eqv. .false. ) stop 'Invalid adios2_define_attribute' + if( attributes(i)%valid .eqv. .false. ) then + write(*,*) 'Invalid adios2_define_attribute' + stop 1 + end if end do ! Testing adios2_attribute_name for just one case call adios2_attribute_name(attrName, attributes(1), ierr) - if (attrName /= 'att_String') stop 'Invalid adios2_attribute_name' + if (attrName /= 'att_String') then + write(*,*) 'Invalid adios2_attribute_name' + stop 1 + end if deallocate(attrName) call adios2_open(bpWriter, ioWrite, "fattr_types.bp", adios2_mode_write, & @@ -116,23 +125,41 @@ program TestBPWriteAttributes ! Test getting list of attribute names call adios2_available_attributes(ioRead, namestruct, ierr) - if (ierr /= 0) stop 'adios2_available_attributes returned with error' - if (.not.namestruct%valid) stop 'adios2_available_attributes returned invalid struct' + if (ierr /= 0) then + write(*,*) 'adios2_available_attributes returned with error' + stop 1 + end if + if (.not.namestruct%valid) then + write(*,*) 'adios2_available_attributes returned invalid struct' + stop 1 + end if write(*,*) 'Number of attributes = ', namestruct%count write(*,*) 'Max name length = ', namestruct%max_name_len - if (namestruct%count /= 14) stop 'adios2_available_attributes returned not the expected 14' + if (namestruct%count /= 14) then + write(*,*) 'adios2_available_attributes returned not the expected 14' + stop 1 + end if allocate(attrnamelist(namestruct%count)) call adios2_retrieve_names(namestruct, attrnamelist, ierr) - if (ierr /= 0) stop 'adios2_retrieve_names returned with error' + if (ierr /= 0) then + write(*,*) 'adios2_retrieve_names returned with error' + stop 1 + end if do i=1,namestruct%count write(*,'("Attr[",i2,"] = ",a20)') i, attrnamelist(i) end do deallocate(attrnamelist) - if (namestruct%f2c /= 0_8) stop 'namestruct f2c pointer is not null after adios2_retrieve_names()' - if (namestruct%valid) stop 'namestruct is not invalidated after adios2_retrieve_names()' + if (namestruct%f2c /= 0_8) then + write(*,*) 'namestruct f2c pointer is not null after adios2_retrieve_names()' + stop 1 + end if + if (namestruct%valid) then + write(*,*) 'namestruct is not invalidated after adios2_retrieve_names()' + stop 1 + end if call adios2_inquire_attribute(attributes_in(1), ioRead, 'att_String', ierr) @@ -143,54 +170,159 @@ program TestBPWriteAttributes call adios2_inquire_attribute(attributes_in(6), ioRead, 'att_r32', ierr) call adios2_inquire_attribute(attributes_in(7), ioRead, 'att_r64', ierr) - if(attributes_in(1)%valid .eqv. .false.) stop 'attribute iString not found' - if(attributes_in(1)%type /= adios2_type_string) stop 'attribute iString wrong type' - if(attributes_in(1)%length /= 1) stop 'attribute iString length is not 1' - if(attributes_in(1)%is_value .eqv. .false.) stop 'attribute iString must be value' + if(attributes_in(1)%valid .eqv. .false.) then + write(*,*) 'attribute iString not found' + stop 1 + end if + if(attributes_in(1)%type /= adios2_type_string) then + write(*,*) 'attribute iString wrong type' + stop 1 + end if + if(attributes_in(1)%length /= 1) then + write(*,*) 'attribute iString length is not 1' + stop 1 + end if + if(attributes_in(1)%is_value .eqv. .false.) then + write(*,*) 'attribute iString must be value' + stop 1 + end if call adios2_attribute_data( iString_value, attributes_in(1), ierr) - if( iString_value /= 'ADIOS2 String attribute' ) stop 'attribute iString data error' - - if(attributes_in(2)%valid .eqv. .false.) stop 'attribute i8 not found' - if(attributes_in(2)%type /= adios2_type_integer1) stop 'attribute i8 wrong type' - if(attributes_in(2)%length /= 1) stop 'attribute i8 length is not 1' - if(attributes_in(2)%is_value .eqv. .false.) stop 'attribute i8 must be value' + if( iString_value /= 'ADIOS2 String attribute' ) then + write(*,*) 'attribute iString data error' + stop 1 + end if + + if(attributes_in(2)%valid .eqv. .false.) then + write(*,*) 'attribute i8 not found' + stop 1 + end if + if(attributes_in(2)%type /= adios2_type_integer1) then + write(*,*) 'attribute i8 wrong type' + stop 1 + end if + if(attributes_in(2)%length /= 1) then + write(*,*) 'attribute i8 length is not 1' + stop 1 + end if + if(attributes_in(2)%is_value .eqv. .false.) then + write(*,*) 'attribute i8 must be value' + stop 1 + end if call adios2_attribute_data( i8_value, attributes_in(2), ierr) - if( i8_value /= data_I8(1) ) stop 'attribute i8 data error' - - if(attributes_in(3)%valid .eqv. .false.) stop 'attribute i16 not found' - if(attributes_in(3)%type /= adios2_type_integer2) stop 'attribute i16 wrong type' - if(attributes_in(3)%length /= 1) stop 'attribute i16 length is not 1' - if(attributes_in(3)%is_value .eqv. .false.) stop 'attribute i16 must be value' + if( i8_value /= data_I8(1) ) then + write(*,*) 'attribute i8 data error' + stop 1 + end if + + if(attributes_in(3)%valid .eqv. .false.) then + write(*,*) 'attribute i16 not found' + stop 1 + end if + if(attributes_in(3)%type /= adios2_type_integer2) then + write(*,*) 'attribute i16 wrong type' + stop 1 + end if + if(attributes_in(3)%length /= 1) then + write(*,*) 'attribute i16 length is not 1' + stop 1 + end if + if(attributes_in(3)%is_value .eqv. .false.) then + write(*,*) 'attribute i16 must be value' + stop 1 + end if call adios2_attribute_data( i16_value, attributes_in(3), ierr) - if( i16_value /= data_I16(1) ) stop 'attribute i16 data error' - - if(attributes_in(4)%valid .eqv. .false.) stop 'attribute i32 not found' - if(attributes_in(4)%type /= adios2_type_integer4) stop 'attribute i32 wrong type' - if(attributes_in(4)%length /= 1) stop 'attribute i32 length is not 1' - if(attributes_in(4)%is_value .eqv. .false.) stop 'attribute i32 must be value' + if( i16_value /= data_I16(1) ) then + write(*,*) 'attribute i16 data error' + stop 1 + end if + + if(attributes_in(4)%valid .eqv. .false.) then + write(*,*) 'attribute i32 not found' + stop 1 + end if + if(attributes_in(4)%type /= adios2_type_integer4) then + write(*,*) 'attribute i32 wrong type' + stop 1 + end if + if(attributes_in(4)%length /= 1) then + write(*,*) 'attribute i32 length is not 1' + stop 1 + end if + if(attributes_in(4)%is_value .eqv. .false.) then + write(*,*) 'attribute i32 must be value' + stop 1 + end if call adios2_attribute_data( i32_value, attributes_in(4), ierr) - if( i32_value /= data_I32(1) ) stop 'attribute i32 data error' - - if(attributes_in(5)%valid .eqv. .false.) stop 'attribute i64 not found' - if(attributes_in(5)%type /= adios2_type_integer8) stop 'attribute i64 wrong type' - if(attributes_in(5)%length /= 1) stop 'attribute i64 length is not 1' - if(attributes_in(5)%is_value .eqv. .false.) stop 'attribute i64 must be value' + if( i32_value /= data_I32(1) ) then + write(*,*) 'attribute i32 data error' + stop 1 + end if + + if(attributes_in(5)%valid .eqv. .false.) then + write(*,*) 'attribute i64 not found' + stop 1 + end if + if(attributes_in(5)%type /= adios2_type_integer8) then + write(*,*) 'attribute i64 wrong type' + stop 1 + end if + if(attributes_in(5)%length /= 1) then + write(*,*) 'attribute i64 length is not 1' + stop 1 + end if + if(attributes_in(5)%is_value .eqv. .false.) then + write(*,*) 'attribute i64 must be value' + stop 1 + end if call adios2_attribute_data( i64_value, attributes_in(5), ierr) - if( i64_value /= data_I64(1) ) stop 'attribute i64 data error' - - if(attributes_in(6)%valid .eqv. .false.) stop 'attribute r32 not found' - if(attributes_in(6)%type /= adios2_type_real) stop 'attribute r32 wrong type' - if(attributes_in(6)%length /= 1) stop 'attribute r32 length is not 1' - if(attributes_in(6)%is_value .eqv. .false.) stop 'attribute r32 must be value' + if( i64_value /= data_I64(1) ) then + write(*,*) 'attribute i64 data error' + stop 1 + end if + + if(attributes_in(6)%valid .eqv. .false.) then + write(*,*) 'attribute r32 not found' + stop 1 + end if + if(attributes_in(6)%type /= adios2_type_real) then + write(*,*) 'attribute r32 wrong type' + stop 1 + end if + if(attributes_in(6)%length /= 1) then + write(*,*) 'attribute r32 length is not 1' + stop 1 + end if + if(attributes_in(6)%is_value .eqv. .false.) then + write(*,*) 'attribute r32 must be value' + stop 1 + end if call adios2_attribute_data( r32_value, attributes_in(6), ierr) - if( r32_value /= data_R32(1) ) stop 'attribute r32 data error' - - if(attributes_in(7)%valid .eqv. .false.) stop 'attribute r64 not found' - if(attributes_in(7)%type /= adios2_type_dp) stop 'attribute r64 wrong type' - if(attributes_in(7)%length /= 1) stop 'attribute r64 length is not 1' - if(attributes_in(7)%is_value .eqv. .false.) stop 'attribute r64 must be value' + if( r32_value /= data_R32(1) ) then + write(*,*) 'attribute r32 data error' + stop 1 + end if + + if(attributes_in(7)%valid .eqv. .false.) then + write(*,*) 'attribute r64 not found' + stop 1 + end if + if(attributes_in(7)%type /= adios2_type_dp) then + write(*,*) 'attribute r64 wrong type' + stop 1 + end if + if(attributes_in(7)%length /= 1) then + write(*,*) 'attribute r64 length is not 1' + stop 1 + end if + if(attributes_in(7)%is_value .eqv. .false.) then + write(*,*) 'attribute r64 must be value' + stop 1 + end if call adios2_attribute_data( r64_value, attributes_in(7), ierr) - if( r64_value /= data_R64(1) ) stop 'attribute r64 data error' + if( r64_value /= data_R64(1) ) then + write(*,*) 'attribute r64 data error' + stop 1 + end if ! Array call adios2_inquire_attribute(attributes_in(8), ioRead, 'att_Strings_array', ierr) @@ -201,67 +333,172 @@ program TestBPWriteAttributes call adios2_inquire_attribute(attributes_in(13), ioRead, 'att_r32_array', ierr) call adios2_inquire_attribute(attributes_in(14), ioRead, 'att_r64_array', ierr) - if(attributes_in(8)%valid .eqv. .false.) stop 'attribute string array not found' - if(attributes_in(8)%type /= adios2_type_string) stop 'attribute string array wrong type' - if(attributes_in(8)%length /= 3) stop 'attribute string array length is not 3' - if(attributes_in(8)%is_value .eqv. .true.) stop 'attribute string array must be array' + if(attributes_in(8)%valid .eqv. .false.) then + write(*,*) 'attribute string array not found' + stop 1 + end if + if(attributes_in(8)%type /= adios2_type_string) then + write(*,*) 'attribute string array wrong type' + stop 1 + end if + if(attributes_in(8)%length /= 3) then + write(*,*) 'attribute string array length is not 3' + stop 1 + end if + if(attributes_in(8)%is_value .eqv. .true.) then + write(*,*) 'attribute string array must be array' + stop 1 + end if call adios2_attribute_data( iString_array, attributes_in(8), ierr) do i=1,3 - if( iString_array(i) /= data_Strings(i) ) stop 'attribute string array data error' + if( iString_array(i) /= data_Strings(i) ) then + write(*,*) 'attribute string array data error' + stop 1 + end if end do - if(attributes_in(9)%valid .eqv. .false.) stop 'attribute i8 array not found' - if(attributes_in(9)%type /= adios2_type_integer1) stop 'attribute i8 array wrong type' - if(attributes_in(9)%length /= 3) stop 'attribute i8 array length is not 3' - if(attributes_in(9)%is_value .eqv. .true.) stop 'attribute i8 array must be array' + if(attributes_in(9)%valid .eqv. .false.) then + write(*,*) 'attribute i8 array not found' + stop 1 + end if + if(attributes_in(9)%type /= adios2_type_integer1) then + write(*,*) 'attribute i8 array wrong type' + stop 1 + end if + if(attributes_in(9)%length /= 3) then + write(*,*) 'attribute i8 array length is not 3' + stop 1 + end if + if(attributes_in(9)%is_value .eqv. .true.) then + write(*,*) 'attribute i8 array must be array' + stop 1 + end if call adios2_attribute_data( i8_array, attributes_in(9), ierr) do i=1,3 - if( i8_array(i) /= data_I8(i) ) stop 'attribute i8 array data error' + if( i8_array(i) /= data_I8(i) ) then + write(*,*) 'attribute i8 array data error' + stop 1 + end if end do - if(attributes_in(10)%valid .eqv. .false.) stop 'attribute i16 array not found' - if(attributes_in(10)%type /= adios2_type_integer2) stop 'attribute i16 array wrong type' - if(attributes_in(10)%length /= 3) stop 'attribute i16 array length is not 3' - if(attributes_in(10)%is_value .eqv. .true.) stop 'attribute i16 array must be array' + if(attributes_in(10)%valid .eqv. .false.) then + write(*,*) 'attribute i16 array not found' + stop 1 + end if + if(attributes_in(10)%type /= adios2_type_integer2) then + write(*,*) 'attribute i16 array wrong type' + stop 1 + end if + if(attributes_in(10)%length /= 3) then + write(*,*) 'attribute i16 array length is not 3' + stop 1 + end if + if(attributes_in(10)%is_value .eqv. .true.) then + write(*,*) 'attribute i16 array must be array' + stop 1 + end if call adios2_attribute_data( i16_array, attributes_in(10), ierr) do i=1,3 - if( i16_array(i) /= data_I16(i) ) stop 'attribute i16 array data error' + if( i16_array(i) /= data_I16(i) ) then + write(*,*) 'attribute i16 array data error' + stop 1 + end if end do - if(attributes_in(11)%valid .eqv. .false.) stop 'attribute i32 array not found' - if(attributes_in(11)%type /= adios2_type_integer4) stop 'attribute i32 array wrong type' - if(attributes_in(11)%length /= 3) stop 'attribute i32 array length is not 3' - if(attributes_in(11)%is_value .eqv. .true.) stop 'attribute i32 array must be array' + if(attributes_in(11)%valid .eqv. .false.) then + write(*,*) 'attribute i32 array not found' + stop 1 + end if + if(attributes_in(11)%type /= adios2_type_integer4) then + write(*,*) 'attribute i32 array wrong type' + stop 1 + end if + if(attributes_in(11)%length /= 3) then + write(*,*) 'attribute i32 array length is not 3' + stop 1 + end if + if(attributes_in(11)%is_value .eqv. .true.) then + write(*,*) 'attribute i32 array must be array' + stop 1 + end if call adios2_attribute_data( i32_array, attributes_in(11), ierr) do i=1,3 - if( i32_array(i) /= data_I32(i) ) stop 'attribute i32 array data error' + if( i32_array(i) /= data_I32(i) ) then + write(*,*) 'attribute i32 array data error' + stop 1 + end if end do - if(attributes_in(12)%valid .eqv. .false.) stop 'attribute i64 array not found' - if(attributes_in(12)%type /= adios2_type_integer8) stop 'attribute i64 array wrong type' - if(attributes_in(12)%length /= 3) stop 'attribute i64 array length is not 3' - if(attributes_in(12)%is_value .eqv. .true.) stop 'attribute i64 array must be array' + if(attributes_in(12)%valid .eqv. .false.) then + write(*,*) 'attribute i64 array not found' + stop 1 + end if + if(attributes_in(12)%type /= adios2_type_integer8) then + write(*,*) 'attribute i64 array wrong type' + stop 1 + end if + if(attributes_in(12)%length /= 3) then + write(*,*) 'attribute i64 array length is not 3' + stop 1 + end if + if(attributes_in(12)%is_value .eqv. .true.) then + write(*,*) 'attribute i64 array must be array' + stop 1 + end if call adios2_attribute_data( i64_array, attributes_in(12), ierr) do i=1,3 - if( i64_array(i) /= data_I64(i) ) stop 'attribute i64 array data error' + if( i64_array(i) /= data_I64(i) ) then + write(*,*) 'attribute i64 array data error' + stop 1 + end if end do - if(attributes_in(13)%valid .eqv. .false.) stop 'attribute r32 array not found' - if(attributes_in(13)%type /= adios2_type_real) stop 'attribute r32 array wrong type' - if(attributes_in(13)%length /= 3) stop 'attribute r32 array length is not 3' - if(attributes_in(13)%is_value .eqv. .true.) stop 'attribute r32 array must be array' + if(attributes_in(13)%valid .eqv. .false.) then + write(*,*) 'attribute r32 array not found' + stop 1 + end if + if(attributes_in(13)%type /= adios2_type_real) then + write(*,*) 'attribute r32 array wrong type' + stop 1 + end if + if(attributes_in(13)%length /= 3) then + write(*,*) 'attribute r32 array length is not 3' + stop 1 + end if + if(attributes_in(13)%is_value .eqv. .true.) then + write(*,*) 'attribute r32 array must be array' + stop 1 + end if call adios2_attribute_data( r32_array, attributes_in(13), ierr) do i=1,3 - if( r32_array(i) /= data_R32(i) ) stop 'attribute r32 array data error' + if( r32_array(i) /= data_R32(i) ) then + write(*,*) 'attribute r32 array data error' + stop 1 + end if end do - if(attributes_in(14)%valid .eqv. .false.) stop 'attribute r64 array not found' - if(attributes_in(14)%type /= adios2_type_dp) stop 'attribute r64 array wrong type' - if(attributes_in(14)%length /= 3) stop 'attribute r64 array length is not 3' - if(attributes_in(14)%is_value .eqv. .true.) stop 'attribute r64 array must be array' + if(attributes_in(14)%valid .eqv. .false.) then + write(*,*) 'attribute r64 array not found' + stop 1 + end if + if(attributes_in(14)%type /= adios2_type_dp) then + write(*,*) 'attribute r64 array wrong type' + stop 1 + end if + if(attributes_in(14)%length /= 3) then + write(*,*) 'attribute r64 array length is not 3' + stop 1 + end if + if(attributes_in(14)%is_value .eqv. .true.) then + write(*,*) 'attribute r64 array must be array' + stop 1 + end if call adios2_attribute_data( r64_array, attributes_in(14), ierr) do i=1,3 - if( r64_array(i) /= data_R64(i) ) stop 'attribute r64 array data error' + if( r64_array(i) /= data_R64(i) ) then + write(*,*) 'attribute r64 array data error' + stop 1 + end if end do call adios2_close(bpReader, ierr) diff --git a/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap2D.F90 b/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap2D.F90 index 510a7d07e2..c18fe044bf 100644 --- a/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap2D.F90 +++ b/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap2D.F90 @@ -187,12 +187,30 @@ program TestBPWriteReadHeatMap2D end do end do - if (sum_i1 /= 50*isize) stop 'Test failed integer*1' - if (sum_i2 /= 50*isize) stop 'Test failed integer*2' - if (sum(sel_temperatures_i4) /= 50*isize) stop 'Test failed integer*4' - if (sum(sel_temperatures_i8) /= 50*isize) stop 'Test failed integer*8' - if (sum(sel_temperatures_r4) /= 50*isize) stop 'Test failed real*4' - if (sum(sel_temperatures_r8) /= 50*isize) stop 'Test failed real*8' + if (sum_i1 /= 50*isize) then + write(*,*) 'Test failed integer*1' + stop 1 + end if + if (sum_i2 /= 50*isize) then + write(*,*) 'Test failed integer*2' + stop 1 + end if + if (sum(sel_temperatures_i4) /= 50*isize) then + write(*,*) 'Test failed integer*4' + stop 1 + end if + if (sum(sel_temperatures_i8) /= 50*isize) then + write(*,*) 'Test failed integer*8' + stop 1 + end if + if (sum(sel_temperatures_r4) /= 50*isize) then + write(*,*) 'Test failed real*4' + stop 1 + end if + if (sum(sel_temperatures_r8) /= 50*isize) then + write(*,*) 'Test failed real*8' + stop 1 + end if if (allocated(sel_temperatures_i1)) deallocate (sel_temperatures_i1) if (allocated(sel_temperatures_i2)) deallocate (sel_temperatures_i2) diff --git a/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap3D.F90 b/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap3D.F90 index 06b7954b0c..55df80789f 100644 --- a/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap3D.F90 +++ b/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap3D.F90 @@ -190,12 +190,30 @@ program TestBPWriteReadHeatMap3D end do end do - if (sum_i1 /= 500*isize) stop 'Test failed integer*1' - if (sum_i2 /= 500*isize) stop 'Test failed integer*2' - if (sum(sel_temperatures_i4) /= 500*isize) stop 'Test failed integer*4' - if (sum(sel_temperatures_i8) /= 500*isize) stop 'Test failed integer*8' - if (sum(sel_temperatures_r4) /= 500*isize) stop 'Test failed real*4' - if (sum(sel_temperatures_r8) /= 500*isize) stop 'Test failed real*8' + if (sum_i1 /= 500*isize) then + write(*,*) 'Test failed integer*1' + stop 1 + end if + if (sum_i2 /= 500*isize) then + write(*,*) 'Test failed integer*2' + stop 1 + end if + if (sum(sel_temperatures_i4) /= 500*isize) then + write(*,*) 'Test failed integer*4' + stop 1 + end if + if (sum(sel_temperatures_i8) /= 500*isize) then + write(*,*) 'Test failed integer*8' + stop 1 + end if + if (sum(sel_temperatures_r4) /= 500*isize) then + write(*,*) 'Test failed real*4' + stop 1 + end if + if (sum(sel_temperatures_r8) /= 500*isize) then + write(*,*) 'Test failed real*8' + stop 1 + end if if (allocated(sel_temperatures_i1)) deallocate (sel_temperatures_i1) if (allocated(sel_temperatures_i2)) deallocate (sel_temperatures_i2) diff --git a/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap4D.F90 b/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap4D.F90 index 3111567d62..ce2711ad7c 100644 --- a/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap4D.F90 +++ b/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap4D.F90 @@ -194,12 +194,30 @@ program TestBPWriteReadHeatMap4D end do end do - if (sum_i1 /= 10000*isize) stop 'Test failed integer*1' - if (sum_i2 /= 10000*isize) stop 'Test failed integer*2' - if (sum(sel_temperatures_i4) /= 10000*isize) stop 'Test failed integer*4' - if (sum(sel_temperatures_i8) /= 10000*isize) stop 'Test failed integer*8' - if (sum(sel_temperatures_r4) /= 10000*isize) stop 'Test failed real*4' - if (sum(sel_temperatures_r8) /= 10000*isize) stop 'Test failed real*8' + if (sum_i1 /= 10000*isize) then + write(*,*) 'Test failed integer*1' + stop 1 + end if + if (sum_i2 /= 10000*isize) then + write(*,*) 'Test failed integer*2' + stop 1 + end if + if (sum(sel_temperatures_i4) /= 10000*isize) then + write(*,*) 'Test failed integer*4' + stop 1 + end if + if (sum(sel_temperatures_i8) /= 10000*isize) then + write(*,*) 'Test failed integer*8' + stop 1 + end if + if (sum(sel_temperatures_r4) /= 10000*isize) then + write(*,*) 'Test failed real*4' + stop 1 + end if + if (sum(sel_temperatures_r8) /= 10000*isize) then + write(*,*) 'Test failed real*8' + stop 1 + end if if (allocated(sel_temperatures_i1)) deallocate (sel_temperatures_i1) if (allocated(sel_temperatures_i2)) deallocate (sel_temperatures_i2) diff --git a/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap5D.F90 b/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap5D.F90 index 20eed9cee1..bc6b970217 100644 --- a/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap5D.F90 +++ b/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap5D.F90 @@ -203,12 +203,30 @@ program TestBPWriteReadHeatMap5D end do end do - if (sum_i1 /= 100000*isize) stop 'Test failed integer*1' - if (sum_i2 /= 100000*isize) stop 'Test failed integer*2' - if (sum(sel_temperatures_i4) /= 100000*isize) stop 'Test failed integer*4' - if (sum(sel_temperatures_i8) /= 100000*isize) stop 'Test failed integer*8' - if (sum(sel_temperatures_r4) /= 100000*isize) stop 'Test failed real*4' - if (sum(sel_temperatures_r8) /= 100000*isize) stop 'Test failed real*8' + if (sum_i1 /= 100000*isize) then + write(*,*) 'Test failed integer*1' + stop 1 + end if + if (sum_i2 /= 100000*isize) then + write(*,*) 'Test failed integer*2' + stop 1 + end if + if (sum(sel_temperatures_i4) /= 100000*isize) then + write(*,*) 'Test failed integer*4' + stop 1 + end if + if (sum(sel_temperatures_i8) /= 100000*isize) then + write(*,*) 'Test failed integer*8' + stop 1 + end if + if (sum(sel_temperatures_r4) /= 100000*isize) then + write(*,*) 'Test failed real*4' + stop 1 + end if + if (sum(sel_temperatures_r8) /= 100000*isize) then + write(*,*) 'Test failed real*8' + stop 1 + end if if (allocated(sel_temperatures_i1)) deallocate (sel_temperatures_i1) if (allocated(sel_temperatures_i2)) deallocate (sel_temperatures_i2) diff --git a/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap6D.F90 b/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap6D.F90 index f749102237..ac9f035156 100644 --- a/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap6D.F90 +++ b/testing/adios2/bindings/fortran/TestBPWriteReadHeatMap6D.F90 @@ -207,12 +207,30 @@ program TestBPWriteReadHeatMap6D end do end do - if (sum_i1 /= 1000000*isize) stop 'Test failed integer*1' - if (sum_i2 /= 1000000*isize) stop 'Test failed integer*2' - if (sum(sel_temperatures_i4) /= 1000000*isize) stop 'Test failed integer*4' - if (sum(sel_temperatures_i8) /= 1000000*isize) stop 'Test failed integer*8' - if (sum(sel_temperatures_r4) /= 1000000*isize) stop 'Test failed real*4' - if (sum(sel_temperatures_r8) /= 1000000*isize) stop 'Test failed real*8' + if (sum_i1 /= 1000000*isize) then + write(*,*) 'Test failed integer*1' + stop 1 + end if + if (sum_i2 /= 1000000*isize) then + write(*,*) 'Test failed integer*2' + stop 1 + end if + if (sum(sel_temperatures_i4) /= 1000000*isize) then + write(*,*) 'Test failed integer*4' + stop 1 + end if + if (sum(sel_temperatures_i8) /= 1000000*isize) then + write(*,*) 'Test failed integer*8' + stop 1 + end if + if (sum(sel_temperatures_r4) /= 1000000*isize) then + write(*,*) 'Test failed real*4' + stop 1 + end if + if (sum(sel_temperatures_r8) /= 1000000*isize) then + write(*,*) 'Test failed real*8' + stop 1 + end if if (allocated(sel_temperatures_i1)) deallocate (sel_temperatures_i1) if (allocated(sel_temperatures_i2)) deallocate (sel_temperatures_i2) diff --git a/testing/adios2/bindings/fortran/TestBPWriteTypesByName.F90 b/testing/adios2/bindings/fortran/TestBPWriteTypesByName.F90 index 13d1bf047d..0c7c74afdc 100644 --- a/testing/adios2/bindings/fortran/TestBPWriteTypesByName.F90 +++ b/testing/adios2/bindings/fortran/TestBPWriteTypesByName.F90 @@ -127,46 +127,118 @@ program TestBPWriteTypes step_status, ierr) call adios2_inquire_variable(variables(1), ioRead, "var_I8", ierr) - if (variables(1)%name /= 'var_I8') stop 'var_I8 not recognized' - if (variables(1)%type /= adios2_type_integer1) stop 'var_I8 type not recognized' + if (variables(1)%name /= 'var_I8') then + write(*,*) 'var_I8 not recognized' + stop 1 + end if + if (variables(1)%type /= adios2_type_integer1) then + write(*,*) 'var_I8 type not recognized' + stop 1 + end if call adios2_variable_shape(shape_in, ndims, variables(1), ierr) - if (ndims /= 1) stop 'var_I8 ndims is not 1' - if (shape_in(1) /= isize*inx) stop 'var_I8 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'var_I8 ndims is not 1' + stop 1 + end if + if (shape_in(1) /= isize*inx) then + write(*,*) 'var_I8 shape_in read failed' + stop 1 + end if call adios2_inquire_variable(variables(2), ioRead, "var_I16", ierr) - if (variables(2)%name /= 'var_I16') stop 'var_I16 not recognized' - if (variables(2)%type /= adios2_type_integer2) stop 'var_I16 type not recognized' + if (variables(2)%name /= 'var_I16') then + write(*,*) 'var_I16 not recognized' + stop 1 + end if + if (variables(2)%type /= adios2_type_integer2) then + write(*,*) 'var_I16 type not recognized' + stop 1 + end if call adios2_variable_shape( shape_in, ndims,variables(2),ierr) - if (ndims /= 1) stop 'var_I16 ndims is not 1' - if (shape_in(1) /= isize*inx) stop 'var_I16 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'var_I16 ndims is not 1' + stop 1 + end if + if (shape_in(1) /= isize*inx) then + write(*,*) 'var_I16 shape_in read failed' + stop 1 + end if call adios2_inquire_variable(variables(3), ioRead, "var_I32", ierr) - if (variables(3)%name /= 'var_I32') stop 'var_I32 not recognized' - if (variables(3)%type /= adios2_type_integer4) stop 'var_I32 type not recognized' + if (variables(3)%name /= 'var_I32') then + write(*,*) 'var_I32 not recognized' + stop 1 + end if + if (variables(3)%type /= adios2_type_integer4) then + write(*,*) 'var_I32 type not recognized' + stop 1 + end if call adios2_variable_shape( shape_in, ndims, variables(3),ierr) - if (ndims /= 1) stop 'var_I32 ndims is not 1' - if (shape_in(1) /= isize*inx) stop 'var_I32 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'var_I32 ndims is not 1' + stop 1 + end if + if (shape_in(1) /= isize*inx) then + write(*,*) 'var_I32 shape_in read failed' + stop 1 + end if call adios2_inquire_variable(variables(4), ioRead, "var_I64", ierr) - if (variables(4)%name /= 'var_I64') stop 'var_I64 not recognized' - if (variables(4)%type /= adios2_type_integer8) stop 'var_I64 type not recognized' + if (variables(4)%name /= 'var_I64') then + write(*,*) 'var_I64 not recognized' + stop 1 + end if + if (variables(4)%type /= adios2_type_integer8) then + write(*,*) 'var_I64 type not recognized' + stop 1 + end if call adios2_variable_shape(shape_in, ndims, variables(4),ierr) - if (ndims /= 1) stop 'var_I64 ndims is not 1' - if (shape_in(1) /= isize*inx) stop 'var_I64 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'var_I64 ndims is not 1' + stop 1 + end if + if (shape_in(1) /= isize*inx) then + write(*,*) 'var_I64 shape_in read failed' + stop 1 + end if call adios2_inquire_variable(variables(5), ioRead, "var_R32", ierr) - if (variables(5)%name /= 'var_R32') stop 'var_R32 not recognized' - if (variables(5)%type /= adios2_type_real) stop 'var_R32 type not recognized' + if (variables(5)%name /= 'var_R32') then + write(*,*) 'var_R32 not recognized' + stop 1 + end if + if (variables(5)%type /= adios2_type_real) then + write(*,*) 'var_R32 type not recognized' + stop 1 + end if call adios2_variable_shape( shape_in, ndims, variables(5), ierr) - if (ndims /= 1) stop 'var_R32 ndims is not 1' - if (shape_in(1) /= isize*inx) stop 'var_R32 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'var_R32 ndims is not 1' + stop 1 + end if + if (shape_in(1) /= isize*inx) then + write(*,*) 'var_R32 shape_in read failed' + stop 1 + end if call adios2_inquire_variable(variables(6), ioRead, "var_R64", ierr) - if (variables(6)%name /= 'var_R64') stop 'var_R64 not recognized' - if (variables(6)%type /= adios2_type_dp) stop 'var_R64 type not recognized' + if (variables(6)%name /= 'var_R64') then + write(*,*) 'var_R64 not recognized' + stop 1 + end if + if (variables(6)%type /= adios2_type_dp) then + write(*,*) 'var_R64 type not recognized' + stop 1 + end if call adios2_variable_shape( shape_in, ndims, variables(6), ierr) - if (ndims /= 1) stop 'var_R64 ndims is not 1' - if (shape_in(1) /= isize*inx) stop 'var_R64 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'var_R64 ndims is not 1' + stop 1 + end if + if (shape_in(1) /= isize*inx) then + write(*,*) 'var_R64 shape_in read failed' + stop 1 + end if call adios2_end_step(bpReader, ierr) diff --git a/testing/adios2/bindings/fortran/TestBPWriteTypesLocal.F90 b/testing/adios2/bindings/fortran/TestBPWriteTypesLocal.F90 index 41081593e9..6c8ef24210 100644 --- a/testing/adios2/bindings/fortran/TestBPWriteTypesLocal.F90 +++ b/testing/adios2/bindings/fortran/TestBPWriteTypesLocal.F90 @@ -104,15 +104,24 @@ program TestBPWriteTypes adios2_variable_dims, ierr) write (*, *) "Engine type: ", ioWrite%engine_type - if (TRIM(ioWrite%engine_type) /= 'File') stop 'Wrong engine_type' + if (TRIM(ioWrite%engine_type) /= 'File') then + write(*,*) 'Wrong engine_type' + stop 1 + end if call adios2_set_engine(ioWrite, "SST", ierr) write (*, *) "Engine type: ", ioWrite%engine_type - if (TRIM(ioWrite%engine_type) /= 'SST') stop 'Wrong engine_type' + if (TRIM(ioWrite%engine_type) /= 'SST') then + write(*,*) 'Wrong engine_type' + stop 1 + end if call adios2_at_io(ioDummy, adios, "ioWrite", ierr) write (*, *) "Engine type: ", ioDummy%engine_type - if (TRIM(ioDummy%engine_type) /= 'SST') stop 'Wrong engine_type' + if (TRIM(ioDummy%engine_type) /= 'SST') then + write(*,*) 'Wrong engine_type' + stop 1 + end if call adios2_set_engine(ioWrite, "BPFile", ierr) @@ -124,7 +133,10 @@ program TestBPWriteTypes call adios2_begin_step(bpWriter, ierr) call adios2_current_step(current_step, bpWriter, ierr) - if (current_step /= s - 1) stop 'wrong current step' + if (current_step /= s - 1) then + write(*,*) 'wrong current step' + stop 1 + end if if (irank == 0 .and. s == 1) then call adios2_put(bpWriter, variables(7), data_I8(1), ierr) @@ -181,57 +193,135 @@ program TestBPWriteTypes if (current_step == 0) then call adios2_inquire_variable(variables(7), ioRead, "gvar_I8", ierr) - if (variables(7)%name /= 'gvar_I8') stop 'gvar_I8 name not recognized' - if (variables(7)%type /= adios2_type_integer1) stop 'gvar_I8 type not recognized' + if (variables(7)%name /= 'gvar_I8') then + write(*,*) 'gvar_I8 name not recognized' + stop 1 + end if + if (variables(7)%type /= adios2_type_integer1) then + write(*,*) 'gvar_I8 type not recognized' + stop 1 + end if call adios2_inquire_variable(variables(8), ioRead, "gvar_I16", ierr) - if (variables(8)%name /= 'gvar_I16') stop 'gvar_I16 name not recognized' - if (variables(8)%type /= adios2_type_integer2) stop 'gvar_I16 type not recognized' + if (variables(8)%name /= 'gvar_I16') then + write(*,*) 'gvar_I16 name not recognized' + stop 1 + end if + if (variables(8)%type /= adios2_type_integer2) then + write(*,*) 'gvar_I16 type not recognized' + stop 1 + end if call adios2_inquire_variable(variables(9), ioRead, "gvar_I32", ierr) - if (variables(9)%name /= 'gvar_I32') stop 'gvar_I32 name not recognized' - if (variables(9)%type /= adios2_type_integer4) stop 'gvar_I32 type not recognized' + if (variables(9)%name /= 'gvar_I32') then + write(*,*) 'gvar_I32 name not recognized' + stop 1 + end if + if (variables(9)%type /= adios2_type_integer4) then + write(*,*) 'gvar_I32 type not recognized' + stop 1 + end if call adios2_inquire_variable(variables(10), ioRead, "gvar_I64", ierr) - if (variables(10)%name /= 'gvar_I64') stop 'gvar_I64 name not recognized' - if (variables(10)%type /= adios2_type_integer8) stop 'gvar_I64 type not recognized' + if (variables(10)%name /= 'gvar_I64') then + write(*,*) 'gvar_I64 name not recognized' + stop 1 + end if + if (variables(10)%type /= adios2_type_integer8) then + write(*,*) 'gvar_I64 type not recognized' + stop 1 + end if call adios2_inquire_variable(variables(11), ioRead, "gvar_R32", ierr) - if (variables(11)%name /= 'gvar_R32') stop 'gvar_R32 name not recognized' - if (variables(11)%type /= adios2_type_real) stop 'gvar_I64 type not recognized' + if (variables(11)%name /= 'gvar_R32') then + write(*,*) 'gvar_R32 name not recognized' + stop 1 + end if + if (variables(11)%type /= adios2_type_real) then + write(*,*) 'gvar_I64 type not recognized' + stop 1 + end if call adios2_inquire_variable(variables(12), ioRead, "gvar_R64", ierr) - if (variables(12)%name /= 'gvar_R64') stop 'gvar_R64 name not recognized' - if (variables(12)%type /= adios2_type_dp) stop 'gvar_I64 type not recognized' + if (variables(12)%name /= 'gvar_R64') then + write(*,*) 'gvar_R64 name not recognized' + stop 1 + end if + if (variables(12)%type /= adios2_type_dp) then + write(*,*) 'gvar_I64 type not recognized' + stop 1 + end if end if call adios2_inquire_variable(variables(1), ioRead, "var_I8", ierr) - if (variables(1)%name /= 'var_I8') stop 'var_I8 not recognized' - if (variables(1)%type /= adios2_type_integer1) stop 'var_I8 type not recognized' + if (variables(1)%name /= 'var_I8') then + write(*,*) 'var_I8 not recognized' + stop 1 + end if + if (variables(1)%type /= adios2_type_integer1) then + write(*,*) 'var_I8 type not recognized' + stop 1 + end if call adios2_inquire_variable(variables(2), ioRead, "var_I16", ierr) - if (variables(2)%name /= 'var_I16') stop 'var_I16 not recognized' - if (variables(2)%type /= adios2_type_integer2) stop 'var_I16 type not recognized' + if (variables(2)%name /= 'var_I16') then + write(*,*) 'var_I16 not recognized' + stop 1 + end if + if (variables(2)%type /= adios2_type_integer2) then + write(*,*) 'var_I16 type not recognized' + stop 1 + end if call adios2_inquire_variable(variables(3), ioRead, "var_I32", ierr) - if (variables(3)%name /= 'var_I32') stop 'var_I32 not recognized' - if (variables(3)%type /= adios2_type_integer4) stop 'var_I32 type not recognized' + if (variables(3)%name /= 'var_I32') then + write(*,*) 'var_I32 not recognized' + stop 1 + end if + if (variables(3)%type /= adios2_type_integer4) then + write(*,*) 'var_I32 type not recognized' + stop 1 + end if call adios2_inquire_variable(variables(4), ioRead, "var_I64", ierr) - if (variables(4)%name /= 'var_I64') stop 'var_I64 not recognized' - if (variables(4)%type /= adios2_type_integer8) stop 'var_I64 type not recognized' + if (variables(4)%name /= 'var_I64') then + write(*,*) 'var_I64 not recognized' + stop 1 + end if + if (variables(4)%type /= adios2_type_integer8) then + write(*,*) 'var_I64 type not recognized' + stop 1 + end if call adios2_inquire_variable(variables(5), ioRead, "var_R32", ierr) - if (variables(5)%name /= 'var_R32') stop 'var_R32 not recognized' - if (variables(5)%type /= adios2_type_real) stop 'var_R32 type not recognized' + if (variables(5)%name /= 'var_R32') then + write(*,*) 'var_R32 not recognized' + stop 1 + end if + if (variables(5)%type /= adios2_type_real) then + write(*,*) 'var_R32 type not recognized' + stop 1 + end if call adios2_inquire_variable(variables(6), ioRead, "var_R64", ierr) - if (variables(6)%name /= 'var_R64') stop 'var_R64 not recognized' - if (variables(6)%type /= adios2_type_dp) stop 'var_R64 type not recognized' + if (variables(6)%name /= 'var_R64') then + write(*,*) 'var_R64 not recognized' + stop 1 + end if + if (variables(6)%type /= adios2_type_dp) then + write(*,*) 'var_R64 type not recognized' + stop 1 + end if call adios2_inquire_variable(variables(13), ioRead, "var_changingR64", ierr) - if (variables(13)%name /= 'var_changingR64') stop 'var_changingR64 not recognized' - if (variables(13)%type /= adios2_type_dp) stop 'var_R64 type not recognized' + if (variables(13)%name /= 'var_changingR64') then + write(*,*) 'var_changingR64 not recognized' + stop 1 + end if + if (variables(13)%type /= adios2_type_dp) then + write(*,*) 'var_R64 type not recognized' + stop 1 + end if do block_id = 0, isize - 1 @@ -262,15 +352,36 @@ program TestBPWriteTypes end do do i = 1, inx - if (I8(i) /= inI8(i)) stop 'Error reading var_I8' - if (I16(i) /= inI16(i)) stop 'Error reading var_I16' - if (I32(i) /= inI32(i)) stop 'Error reading var_I32' - if (I64(i) /= inI64(i)) stop 'Error reading var_I64' - if (R32(i) /= inR32(i)) stop 'Error reading var_R32' - if (R64(i) /= inR64(i)) stop 'Error reading var_R64' + if (I8(i) /= inI8(i)) then + write(*,*) 'Error reading var_I8' + stop 1 + end if + if (I16(i) /= inI16(i)) then + write(*,*) 'Error reading var_I16' + stop 1 + end if + if (I32(i) /= inI32(i)) then + write(*,*) 'Error reading var_I32' + stop 1 + end if + if (I64(i) /= inI64(i)) then + write(*,*) 'Error reading var_I64' + stop 1 + end if + if (R32(i) /= inR32(i)) then + write(*,*) 'Error reading var_R32' + stop 1 + end if + if (R64(i) /= inR64(i)) then + write(*,*) 'Error reading var_R64' + stop 1 + end if if( i < current_step) then - if (R64(i) /= inchangingR64(i)) stop 'Error reading var_changingR64' + if (R64(i) /= inchangingR64(i)) then + write(*,*) 'Error reading var_changingR64' + stop 1 + end if end if end do diff --git a/testing/adios2/bindings/fortran/TestBPWriteVariableAttributes.F90 b/testing/adios2/bindings/fortran/TestBPWriteVariableAttributes.F90 index 4c750e19bb..ae95a9aa96 100644 --- a/testing/adios2/bindings/fortran/TestBPWriteVariableAttributes.F90 +++ b/testing/adios2/bindings/fortran/TestBPWriteVariableAttributes.F90 @@ -34,13 +34,16 @@ program TestBPWriteVariableAttributes ! Failed with ci/circleci: suse-pgi-openmpi (exceptions trigger abort) ! call adios2_define_attribute(failed_att, ioWrite, 'att_String', & ! 'ADIOS2 String attribute', 'myVar2', '/', ierr) -! if(ierr == 0) stop 'myVar2 does not exist, should not create attribute att_String' +! if(ierr == 0) then 'myVar2 does not exist, should not create attribute att_String' ! if(failed_att%valid .eqv. .true.) then ! stop 'failed attribute must not exist ' ! end if do i=1,14 - if( attributes(i)%valid .eqv. .true. ) stop 'Invalid attribute default' + if( attributes(i)%valid .eqv. .true. ) then + write(*,*) 'Invalid attribute default' + stop 1 + end if end do ! single value @@ -89,7 +92,10 @@ program TestBPWriteVariableAttributes data_R64, 3, var%name, ierr) do i=1,14 - if( attributes(i)%valid .eqv. .false. ) stop 'Invalid adios2_define_attribute' + if( attributes(i)%valid .eqv. .false. ) then + write(*,*) 'Invalid adios2_define_attribute' + stop 1 + end if end do call adios2_open(bpWriter, ioWrite, "fvarattr_types.bp", adios2_mode_write, & diff --git a/testing/adios2/bindings/fortran/TestNullEngine.F90 b/testing/adios2/bindings/fortran/TestNullEngine.F90 index 668430ef34..f6e1a9f76b 100644 --- a/testing/adios2/bindings/fortran/TestNullEngine.F90 +++ b/testing/adios2/bindings/fortran/TestNullEngine.F90 @@ -39,7 +39,10 @@ program TestNullEngine ! Declare an IO process configuration inside adios call adios2_declare_io(ioWrite, adios, "nullWriter", ierr) call adios2_set_engine(ioWrite, "NULL", ierr) - if (TRIM(ioWrite%engine_type) /= "NULL") stop 'Wrong io engine_type' + if (TRIM(ioWrite%engine_type) /= "NULL") then + write(*,*) 'Wrong io engine_type' + stop 1 + end if ! Defines a variable to be written in bp format call adios2_define_variable(var, ioWrite, "var_R64", & @@ -70,11 +73,15 @@ program TestNullEngine call adios2_begin_step(nullReader, adios2_step_mode_read, -1.0, & step_status, ierr) if (step_status /= adios2_step_status_end_of_stream) then - stop 'null engine status failed' + write(*,*) 'null engine status failed' + stop 1 end if call adios2_inquire_variable(varIn, ioRead, "var_R64", ierr) - if (varIn%valid .eqv. .true.) stop 'var_R64 inquire error' + if (varIn%valid .eqv. .true.) then + write(*,*) 'var_R64 inquire error' + stop 1 + end if call adios2_get(nullReader, varIn, inR64, ierr) call adios2_perform_gets(nullReader, ierr) diff --git a/testing/adios2/bindings/fortran/TestRemove.F90 b/testing/adios2/bindings/fortran/TestRemove.F90 index adce243c74..ff909e7e15 100644 --- a/testing/adios2/bindings/fortran/TestRemove.F90 +++ b/testing/adios2/bindings/fortran/TestRemove.F90 @@ -97,67 +97,148 @@ program TestRemove call adios2_define_variable(variables(12), ioWrite, "gvar_R64", & adios2_type_dp, ierr) - if (variables(1)%valid .eqv. .false. ) stop 'var_I8 not defined' - if (variables(2)%valid .eqv. .false. ) stop 'var_I16 not defined' - if (variables(3)%valid .eqv. .false. ) stop 'var_I32 not defined' - if (variables(4)%valid .eqv. .false. ) stop 'var_I64 not defined' - if (variables(5)%valid .eqv. .false. ) stop 'var_R32 not defined' - if (variables(6)%valid .eqv. .false. ) stop 'var_R64 not defined' - if (variables(7)%valid .eqv. .false. ) stop 'gvar_I8 not defined' - if (variables(8)%valid .eqv. .false. ) stop 'gvar_I16 not defined' - if (variables(9)%valid .eqv. .false. ) stop 'gvar_I32 not defined' - if (variables(10)%valid .eqv. .false. ) stop 'gvar_I64 not defined' - if (variables(11)%valid .eqv. .false. ) stop 'gvar_R32 not defined' - if (variables(12)%valid .eqv. .false. ) stop 'gvar_IR64 not defined' + if (variables(1)%valid .eqv. .false. ) then + write(*,*) 'var_I8 not defined' + stop 1 + end if + if (variables(2)%valid .eqv. .false. ) then + write(*,*) 'var_I16 not defined' + stop 1 + end if + if (variables(3)%valid .eqv. .false. ) then + write(*,*) 'var_I32 not defined' + stop 1 + end if + if (variables(4)%valid .eqv. .false. ) then + write(*,*) 'var_I64 not defined' + stop 1 + end if + if (variables(5)%valid .eqv. .false. ) then + write(*,*) 'var_R32 not defined' + stop 1 + end if + if (variables(6)%valid .eqv. .false. ) then + write(*,*) 'var_R64 not defined' + stop 1 + end if + if (variables(7)%valid .eqv. .false. ) then + write(*,*) 'gvar_I8 not defined' + stop 1 + end if + if (variables(8)%valid .eqv. .false. ) then + write(*,*) 'gvar_I16 not defined' + stop 1 + end if + if (variables(9)%valid .eqv. .false. ) then + write(*,*) 'gvar_I32 not defined' + stop 1 + end if + if (variables(10)%valid .eqv. .false. ) then + write(*,*) 'gvar_I64 not defined' + stop 1 + end if + if (variables(11)%valid .eqv. .false. ) then + write(*,*) 'gvar_R32 not defined' + stop 1 + end if + if (variables(12)%valid .eqv. .false. ) then + write(*,*) 'gvar_IR64 not defined' + stop 1 + end if ! remove piece call adios2_remove_variable(res, ioWrite, "gvar_R64", ierr) - if( res .eqv. .false. ) stop 'adios2_remove_variable failed' + if( res .eqv. .false. ) then + write(*,*) 'adios2_remove_variable failed' + stop 1 + end if call adios2_inquire_variable(variables(12), ioWrite, "gvar_R64", ierr) - if (variables(12)%valid .eqv. .true. ) stop 'gvar_R64 found with inquire, not removed' + if (variables(12)%valid .eqv. .true. ) then + write(*,*) 'gvar_R64 found with inquire, not removed' + stop 1 + end if ! remove all call adios2_remove_all_variables(ioWrite, ierr) call adios2_inquire_variable(variables(1), ioWrite, "var_I8", ierr) - if (variables(1)%valid .eqv. .true. ) stop 'var_I8 found' + if (variables(1)%valid .eqv. .true. ) then + write(*,*) 'var_I8 found' + stop 1 + end if call adios2_inquire_variable(variables(2), ioWrite, "var_I16", ierr) - if (variables(2)%valid .eqv. .true.) stop 'var_I16 found' + if (variables(2)%valid .eqv. .true.) then + write(*,*) 'var_I16 found' + stop 1 + end if call adios2_inquire_variable(variables(3), ioWrite, "var_I32", ierr) - if (variables(3)%valid .eqv. .true.) stop 'var_I32 found' + if (variables(3)%valid .eqv. .true.) then + write(*,*) 'var_I32 found' + stop 1 + end if call adios2_inquire_variable(variables(4), ioWrite, "var_I64", ierr) - if (variables(4)%valid .eqv. .true.) stop 'var_I64 found' + if (variables(4)%valid .eqv. .true.) then + write(*,*) 'var_I64 found' + stop 1 + end if call adios2_inquire_variable(variables(5), ioWrite, "var_R32", ierr) - if (variables(5)%valid .eqv. .true.) stop 'var_R32 found' + if (variables(5)%valid .eqv. .true.) then + write(*,*) 'var_R32 found' + stop 1 + end if call adios2_inquire_variable(variables(6), ioWrite, "var_R64", ierr) - if (variables(6)%valid .eqv. .true.) stop 'var_R64 found' + if (variables(6)%valid .eqv. .true.) then + write(*,*) 'var_R64 found' + stop 1 + end if call adios2_inquire_variable(variables(7), ioWrite, "gvar_I8", ierr) - if (variables(7)%valid .eqv. .true.) stop 'gvar_I8 found' + if (variables(7)%valid .eqv. .true.) then + write(*,*) 'gvar_I8 found' + stop 1 + end if call adios2_inquire_variable(variables(8), ioWrite, "gvar_I16", ierr) - if (variables(8)%valid .eqv. .true.) stop 'gvar_I16 found' + if (variables(8)%valid .eqv. .true.) then + write(*,*) 'gvar_I16 found' + stop 1 + end if call adios2_inquire_variable(variables(9), ioWrite, "gvar_I32", ierr) - if (variables(9)%valid .eqv. .true.) stop 'gvar_I32 found' + if (variables(9)%valid .eqv. .true.) then + write(*,*) 'gvar_I32 found' + stop 1 + end if call adios2_inquire_variable(variables(10), ioWrite, "gvar_I64", ierr) - if (variables(10)%valid .eqv. .true.) stop 'gvar_I64 found' + if (variables(10)%valid .eqv. .true.) then + write(*,*) 'gvar_I64 found' + stop 1 + end if call adios2_inquire_variable(variables(11), ioWrite, "gvar_R32", ierr) - if (variables(11)%valid .eqv. .true.) stop 'gvar_R32 found' + if (variables(11)%valid .eqv. .true.) then + write(*,*) 'gvar_R32 found' + stop 1 + end if call adios2_remove_io(res, adios, 'ioWrite', ierr) - if( res .neqv. .true. ) stop 'could not remove ioWrite' + if( res .neqv. .true. ) then + write(*,*) 'could not remove ioWrite' + stop 1 + end if call adios2_at_io(ioWrite, adios, 'ioWrite', ierr) - if( ioWrite%valid .eqv. .true. ) stop 'did not remove ioWrite correctly' + if( ioWrite%valid .eqv. .true. ) then + write(*,*) 'did not remove ioWrite correctly' + stop 1 + end if call adios2_finalize(adios, ierr) diff --git a/testing/adios2/bindings/fortran/operation/TestBPWriteReadSZ2D.F90 b/testing/adios2/bindings/fortran/operation/TestBPWriteReadSZ2D.F90 index 685b6ba2c3..ccaf30a890 100644 --- a/testing/adios2/bindings/fortran/operation/TestBPWriteReadSZ2D.F90 +++ b/testing/adios2/bindings/fortran/operation/TestBPWriteReadSZ2D.F90 @@ -96,7 +96,10 @@ program TestBPWriteReadHeatMapSZ2D call adios2_add_operation(operation_id, var_temperatures(5), & sz_operator, 'accuracy', '0.01', ierr) - if( operation_id /= 0 ) stop 'operation_id not added for real type' + if( operation_id /= 0 ) then + write(*,*) 'operation_id not added for real type' + stop 1 + end if call adios2_define_variable(var_temperatures(6), ioPut, & @@ -106,7 +109,10 @@ program TestBPWriteReadHeatMapSZ2D call adios2_add_operation(operation_id, var_temperatures(6), & sz_operator, '', '', ierr) - if( operation_id /= 0 ) stop 'operation_id not added for dp type' + if( operation_id /= 0 ) then + write(*,*) 'operation_id not added for dp type' + stop 1 + end if call adios2_set_operation_parameter( var_temperatures(6), operation_id, & 'accuracy', '0.01', ierr) @@ -205,12 +211,30 @@ program TestBPWriteReadHeatMapSZ2D end do end do - if (sum_i1 /= 100*isize) stop 'Test failed integer*1' - if (sum_i2 /= 100*isize) stop 'Test failed integer*2' - if (sum(sel_temperatures_i4) /= 100*isize) stop 'Test failed integer*4' - if (sum(sel_temperatures_i8) /= 100*isize) stop 'Test failed integer*8' - if (sum(sel_temperatures_r4) /= 100*isize) stop 'Test failed real*4' - if (sum(sel_temperatures_r8) /= 100*isize) stop 'Test failed real*8' + if (sum_i1 /= 100*isize) then + write(*,*) 'Test failed integer*1' + stop 1 + end if + if (sum_i2 /= 100*isize) then + write(*,*) 'Test failed integer*2' + stop 1 + end if + if (sum(sel_temperatures_i4) /= 100*isize) then + write(*,*) 'Test failed integer*4' + stop 1 + end if + if (sum(sel_temperatures_i8) /= 100*isize) then + write(*,*) 'Test failed integer*8' + stop 1 + end if + if (sum(sel_temperatures_r4) /= 100*isize) then + write(*,*) 'Test failed real*4' + stop 1 + end if + if (sum(sel_temperatures_r8) /= 100*isize) then + write(*,*) 'Test failed real*8' + stop 1 + end if if (allocated(sel_temperatures_i1)) deallocate (sel_temperatures_i1) if (allocated(sel_temperatures_i2)) deallocate (sel_temperatures_i2) diff --git a/testing/adios2/bindings/fortran/operation/TestBPWriteReadSZ3D.F90 b/testing/adios2/bindings/fortran/operation/TestBPWriteReadSZ3D.F90 index 9838122aa7..f7ad41ac96 100644 --- a/testing/adios2/bindings/fortran/operation/TestBPWriteReadSZ3D.F90 +++ b/testing/adios2/bindings/fortran/operation/TestBPWriteReadSZ3D.F90 @@ -96,7 +96,10 @@ program TestBPWriteReadHeatMapSZ3D call adios2_add_operation(operation_id, var_temperatures(5), & sz_operator, 'accuracy', '0.01', ierr) - if( operation_id /= 0 ) stop 'operation_id not added for real type' + if( operation_id /= 0 ) then + write(*,*) 'operation_id not added for real type' + stop 1 + end if call adios2_define_variable(var_temperatures(6), ioPut, & @@ -107,7 +110,10 @@ program TestBPWriteReadHeatMapSZ3D call adios2_add_operation(operation_id, var_temperatures(6), & sz_operator, 'accuracy', '0.01', ierr) - if( operation_id /= 0 ) stop 'operation_id not added for dp type' + if( operation_id /= 0 ) then + write(*,*) 'operation_id not added for dp type' + stop 1 + end if call adios2_open(bpWriter, ioPut, 'HeatMapSZ3D_f.bp', adios2_mode_write, & ierr) @@ -205,12 +211,30 @@ program TestBPWriteReadHeatMapSZ3D end do end do - if (sum_i1 /= 1000*isize) stop 'Test failed integer*1' - if (sum_i2 /= 1000*isize) stop 'Test failed integer*2' - if (sum(sel_temperatures_i4) /= 1000*isize) stop 'Test failed integer*4' - if (sum(sel_temperatures_i8) /= 1000*isize) stop 'Test failed integer*8' - if (sum(sel_temperatures_r4) /= 1000*isize) stop 'Test failed real*4' - if (sum(sel_temperatures_r8) /= 1000*isize) stop 'Test failed real*8' + if (sum_i1 /= 1000*isize) then + write(*,*) 'Test failed integer*1' + stop 1 + end if + if (sum_i2 /= 1000*isize) then + write(*,*) 'Test failed integer*2' + stop 1 + end if + if (sum(sel_temperatures_i4) /= 1000*isize) then + write(*,*) 'Test failed integer*4' + stop 1 + end if + if (sum(sel_temperatures_i8) /= 1000*isize) then + write(*,*) 'Test failed integer*8' + stop 1 + end if + if (sum(sel_temperatures_r4) /= 1000*isize) then + write(*,*) 'Test failed real*4' + stop 1 + end if + if (sum(sel_temperatures_r8) /= 1000*isize) then + write(*,*) 'Test failed real*8' + stop 1 + end if if (allocated(sel_temperatures_i1)) deallocate (sel_temperatures_i1) if (allocated(sel_temperatures_i2)) deallocate (sel_temperatures_i2) diff --git a/testing/adios2/bindings/fortran/operation/TestBPWriteReadZfp2D.F90 b/testing/adios2/bindings/fortran/operation/TestBPWriteReadZfp2D.F90 index d564e1e307..38801f439d 100644 --- a/testing/adios2/bindings/fortran/operation/TestBPWriteReadZfp2D.F90 +++ b/testing/adios2/bindings/fortran/operation/TestBPWriteReadZfp2D.F90 @@ -96,7 +96,10 @@ program TestBPWriteReadHeatMapZfp2D call adios2_add_operation(operation_id, var_temperatures(5), & zfp_operator, 'rate', '8', ierr) - if( operation_id /= 0 ) stop 'operation_id not added for real type' + if( operation_id /= 0 ) then + write(*,*) 'operation_id not added for real type' + stop 1 + end if call adios2_define_variable(var_temperatures(6), ioPut, & @@ -107,7 +110,10 @@ program TestBPWriteReadHeatMapZfp2D call adios2_add_operation(operation_id, var_temperatures(6), & zfp_operator, 'rate', '8', ierr) - if( operation_id /= 0 ) stop 'operation_id not added for dp type' + if( operation_id /= 0 ) then + write(*,*) 'operation_id not added for dp type' + stop 1 + end if call adios2_open(bpWriter, ioPut, 'HeatMapZfp2D_f.bp', adios2_mode_write, & @@ -204,12 +210,30 @@ program TestBPWriteReadHeatMapZfp2D end do end do - if (sum_i1 /= 100*isize) stop 'Test failed integer*1' - if (sum_i2 /= 100*isize) stop 'Test failed integer*2' - if (sum(sel_temperatures_i4) /= 100*isize) stop 'Test failed integer*4' - if (sum(sel_temperatures_i8) /= 100*isize) stop 'Test failed integer*8' - if (sum(sel_temperatures_r4) /= 100*isize) stop 'Test failed real*4' - if (sum(sel_temperatures_r8) /= 100*isize) stop 'Test failed real*8' + if (sum_i1 /= 100*isize) then + write(*,*) 'Test failed integer*1' + stop 1 + end if + if (sum_i2 /= 100*isize) then + write(*,*) 'Test failed integer*2' + stop 1 + end if + if (sum(sel_temperatures_i4) /= 100*isize) then + write(*,*) 'Test failed integer*4' + stop 1 + end if + if (sum(sel_temperatures_i8) /= 100*isize) then + write(*,*) 'Test failed integer*8' + stop 1 + end if + if (sum(sel_temperatures_r4) /= 100*isize) then + write(*,*) 'Test failed real*4' + stop 1 + end if + if (sum(sel_temperatures_r8) /= 100*isize) then + write(*,*) 'Test failed real*8' + stop 1 + end if if (allocated(sel_temperatures_i1)) deallocate (sel_temperatures_i1) if (allocated(sel_temperatures_i2)) deallocate (sel_temperatures_i2) diff --git a/testing/adios2/bindings/fortran/operation/TestBPWriteReadZfp2DRemove.F90 b/testing/adios2/bindings/fortran/operation/TestBPWriteReadZfp2DRemove.F90 index 70d962dde3..9d624c986c 100644 --- a/testing/adios2/bindings/fortran/operation/TestBPWriteReadZfp2DRemove.F90 +++ b/testing/adios2/bindings/fortran/operation/TestBPWriteReadZfp2DRemove.F90 @@ -67,11 +67,17 @@ program TestBPWriteReadHeatMapZfp2DRemove if( mod(i,2) == 0 ) then call adios2_add_operation(operation_id, var_temperatures(1), & zfp_operator, 'rate', '8', ierr) - if( operation_id /= 0 ) stop 'operation_id not added for real type' + if( operation_id /= 0 ) then + write(*,*) 'operation_id not added for real type' + stop 1 + end if call adios2_add_operation(operation_id, var_temperatures(2), & zfp_operator, 'rate', '8', ierr) - if( operation_id /= 0 ) stop 'operation_id not added for dp type' + if( operation_id /= 0 ) then + write(*,*) 'operation_id not added for dp type' + stop 1 + end if else call adios2_remove_operations(var_temperatures(1), ierr) @@ -125,8 +131,14 @@ program TestBPWriteReadHeatMapZfp2DRemove call adios2_get(bpReader, var_temperaturesIn(2), sel_temperatures_r8, ierr) call adios2_end_step(bpReader, ierr) - if (sum(sel_temperatures_r4) /= 100*isize) stop 'Test failed real*4' - if (sum(sel_temperatures_r8) /= 100*isize) stop 'Test failed real*8' + if (sum(sel_temperatures_r4) /= 100*isize) then + write(*,*) 'Test failed real*4' + stop 1 + end if + if (sum(sel_temperatures_r8) /= 100*isize) then + write(*,*) 'Test failed real*8' + stop 1 + end if end do diff --git a/testing/adios2/engine/bp/TestBPFortranToCppWriter.F90 b/testing/adios2/engine/bp/TestBPFortranToCppWriter.F90 index 68debc2b3b..2fc0a46e9c 100644 --- a/testing/adios2/engine/bp/TestBPFortranToCppWriter.F90 +++ b/testing/adios2/engine/bp/TestBPFortranToCppWriter.F90 @@ -83,7 +83,10 @@ end function iargc call adios2_begin_step(bpWriter, ierr) call adios2_current_step(current_step, bpWriter, ierr) - if (current_step /= s - 1) stop 'wrong current step' + if (current_step /= s - 1) then + write(*,*) 'wrong current step' + stop 1 + end if if (irank == 0 .and. s == 1) then call adios2_put(bpWriter, vGlobalValue, inx, ierr) diff --git a/testing/adios2/engine/staging-common/TestCommonReadF.F90 b/testing/adios2/engine/staging-common/TestCommonReadF.F90 index 2e30795a44..7aeeaad16e 100644 --- a/testing/adios2/engine/staging-common/TestCommonReadF.F90 +++ b/testing/adios2/engine/staging-common/TestCommonReadF.F90 @@ -113,91 +113,223 @@ program TestSstRead call adios2_inquire_variable(variables(1), ioRead, "i8", ierr) - if (variables(1)%name /= 'i8') stop 'i8 not recognized' - if (variables(1)%type /= adios2_type_integer1) stop 'i8 type not recognized' + if (variables(1)%name /= 'i8') then + write(*,*) 'i8 not recognized' + stop 1 + end if + if (variables(1)%type /= adios2_type_integer1) then + write(*,*) 'i8 type not recognized' + stop 1 + end if call adios2_variable_shape(shape_in, ndims, variables(1), ierr) - if (ndims /= 1) stop 'i8 ndims is not 1' - if (modulo(shape_in(1), int(nx, 8)) /= 0) stop 'i8 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'i8 ndims is not 1' + stop 1 + end if + if (modulo(shape_in(1), int(nx, 8)) /= 0) then + write(*,*) 'i8 shape_in read failed' + stop 1 + end if writerSize = INT(shape_in(1)) / nx deallocate(shape_in) call adios2_inquire_variable(variables(2), ioRead, "i16", ierr) - if (variables(2)%name /= 'i16') stop 'i16 not recognized' - if (variables(2)%type /= adios2_type_integer2) stop 'i16 type not recognized' + if (variables(2)%name /= 'i16') then + write(*,*) 'i16 not recognized' + stop 1 + end if + if (variables(2)%type /= adios2_type_integer2) then + write(*,*) 'i16 type not recognized' + stop 1 + end if call adios2_variable_shape( shape_in, ndims, variables(2), ierr) - if (ndims /= 1) stop 'i16 ndims is not 1' - if (shape_in(1) /= nx*writerSize) stop 'i16 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'i16 ndims is not 1' + stop 1 + end if + if (shape_in(1) /= nx*writerSize) then + write(*,*) 'i16 shape_in read failed' + stop 1 + end if deallocate(shape_in) call adios2_inquire_variable(variables(3), ioRead, "i32", ierr) - if (variables(3)%name /= 'i32') stop 'i32 not recognized' - if (variables(3)%type /= adios2_type_integer4) stop 'i32 type not recognized' + if (variables(3)%name /= 'i32') then + write(*,*) 'i32 not recognized' + stop 1 + end if + if (variables(3)%type /= adios2_type_integer4) then + write(*,*) 'i32 type not recognized' + stop 1 + end if call adios2_variable_shape(shape_in, ndims, variables(3), ierr) - if (ndims /= 1) stop 'i32 ndims is not 1' - if (shape_in(1) /= nx*writerSize) stop 'i32 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'i32 ndims is not 1' + stop 1 + end if + if (shape_in(1) /= nx*writerSize) then + write(*,*) 'i32 shape_in read failed' + stop 1 + end if deallocate(shape_in) call adios2_inquire_variable(variables(4), ioRead, "i64", ierr) - if (variables(4)%name /= 'i64') stop 'i64 not recognized' - if (variables(4)%type /= adios2_type_integer8) stop 'i64 type not recognized' + if (variables(4)%name /= 'i64') then + write(*,*) 'i64 not recognized' + stop 1 + end if + if (variables(4)%type /= adios2_type_integer8) then + write(*,*) 'i64 type not recognized' + stop 1 + end if call adios2_variable_shape(shape_in, ndims, variables(4), ierr) - if (ndims /= 1) stop 'i64 ndims is not 1' - if (shape_in(1) /= nx*writerSize) stop 'i64 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'i64 ndims is not 1' + stop 1 + end if + if (shape_in(1) /= nx*writerSize) then + write(*,*) 'i64 shape_in read failed' + stop 1 + end if deallocate(shape_in) call adios2_inquire_variable(variables(5), ioRead, "r32", ierr) - if (variables(5)%name /= 'r32') stop 'r32 not recognized' - if (variables(5)%type /= adios2_type_real) stop 'r32 type not recognized' + if (variables(5)%name /= 'r32') then + write(*,*) 'r32 not recognized' + stop 1 + end if + if (variables(5)%type /= adios2_type_real) then + write(*,*) 'r32 type not recognized' + stop 1 + end if call adios2_variable_shape(shape_in, ndims, variables(5), ierr) - if (ndims /= 1) stop 'r32 ndims is not 1' - if (shape_in(1) /= nx*writerSize) stop 'r32 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'r32 ndims is not 1' + stop 1 + end if + if (shape_in(1) /= nx*writerSize) then + write(*,*) 'r32 shape_in read failed' + stop 1 + end if deallocate(shape_in) call adios2_inquire_variable(variables(6), ioRead, "r64", ierr) - if (variables(6)%name /= 'r64') stop 'r64 not recognized' - if (variables(6)%type /= adios2_type_dp) stop 'r64 type not recognized' + if (variables(6)%name /= 'r64') then + write(*,*) 'r64 not recognized' + stop 1 + end if + if (variables(6)%type /= adios2_type_dp) then + write(*,*) 'r64 type not recognized' + stop 1 + end if call adios2_variable_shape(shape_in, ndims, variables(6), ierr) - if (ndims /= 1) stop 'r64 ndims is not 1' - if (shape_in(1) /= nx*writerSize) stop 'r64 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'r64 ndims is not 1' + stop 1 + end if + if (shape_in(1) /= nx*writerSize) then + write(*,*) 'r64 shape_in read failed' + stop 1 + end if deallocate(shape_in) call adios2_inquire_variable(variables(7), ioRead, "r64_2d", ierr) - if (variables(7)%name /= 'r64_2d') stop 'r64_2d not recognized' - if (variables(7)%type /= adios2_type_dp) stop 'r64_2d type not recognized' + if (variables(7)%name /= 'r64_2d') then + write(*,*) 'r64_2d not recognized' + stop 1 + end if + if (variables(7)%type /= adios2_type_dp) then + write(*,*) 'r64_2d type not recognized' + stop 1 + end if call adios2_variable_shape( shape_in, ndims, variables(7), ierr) - if (ndims /= 2) stop 'r64_2d ndims is not 2' - if (shape_in(1) /= 2) stop 'r64_2d shape_in(1) read failed' - if (shape_in(2) /= nx*writerSize) stop 'r64_2d shape_in(2) read failed' + if (ndims /= 2) then + write(*,*) 'r64_2d ndims is not 2' + stop 1 + end if + if (shape_in(1) /= 2) then + write(*,*) 'r64_2d shape_in(1) read failed' + stop 1 + end if + if (shape_in(2) /= nx*writerSize) then + write(*,*) 'r64_2d shape_in(2) read failed' + stop 1 + end if deallocate(shape_in) call adios2_inquire_variable(variables(8), ioRead, "r64_2d_rev", ierr) - if (variables(8)%name /= 'r64_2d_rev') stop 'r64_2d_rev not recognized' - if (variables(8)%type /= adios2_type_dp) stop 'r64_2d_rev type not recognized' + if (variables(8)%name /= 'r64_2d_rev') then + write(*,*) 'r64_2d_rev not recognized' + stop 1 + end if + if (variables(8)%type /= adios2_type_dp) then + write(*,*) 'r64_2d_rev type not recognized' + stop 1 + end if call adios2_variable_shape(shape_in, ndims, variables(8), ierr) - if (ndims /= 2) stop 'r64_2d_rev ndims is not 2' - if (shape_in(1) /= nx*writerSize) stop 'r64_2d_rev shape_in(2) read failed' - if (shape_in(2) /= 2) stop 'r64_2d_rev shape_in(1) read failed' + if (ndims /= 2) then + write(*,*) 'r64_2d_rev ndims is not 2' + stop 1 + end if + if (shape_in(1) /= nx*writerSize) then + write(*,*) 'r64_2d_rev shape_in(2) read failed' + stop 1 + end if + if (shape_in(2) /= 2) then + write(*,*) 'r64_2d_rev shape_in(1) read failed' + stop 1 + end if deallocate(shape_in) call adios2_inquire_variable(variables(10), ioRead, "c32", ierr) - if (variables(10)%name /= 'c32') stop 'c32 not recognized' - if (variables(10)%type /= adios2_type_complex) stop 'c32 type not recognized' + if (variables(10)%name /= 'c32') then + write(*,*) 'c32 not recognized' + stop 1 + end if + if (variables(10)%type /= adios2_type_complex) then + write(*,*) 'c32 type not recognized' + stop 1 + end if call adios2_variable_shape(shape_in, ndims, variables(10), ierr) - if (ndims /= 1) stop 'c32 ndims is not 1' - if (shape_in(1) /= nx*writerSize) stop 'c32 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'c32 ndims is not 1' + stop 1 + end if + if (shape_in(1) /= nx*writerSize) then + write(*,*) 'c32 shape_in read failed' + stop 1 + end if deallocate(shape_in) call adios2_inquire_variable(variables(11), ioRead, "c64", ierr) - if (variables(11)%name /= 'c64') stop 'c64 not recognized' - if (variables(11)%type /= adios2_type_complex_dp) stop 'c64 type not recognized' + if (variables(11)%name /= 'c64') then + write(*,*) 'c64 not recognized' + stop 1 + end if + if (variables(11)%type /= adios2_type_complex_dp) then + write(*,*) 'c64 type not recognized' + stop 1 + end if call adios2_variable_shape(shape_in, ndims, variables(11), ierr) - if (ndims /= 1) stop 'c64 ndims is not 1' - if (shape_in(1) /= nx*writerSize) stop 'c64 shape_in read failed' + if (ndims /= 1) then + write(*,*) 'c64 ndims is not 1' + stop 1 + end if + if (shape_in(1) /= nx*writerSize) then + write(*,*) 'c64 shape_in read failed' + stop 1 + end if deallocate(shape_in) call adios2_inquire_variable(variables(12), ioRead, "scalar_r64", ierr) - if (variables(12)%name /= 'scalar_r64') stop 'scalar_r64 not recognized' - if (variables(12)%type /= adios2_type_dp) stop 'scalar_r64 type not recognized' + if (variables(12)%name /= 'scalar_r64') then + write(*,*) 'scalar_r64 not recognized' + stop 1 + end if + if (variables(12)%type /= adios2_type_dp) then + write(*,*) 'scalar_r64 type not recognized' + stop 1 + end if myStart = (writerSize * Nx / isize) * irank myLength = ((writerSize * Nx + isize - 1) / isize) @@ -274,7 +406,10 @@ program TestSstRead ! Deallocates adios and calls its destructor call adios2_finalize(adios, ierr) - if( adios%valid .eqv. .true. ) stop 'Invalid adios2_finalize' + if( adios%valid .eqv. .true. ) then + write(*,*) 'Invalid adios2_finalize' + stop 1 + end if #if ADIOS2_USE_MPI