Parallelise our implementation of a two-dimensional heat equation solver using OpenMP. See Code description for some theory and more details about the code.
Starting point is a working serial code, which you should parallelize by inserting appropriate OpenMP directives and routines. For fine-grain parallelization here, parallel regions should be within subroutines performing computations.
- Determine the number of threads in the main routine (cpp/main.cpp or fortran/main.F90)
- Parallelize the generation of initial temperature in the routine
generate_field()
(in fortran/setup.F90) or in thegenerate()
method (in cpp/heat.cpp - Parallelize the main computational routine
evolve()
in cpp/core.cpp or fortran/core.F90.
To build the code, please use the provided Makefile
(by typing make
). By default, GNU
compiler is used, in order to use Intel compiler type make COMP=intel
.