GPU HACKATHON TEAM 3 - Appentra• Interface (Matlab) 6 Scaling up the numerical simulation (a...
Transcript of GPU HACKATHON TEAM 3 - Appentra• Interface (Matlab) 6 Scaling up the numerical simulation (a...
GPU HACKATHON#gpucesgahack
29 mayo - 1 junio Santiago de Compostela
TEAM 3
Francisco Padilla Benítez
Integrated Numerical Modeling of Water Flow
Freshwater
Saltwater
Surface water
Groundwater
ETS Ingenieros de Caminos, Canales y Puertos de la Universidad de La CoruñaGrupo de Ingeniería del Agua y del Medio Ambiente
F. Padilla
F.Padilla - Universidad de La Coruña
2017, 29 May
Finite element model for surface/groundwater hydrology of saltwater/freshwater in
watersheds
Groundwater freshwater saltwater
Surface water
F.Padilla - Universidad de La Coruña
FRESHWATERSHEDSea water
freshwaterwatershed
4
Horizontal numerical simulation of hydrological, environmental and water engineering problems
F.Padilla – ETSICCPUniversidad de La Coruña
5
Geographical and hydrological regional analysisNumerical simulation
• GIS (parameters and simulation conditions)• Mesh builder (triangular elements)• Numerical software (Fortran 77, 32, GMRS, ram)
F.Padilla - Universidad de La Coruña FRESHWATERSHED
• Interface (Matlab)
6
Scaling up the numerical simulation (a spatial and transient problem)
F.Padilla - Universidad de La Coruña
7
Finite elementsspatial mesh
F.Padilla - Universidad de La Coruña
8
Temporal Scale
• of calculation (seconds, minutes, hours)
• of simulationn (days, months, years)
F.Padilla - Universidad de La Coruña FRESHWATERSHED
9
Velocity field evolution of surface water on the reservoir 2008-2012
F.Padilla – ETSCCPUniversidad de La Coruña
Longitudinal ProfileDam
10
Phreatic Levels and
Water depths
F.Padilla - Universidad de La Coruña
11
Increasing the spatial and temporal scale of the applications
ANALYSIS (DRAFT)
1. Algorithmic features (Fortran FreshWaterSheds: i.e. routine AL2HKC)
2. Parallel design patterns (parallel sparse reduction)3. Implementation features
Algorithmic features● Spatial discretization?
○ Finite differences?○ Finite elements○ Finite volumes?○ Type of elements: triangle, square?
● Type of solver?○ Direct vs Iterative (convergence criteria) YES○ Adaptive discretization of the domain? NO○ Sparse/Irregular computations (e.g. sparse matrices -CRS-)? NO○ Based on solving systems of linear equations? YES
● Compute-bounded? YES● Memory-bounded? NO
Parallel design patterns● Fully parallel loops? no● Parallel scalar reductions?no● Parallel sparse reductions?yes
AL2HKCC------ BOUCLE SUR LES �ELE�MENTSC ======================= DO 10 IC = 1,NELCOLCDIR$ IVDEP DO 20 IE = KELCOL(1,IC),KELCOL(2,IC) NO1 = KNG(1,IE) NO2 = KNG(2,IE) NO3 = KNG(3,IE)--C------ ASSEMBLAGE VFG(1,NO1)=VFG(1,NO1)+(VSX*DFX+VSY*DFY)*ALFAPAS+AM1 VFG(1,NO2)=VFG(1,NO2)+(VKX*DFX+VKY*DFY)*ALFAPAS+AM2VFG(1,NO3)=VFG(1,NO3)+(VEX*DFX+VEY*DFY)*ALFAPAS+AM320 CONTINUE10 CONTINUE
Parallel design patterns● Fully parallel loops? no● Parallel scalar reductions? no● Parallel sparse reductions? yes
Compiling on Windows the Fortran 77 code supporting OpenMP
- Installation of free Eclipse (Photran) and GCC (Fortran)
- Compilation and Linkage of the sequential Fortran code.
- Quite long,. to realize that GCC does not support Fortran 77.
- No execution available.
Compiling on Finisterrae the sequential Fortran 77 code
- On Linux, not too much problem (thanks to Jose Mourinho)
- A short sequential case (10 minutes) accelerates (2
minutes) about 5 times the Windows execution.
- A long term problem (36 hours), after running on the tail
of Finisterrae, accelerates (12 hours) about 3 times the
Windows execution.
Appraisal of the Finisterrae results and execution
- Levels of convergence aren’t equals.
- Some results (execution variables) aren’t exactly the
same (initially quite similar, afterwards less similar).
- Obviously, some Subroutines (posttreatment variables)
aren’t working properly.
Measure of sequential execution for a Long term run (Windows vs Linux)
Execution variable
Windows Linux
Measure of sequential execution for a Long term run (Windows vs Linux) Posttreatment
variable
Windows Linux
New developments
- Find out a new “free” Compiler for Fortran 77 supporting
OpenMP on Windows.
- Work out the problems of Compilation and Linkage on
Windows and Linux.
- Parallelize a “Hot Spot” Subroutine for Windows (LabTop)
and Linux (Finisterrae), and seek out for the time
differences of calculus.