This directory contains example programs that illustrate the use of the
index_map_type
Fortran module.
The compiled executables require no input. The serial executables are run like any normal executable. Running the parallel executables varies. For example:
- MPI version:
$ mpirun -np <N> ./disk-fv-parallel
- Coarray version:
-
NAG:
$ NAGFORTRAN_NUM_IMAGES=<N> ./disk-fv-parallel
-
Intel:
$ FOR_COARRAY_NUM_IMAGES=<N> ./disk-fv-parallel
NOTE: When running on a single shared memory machine, it may be necessary to set the environment variable
I_MPI_FABRICS=shm:ofi
to force Intel's MPI to use shared memory transport. Otherwise performance may be significantly poorer. -
GFortran:
$ cafrun -n <N> ./disk-fv-parallel
-
The program disk-fv-parallel.F90
solves the heat equation disk-fv-serial.F90
is a serial version of the solver.
Aside from the initial setup of the parallel decomposition of the problem, the
only difference between the parallel solver and the serial solver is a single
call to index_map%gather_offp
to update the off-process elements of the local
unknown array with values from their corresponding on-process elements on
neighboring processes -- a parallel halo exchange operation.
The size of the problem is easily changed by setting the NZ
parameter at
the top of the programs to the desired value.
The program disk-fem-parallel.F90
solves the heat equation disk-fem-serial.F90
is a serial version
of the solver. Aside from the initial setup of the parallel decomposition of
the problem, the only difference in the parallel solver are two parallel halo
exchange calls: a call to index_map%gather_offp
at the beginning of each
time step to update the off-process elements of the local unknown array, and
a later call to index_map%scatter_offp_sum
to complete the FE assembly of
the right-hand-side Laplacian term.
The size of the problem is easily changed by setting the NZ
parameter at
the top of the programs to the desired value.
The program redistribute.F90
illustrates how the index_map
type can be
used to redistribute the elements of an array distributed according to one
partitioning of its index set to another array that is distributed according
to another partitioning of the index set.