Skip to content

Commit a7e1e99

Browse files
committed
Updates to heat2d after ADIOS API changes
1 parent 816877e commit a7e1e99

File tree

5 files changed

+28
-29
lines changed

5 files changed

+28
-29
lines changed

Tutorial/heat2d/cpp/visualization/heatVisualization.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,19 @@ int main(int argc, char *argv[])
105105

106106
if (firstStep)
107107
{
108+
size_t gndx = vTin.Shape()[0];
109+
size_t gndy = vTin.Shape()[1];
110+
108111
if (rank == 0)
109112
{
110113
std::cout << "gndx = " << vTin.Shape()[0]
111114
<< std::endl;
112115
std::cout << "gndy = " << vTin.Shape()[1]
113116
<< std::endl;
114117
}
115-
Tin.resize(std::accumulate(vTin.Count().begin(), vTin.Count().end(), vTin.Sizeof(), std::multiplies<size_t>()));
118+
//Tin.resize(std::accumulate(vTin.Count().begin(), vTin.Count().end(), vTin.Sizeof(), std::multiplies<size_t>()));
119+
Tin.resize(gndx*gndy);
120+
std::cout << "size = " << Tin.size() << std::endl;
116121
}
117122

118123
// Create a 2D selection for the subset

Tutorial/heat2d/fortran/adios2.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
<?xml version="1.0"?>
22
<adios-config>
33

4-
<!--===========================================
5-
Configuration for the Simulation Output
6-
==========================================-->
7-
8-
<io name="SimulationOutput">
9-
<engine type="BPFile">
10-
</engine>
11-
</io>
12-
134
<!-- example engines
145
156
<engine type="BPFile">
@@ -34,6 +25,15 @@
3425
3526
-->
3627

28+
<!--===========================================
29+
Configuration for the Simulation Output
30+
==========================================-->
31+
32+
<io name="SimulationOutput">
33+
<engine type="BPFile">
34+
</engine>
35+
</io>
36+
3737
<!--
3838
The following groups are only used by the C++ examples
3939
-->
@@ -56,7 +56,7 @@
5656
=============================================-->
5757

5858
<io name="VizInput">
59-
<engine type="bpfile">
59+
<engine type="BPFile">
6060
</engine>
6161
</io>
6262

Tutorial/heat2d/fortran/analysis/heatAnalysis_adios2_file.F90

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,13 @@ program reader
4545

4646
call adios2_init (adios2obj, "adios2.xml", app_comm, adios2_debug_mode_on, ierr)
4747
call adios2_declare_io (io, adios2obj, 'SimulationOutput', ierr )
48+
call adios2_open(fh, io, filename, adios2_mode_read, app_comm, ierr)
49+
4850
! For information purposes only:
49-
call adios2_io_engine_type(io, engine_type, ierr)
5051
if (rank == 0) then
51-
print '(" Using ",a, " engine for input")', engine_type
52+
print '(" Using ",a, " engine for input")', trim(fh%type)
5253
endif
5354

54-
call adios2_open(fh, io, filename, adios2_mode_read, app_comm, ierr)
55-
5655
! We can inquire the dimensions, type and number of steps
5756
! of a variable directly from the metadata
5857
call adios2_inquire_variable(var_T, io, "T", ierr)
@@ -74,8 +73,8 @@ program reader
7473
allocate( T(readsize(1), readsize(2)) )
7574

7675
!TODO: Get the number of available steps
77-
call adios2_variable_available_steps_start(var_T, steps_start, ierr)
78-
call adios2_variable_available_steps_count(var_T, steps_count, ierr)
76+
call adios2_variable_steps_start(var_T, steps_start, ierr)
77+
call adios2_variable_steps(var_T, steps_count, ierr)
7978
ts = steps_start+steps_count-1 ! Let's read the last timestep
8079
if (rank == 0) then
8180
print '(" First available step = ", i0)', steps_start

Tutorial/heat2d/fortran/analysis/heatAnalysis_adios2_stream.F90

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ program reader
2020
type (adios2_io) :: io ! IO group handle
2121
type (adios2_engine) :: fh ! File handle
2222
type (adios2_variable) :: var_T ! variable objects
23-
character(:), allocatable :: engine_type ! some info
2423
! Variable information
2524
integer :: vartype, nsteps, ndim
2625
integer*8, dimension(:), allocatable :: dims
@@ -45,14 +44,13 @@ program reader
4544

4645
call adios2_init (adios2obj, "adios2.xml", app_comm, adios2_debug_mode_on, ierr)
4746
call adios2_declare_io (io, adios2obj, 'SimulationOutput', ierr )
47+
call adios2_open(fh, io, streamname, adios2_mode_read, app_comm, ierr)
48+
4849
! For information purposes only:
49-
call adios2_io_engine_type(io, engine_type, ierr)
5050
if (rank == 0) then
51-
print '(" Using ",a, " engine for input")', engine_type
51+
print '(" Using ",a, " engine for input")', trim(fh%type)
5252
endif
5353

54-
call adios2_open(fh, io, streamname, adios2_mode_read, app_comm, ierr)
55-
5654
if (ierr .ne. 0) then
5755
print '(" Failed to open stream: ",a)', streamname
5856
print '(" open stream ierr=: ",i0)', ierr

Tutorial/heat2d/fortran/simulation/io_adios2.F90

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,10 @@ subroutine io_init()
2222
use heat_vars
2323
use adios2
2424
implicit none
25-
character(:), allocatable :: engine_type
2625

2726
call adios2_init (adios, "adios2.xml", app_comm, adios2_debug_mode_on, ierr)
2827
call adios2_declare_io (io, adios, 'SimulationOutput', ierr )
2928

30-
! For information purposes only:
31-
call adios2_io_engine_type(io, engine_type, ierr)
32-
if (rank == 0) then
33-
print '("Using ",a, " engine for output")', engine_type
34-
endif
35-
3629
end subroutine io_init
3730

3831
subroutine io_finalize()
@@ -67,6 +60,10 @@ subroutine io_write(tstep,curr)
6760
if (tstep.eq.0) then
6861

6962
call adios2_open (bp_writer, io, filename, adios2_mode_write, adios2_err)
63+
! For information purposes only:
64+
if (rank == 0) then
65+
print '("Using ",a, " engine for output")', bp_writer%type
66+
endif
7067

7168
! Define T and dT array dimensions
7269
shape_dims(1) = gndx

0 commit comments

Comments
 (0)