Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

POT3D is a Fortran code that computes potential field solutions to approximate the solar coronal magnetic field using observed photospheric magnetic fields as a boundary condition. It can be used to generate potential field source surface (PFSS), potential field current sheet (PFCS), and open field (OF) models. It has been (and continues to be) used for numerous studies of coronal structure and dynamics. The code is highly parallelized using MPI and is GPU-accelerated using Fortran standard parallelism (do concurrent) and OpenACC, along with an option to use the NVIDIA cuSparse library. The HDF5 file format is used for input/output.

Building the Application

Running Example

...

Downloading and compiling POT3D

Code Block
git clone https://github.com/predsci/POT3D

There are sample scripts under build_examples directory.

We chose build_examples/build_cpu_mpi-only_intel_ubuntu20.04.sh.

  1. Copy build_examples/build_cpu_mpi-only_intel_ubuntu20.04.sh to root directory.

    • cp build_examples/build_cpu_mpi-only_intel_ubuntu20.04.sh rebuild.sh

  2. Build HDF5 and edit rebuild.sh with HDF5 location.

  3. Execute the build script.

Sample build script:

Code Block
module load intel/2022.1.2
module load compiler/2022.1.0
module load mkl/2022.0.2
# module load impi/2021.6.0
module load hpcx/2.13.0

if [[ "$MPI" =~ impi ]]; then
        export MPIFC=mpiifort
elif [[ "$MPI" =~ hpcx ]]; then
        export OMPI_MPICC=icc
        export OMPI_MPICXX=icpc
        export OMPI_MPIFC=ifort
        export OMPI_MPIF90=ifort
        export MPIFC=mpif90
fi

module load hdf5/1.12.1-$MPI

# Location of local hdf5 installed with same compiler being used for POT3D:
HDF5_INCLUDE_DIR="$HDF5_DIR/include"
HDF5_LIB_DIR="$HDF5_DIR/lib"
# Fortran HDF5 library flags (these can be version dependent):
HDF5_LIB_FLAGS="-lhdf5_fortran -lhdf5hl_fortran -lhdf5 -lhdf5_hl"
...

Running Example

Code Block
cd testsuite
TEST=small
POT3D_HOME=$PWD/..

cp ${POT3D_HOME}/testsuite/${TEST}/input/* ${POT3D_HOME}/testsuite/${TEST}/run/
cd ${POT3D_HOME}/testsuite/${TEST}/run

echo "Running POT3D with $NP MPI rank..."
CMD="mpirun -np $NP $MPIFLAGS $POT3D_HOME/bin/pot3d"

/usr/bin/time $CMD > pot3d.out
echo "Done!"

runtime=($(tail -n 5 timing.out | head -n 1))
echo "Wall clock time: ${runtime[6]} seconds"
echo " "

#Validate run:
${POT3D_HOME}/scripts/pot3d_validation.sh pot3d.out ${POT3D_HOME}/testsuite/${TEST}/validation/pot3d.out

Task and submission

  • to be added

...