------------------------------------------------------------------
Intel OneAPI package was recently made free for all types of use
This note describes how to install PETSc on Linux with Intel OneAPI
------------------------------------------------------------------

OneAPI enables access to following Intel tools:

   * Compilers
   * MPI library
   * MKL library (BLAS, Sparse BLAS, LAPACK, ScaLAPACK, PARDISO)

------------------------------------------------------------------
PREREQUISITES
------------------------------------------------------------------

sudo apt update
sudo apt install build-essential gfortran python-is-python3 python3-numpy
sudo apt install bison flex cmake git-all valgrind
sudo apt-get install libtool libtool-bin pkg-config

------------------------------------------------------------------
HPC Tolkit installation
------------------------------------------------------------------

wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB

sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB

rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB

sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"

sudo apt install intel-hpckit

add . /opt/intel/oneapi/setvars.sh to .bashrc

------------------------------------------------------------------
PETSc optimized example configuration
------------------------------------------------------------------

./configure \
--prefix=/home/data/software/petsc/petsc-3.19.6-opt \
--with-mkl_pardiso-dir=$MKLROOT/lib/intel64 \
--with-mkl_cpardiso-dir=$MKLROOT/lib/intel64 \
--with-blaslapack-dir=$MKLROOT/lib/intel64 \
--with-scalapack-lib="-L=$MKLROOT/lib/intel64 -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64" \
--COPTFLAGS="-O2 -xCORE-AVX2" \
--FOPTFLAGS="-O2 -xCORE-AVX2" \
--CXXOPTFLAGS="-O2 -xCORE-AVX2" \
--with-debugging=0 \
--with-large-file-io=1 \
--with-c++-support=1 \
--with-cc=mpiicx \
--with-cxx="mpiicpx" \
--with-fc=mpiifx \
--download-metis=1 \
--download-parmetis=1 \
--download-ptscotch=1 \
--download-mumps=1 \
--download-superlu_dist=1 \
--with-clean

------------------------------------------------------------------

Enable optimized Sparse BLAS kernels:

-mat_type aijmkl

Enable PARDISO sparse direct solver (OMP version):

-pc_type lu
-pc_factor_mat_solver_type mkl_pardiso 

Enable PARDISO sparse direct solver (MPI version):

-pc_type lu
-pc_factor_mat_solver_type mkl_cpardiso

Control number of threads in BLAS, Sparse BLAS, and PARDISO:

-omp_num_threads n

------------------------------------------------------------------








