Skip to content

Commit ce138b0

Browse files
I/O adapted fully to use ADIOS2
1 parent 0a2a7bd commit ce138b0

File tree

6 files changed

+653
-375
lines changed

6 files changed

+653
-375
lines changed

Tutorial/brusselator/Makefile

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@ CPP=-cpp
77
# All settings here for use Muite Laptop
88

99
COMPILER = mpif90
10-
decompdir= ./2decomp_fft
10+
decompdir=./2decomp_fft
1111
FFTW_LINK=./fftwinstall
12+
FFTW_DIR?=
13+
ADIOS2_DIR?=
1214
# compilation settings, optimization, precision, parallelization
13-
FLAGS = -O3
14-
LIBS = -I${FFTW_LINK}/include -L${FFTW_LINK}/lib -lfftw3
15+
FLAGS = -O3 -DADIOS2
1516

16-
DECOMPLIB = -I${decompdir}/include -L${decompdir}/lib -l2decomp_fft
17+
INCLUDES = -I${FFTW_DIR}/include -I${decompdir}/include -I${ADIOS2_DIR}/include/fortran
1718

19+
FFTW_LIB = -L${FFTW_DIR}/lib -lfftw3
20+
DECOMPLIB = -L${decompdir}/lib -l2decomp_fft
21+
ADIOS2_LIB =-L${ADIOS2_DIR}/lib -ladios2_f -ladios2 -ladios2_sst -ladios2_evpath -ladios2_ffs -ladios2_dill -ladios2_atl
22+
LIBS = ${FFTW_LIB} ${DECOMPLIB} ${ADIOS2_LIB}
1823

1924
# libraries
2025
# source list for main program
@@ -27,12 +32,32 @@ OBJECTS = brusselator.o initialdata.o savedata.o getgrid.o \
2732

2833

2934
Brusselator: $(OBJECTS)
30-
${COMPILER} -o Brusselator $(OPTIONS) $(FLAGS) $(CPP) $(OBJECTS) $(DECOMPLIB) $(LIBS)
35+
${COMPILER} -o Brusselator $(FLAGS) $(FLAGS) $(CPP) $(OBJECTS) $(LIBS)
36+
37+
brusselator.o : brusselator.f90 savedata.o
38+
${COMPILER} -c $(FLAGS) $(CPP) $(INCLUDES) brusselator.f90
39+
40+
savedata.o : savedata.f90
41+
${COMPILER} -c $(FLAGS) $(CPP) $(INCLUDES) savedata.f90
42+
43+
initialdata.o : initialdata.f90
44+
${COMPILER} -c $(FLAGS) $(CPP) $(INCLUDES) initialdata.f90
45+
46+
getgrid.o : savedata.o getgrid.f90
47+
${COMPILER} -c $(FLAGS) $(CPP) $(INCLUDES) getgrid.f90
48+
49+
linear.o : linear.f90
50+
${COMPILER} -c $(FLAGS) $(CPP) $(INCLUDES) linear.f90
51+
52+
nonlinear1.o : nonlinear1.f90
53+
${COMPILER} -c $(FLAGS) $(CPP) $(INCLUDES) nonlinear1.f90
54+
55+
nonlinear2.o : nonlinear2.f90
56+
${COMPILER} -c $(FLAGS) $(CPP) $(INCLUDES) nonlinear2.f90
3157

32-
$(OBJECTS): $(SOURCES)
33-
${COMPILER} -c $(OPTIONS) $(CPP) $(DECOMPLIB) $(LIBS) $(SOURCES)
3458

3559
clean:
36-
rm -f *.o
60+
rm -f *.o *.mod
3761
clobber:
3862
rm -f Brusselator
63+

Tutorial/brusselator/README

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
The Brusselator source code has been forked from https://github.com/openmichigan/PSNM.
2-
32
Its dependency - 2decomp_fft, has been downloaded from http://www.2decomp.org. Current version is 1.5.847.
43

4+
Installation:
5+
6+
First install the 2decomp_fft library ./2decomp_fft.
7+
Then, edit the Makefile to set the compiler etc. and run make.
8+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0"?>
2+
<adios-config>
3+
4+
<!--====================================
5+
Configuration for the Writer
6+
====================================-->
7+
8+
<io name="writer">
9+
<engine type="BPFile">
10+
11+
<!-- for vectorized memory operations, make sure your system
12+
enables threads-->
13+
<parameter key="Threads" value="1"/>
14+
15+
<!-- Microseconds (default), Milliseconds, Seconds,
16+
Minutes, Hours -->
17+
<parameter key="ProfileUnits" value="Microseconds"/>
18+
19+
<!-- XXKb, XXMb, or XXXGb supported, default=16Kb
20+
(applications might choose an optimal value) -->
21+
<parameter key="InitialBufferSize" value="16Kb"/>
22+
23+
<!-- XXKb, XXMb, or XXXGb supported, default=Unlimited (until
24+
fails), maximum at each time step
25+
(applications might choose an optimal value) -->
26+
<!-- <parameter key="MaxBufferSize" value="2Gb"/> -->
27+
28+
<!-- exponential growth factor > 1, default = 1.05
29+
1.05 is good for a few large variables, for many small
30+
variables increase the value to 1.5 to 2
31+
(optimal value is application dependent)-->
32+
<!-- <parameter key="BufferGrowthFactor" value="1.05"/> -->
33+
34+
<!-- Indicates how often (in number of steps), pick a large
35+
number so metadata will only be written at Close
36+
(applications might choose an optimal value) -->
37+
<parameter key="FlushStepsCount" value="1"/>
38+
39+
</engine>
40+
41+
<transport type="File">
42+
43+
<!-- POSIX, stdio (C FILE*), fstream (C++) -->
44+
<parameter key="Library" value="POSIX"/>
45+
46+
<!-- For read/write, Microseconds (default), Milliseconds, Seconds,
47+
Minutes, Hours. open/close always in Microseconds -->
48+
<parameter key="ProfileUnits" value="Microseconds"/>
49+
50+
</transport>
51+
52+
</io>
53+
54+
</adios-config>
55+

0 commit comments

Comments
 (0)