Monday, July 02, 2018

Compile MOLCAS 8.2 at ccuf1 with OpenMPI 3.0.0 and libhdf5-1.10.2

Note that libhdf5 installed at ccuf1 supports OpenMPI, not MPICH2
apt-get install libhdf5-openmpi-dev

Use the new libhdf5-1.10.2 compiled at ccuf1 and installed under
/pkg1/local/lib 
(libhdf5 configured with
./configure --prefix=/pkg1/local --enable-parallel --enable-fortran --enable-direct-vfd  and compiled by Intel Fortran)

Enter bash
. /pkg1/intel/compilers_and_libraries_2018.1.163/linux/bin/compilervars.sh intel64
export PATH="/pkg1/local/openmpi-3.0.0-i18/bin:$PATH"
export LD_LIBRARY_PATH="/pkg1/local/openmpi-3.0.0-i18/lib:$LD_LIBRARY_PATH"

mkdir /temp/molcas82.hdf5
cd /temp/molcas82.hdf5
tar zxf /f01/source/chem/molcas/molcas82.tar.gz
cd molcas82
cp /f01/source/chem/molcas/license.dat.gz .
gzip -d license.dat.gz 
vi cfg/intel.comp
   and add -prec-sqrt to  OPT='-O3 -no-prec-div -static -xHost' if set -speed fast

(Use ./setup first to determine configure parameters beforehand, the following is concluded: )
./configure -64 -parallel -compiler intel -mpiroot /pkg1/local/openmpi-3.0.0-i18 -mpirun /pkg1/local/openmpi-3.0.0-i18/bin -blas MKL -blas_lib BEGINLIST -Wl,--no-as-needed -L/pkg1/intel/compilers_and_libraries_2018.1.163/linux/mkl/lib/intel64 -lmkl_intel_ilp64 -lmkl_core -lmkl_sequential -lpthread -lm ENDLIST -hdf5_lib /pkg1/local/lib -hdf5_inc /pkg1/local/include

make -j 8 >& make.log &

If this fails, type make >& make.log2 & again without -j parallellism. After successful build,
copy the whole directory to /pkg1/chem/molcas/molcas82.i18.ompi3.hdf5

Put the following line
/pkg1/chem/molcas/molcas82.i18.ompi3.hdf5
under your $HOME/.Molcas/molcas 
and run with the script
/usr/local/bin/molcas82.i18.ompi3.hdf5

Also include /pkg1/local/lib within $LD_LIBRARY_PATH at run time if libhdf5.so.101 is not found.
In addition, pay attention to the warning of ld at the linking stage:
ld: warning: libmpi.so.12, needed by /pkg1/local/lib/libhdf5.so, may conflict with libmpi.so.40 

************ NECI test compile with MOLCAS 8.4  ************
Test 1:
cmake -DENABLE_HDF5=ON -DFFTW=ON -DMPI=ON -DSHARED_MEMORY=ON \ -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx \ -DCMAKE_Fortran_COMPILER=mpif77 ../../neci/



Test 2:

Tuesday, April 03, 2018

Taiwania: NWChem 6.8.1 (release 20180206) compile log (Intel Compiler 18.0.1.163)

glogin1: Red Hat Enterprise Linux Server release 7.3 (Maipo)
Intel Compiler Version 18.0.1.163 Build 20171018
gcc v4.8.5, Python v2.7.5

module load intel/2018_u1 
module load cuda/8.0.61 
module load mvapich2/gcc/64/2.2rc1 
# If you want to use gcc 6.3.0 to work with Intel Compiler 18
module load gcc/6.3.0 
echo $MKLROOT

/pkg/intel/2018_u1/compilers_and_libraries_2018.1.163/linux/mkl

# Get the master release if CUDA is not being compiled.
cd /home/molpro/src
mkdir nwchem-6.8.1.opa.scalapack.cuda-tce
cd nwchem-6.8.1.opa.scalapack.cuda-tce
unzip ../nwchem-6.8.1-20180206.zip

mv nwchem-master nwchem-6.8.1


# Or get the 6.8.1 Branch to support multiple CUDA cards within one single node. Thanks to Edoardo Aprà!
git clone -b hotfix/release-6-8 https://github.com/nwchemgit/nwchem nwchem-6.8.1

# Starting here, refer to Jeff Hammond's page 
# https://github.com/jeffhammond/HPCInfo/blob/master/ofi/NWChem-OPA.md
# Required minimum versions of tools:
# M4_VERSION=1.4.17
# LIBTOOL_VERSION=2.4.4
# AUTOCONF_VERSION=2.69
# AUTOMAKE_VERSION=1.15
export PATH="$HOME/local/bin:$PATH"
export NWCHEM_ROOT=/home/molpro/src/nwchem-6.8.1.opa.scalapack.cuda-tce
cd $NWCHEM_ROOT

libfabric
wget https://github.com/ofiwg/libfabric/archive/master.zip
unzip master.zip
mv libfabric-master libfabric
cd $NWCHEM_ROOT/libfabric/
./autogen.sh
mkdir $NWCHEM_ROOT/libfabric/build

cd $NWCHEM_ROOT/libfabric/build
../configure CC=icc CXX=icpc --enable-psm2 --disable-udp --disable-sockets --disable-rxm \
   --prefix=$NWCHEM_ROOT/deps
## Default gcc 4.8.3 does not work, use gcc 6.3.0 fixed
make -j 16 >& make.log &
make install
cd $NWCHEM_ROOT

Intel MPI
export MPI_ROOT=$I_MPI_ROOT/intel64
export MPICC=$MPI_ROOT/bin/mpiicc
export MPICXX=$MPI_ROOT/bin/mpiicpc
export MPIFC=$MPI_ROOT/bin/mpiifort

Casper
cd $NWCHEM_ROOT
git clone https://github.com/pmodels/casper
cd $NWCHEM_ROOT/casper
Ming Si's instructions:
git submodule init
git submodule update
# Fallback to Jeff's instruction:
./autogen.sh
mkdir $NWCHEM_ROOT/casper/build

cd $NWCHEM_ROOT/casper/build
../configure CC=$MPICC --prefix=$NWCHEM_ROOT/deps
make -j 16 >& make.log &
make install
cd $NWCHEM_ROOT

ARMCI-MPI
git clone --depth 10 https://github.com/jeffhammond/armci-mpi.git || \
wget https://github.com/jeffhammond/armci-mpi/archive/master.zip && \
unzip master.zip
cd armci-mpi
./autogen.sh
mkdir $NWCHEM_ROOT/armci-mpi/build

cd $NWCHEM_ROOT/armci-mpi/build
../configure MPICC=$MPICC MPIEXEC=$MPI_ROOT/bin/mpirun --enable-win-allocate --enable-explicit-progress \
  --prefix=$NWCHEM_ROOT/deps
configure: WARNING: unrecognized options: --enable-win-allocate, --enable-explicit-progress
make -j 16 >& make.log &
make install
# Now testing ARMCI-MPI
make checkprogs -j8 | tee checkprogs.log
make check MPIEXEC="$MPI_ROOT/bin/mpirun -n 2" | tee check-mpiexec.log
# avoid loading mvapich2 modules can eliminated the following three errors
FAIL:  3
# FAIL: tests/test_malloc
# FAIL: tests/test_malloc_irreg
# FAIL: tests/contrib/armci-test

# Continue to compile NWChem, if gcc version >5, such as 6.3.0 cannot compile CUDA's memory.cu
# set "nvcc --compiler-bindir=<path to older GCC>" to use the old gcc
module unload gcc/6.3.0
cd $NWCHEM_ROOT
source ../bashrc.nwchem.opa.scalapack.cuda-tce
cd $NWCHEM_TOP/src
make nwchem_config >& nwchem_config.log &
make -j 32 >& make.log &

# End of NWChem compilation #
# Refer to Jeff Hammond's page to setup the script of mpirun to work with Casper.

Contents of bashrc.nwchem.opa.scalapack.cuda-tce
export NWCHEM_ROOT=/home/molpro/src/nwchem-6.8.1.opa.scalapack.cuda-tce
export NWCHEM_TOP="${NWCHEM_ROOT}/nwchem-6.8.1"
export NWCHEM_TARGET=LINUX64
export USE_PYTHONCONFIG=y
export USE_PYTHON64=y
export PYTHONVERSION=2.7
export PYTHONHOME=/usr

export NWCHEM_MODULES="all python"
export MRCC_METHODS=TRUE

export CUDA="nvcc --compiler-bindir=/usr/bin"
export TCE_CUDA=Y
export CUDA_LIBS="-L/pkg/cuda/8.0.61/lib64 -lcudart -lcublas -lstdc++"
export CUDA_FLAGS="-arch sm_60 "
export CUDA_ARCH="-arch sm60"
export CUDA_INCLUDE="-I. -I/pkg/cuda/8.0.61/include"

export USE_OPENMP=T
export ARMCI_NETWORK=ARMCI
export EXTERNAL_ARMCI_PATH=${NWCHEM_ROOT}/deps
MPI_DIR=${MPI_ROOT}
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export MPI_LIB="${MPI_DIR}/lib"
export MPI_INCLUDE="${MPI_DIR}/include"
MPICH_LIBS="-lmpifort -lmpi"
SYS_LIBS="-ldl -lrt -lpthread -static-intel"
export LIBMPI="-L${MPI_DIR}/lib -Wl,-rpath -Wl,${MPI_DIR}/lib ${MPICH_LIBS} ${SYS_LIBS}"
export CC=icc
export CXX=icpc
export FC=ifort
export F77=ifort

export BLAS_SIZE=8
export BLASOPT="-mkl=parallel -qopenmp"
export LAPACK_SIZE=8
export LAPACK_LIB="$BLASOPT"
export LAPACK_LIBS="$BLASOPT"
export USE_SCALAPACK=y
export SCALAPACK_SIZE=8
export SCALAPACK="-L${MKLROOT}/lib/intel64 -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread \
 -lmkl_core -lmkl_blacs_intelmpi_ilp64 -liomp5 -lpthread -lm -ldl"



Tuesday, February 06, 2018

nwchem 6.8 for Intel Phi 7120P (KNC) compile log -- Must use Intel Compiler 2017.4.196

q183 Phi: CentOS 6.6 (Final)
Intel Compiler Version 18.0.1.163 Build 20171018
Python v2.6.6
(see also http://www.nwchem-sw.org/index.php/Compiling_NWChem)

. /opt/intel/compilers_and_libraries_2018.1.163/linux/bin/compilervars.sh intel64
echo $MKLROOT

/opt/intel/compilers_and_libraries_2018.1.163/linux/mkl

cd /phi
tar jxf /f01/source/chem/nwchem/nwchem-6.8-release.revision-v6.8-47-gdf6c956-srconly.2017-12-14.tar.bz2
cd nwchem-6.8/src

# apply patches

# Compilation setup for Phi
export NWCHEM_TOP=/phi/nwchem-6.8
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export NWCHEM_TARGET=LINUX64
export USE_PYTHONCONFIG=y
export PYTHONHOME=/usr
export PYTHONVERSION=2.6
export FC=ifort
export CC=icc
export CXX=icpc

export USE_OPENMP=1
export USE_OFFLOAD=1

export BLASOPT="-mkl -qopenmp   -lpthread -lm"
export USE_SCALAPACK=y
export SCALAPACK="-mkl -qopenmp -lmkl_scalapack_ilp64 -lmkl_blacs_intelmpi_ilp64 -lpthread -lm"

export NWCHEM_MODULES="all python"
export MRCC_METHODS=TRUE

### compilation error @libtce.a(ccsd_t.o): Intel Compiler 18 does not support KNC offload
### Trying Intel Compiler 17.0.4.196 Build 20170411

. /opt/intel/compilers_and_libraries_2017.4.196/linux/bin/compilervars.sh intel64
echo $MKLROOT

/opt/intel/compilers_and_libraries_2017.4.196/linux/mkl

cd /phi/jsyu/git
git clone https://github.com/nwchemgit/nwchem.git

Initialized empty Git repository in /phi/jsyu/git/nwchem/.git/
remote: Counting objects: 238809, done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 238809 (delta 45), reused 44 (delta 23), pack-reused 238723
Receiving objects: 100% (238809/238809), 280.07 MiB | 13.34 MiB/s, done.
Resolving deltas: 100% (191961/191961), done.

cd nwchem/src 

# this is nwchem-6.8.1

# Compilation setup for Phi
export NWCHEM_TOP=/phi/jsyu/git/nwchem
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export NWCHEM_TARGET=LINUX64
export USE_PYTHONCONFIG=y
export PYTHONHOME=/usr
export PYTHONVERSION=2.6
export FC=ifort
export CC=icc
export CXX=icpc

export USE_OPENMP=1
export USE_OFFLOAD=1

export BLASOPT="-mkl -qopenmp   -lpthread -lm"
export USE_SCALAPACK=y
export SCALAPACK="-mkl -qopenmp -lmkl_scalapack_ilp64 -lmkl_blacs_intelmpi_ilp64 -lpthread -lm"

export NWCHEM_MODULES="all python"
export MRCC_METHODS=TRUE

make nwchem_config >& nwchem_config.log &
make -j 20 >& make.log &









Tuesday, January 23, 2018

CFour 2.0beta, MPI v.s. OpenMP parallelism in SCF calculations

Preface: MPI parallelism in CFour for the xvscf module is significantly faster compared to OpenMP parallelism; setting the OpenMP compiled binary with $OMP_NUM_CORES can only get xvscf parallelization by 200%. The drawback of using MPI is that the numbers of scratch directories (rank000~rank###) and file-sizes under them are proportionally multiplied by the processors requested ### (set via $CFOUR_NUM_CORES).

Purpose: Generate converged SCF orbitals with fast OpenMPI calculation, then switch to OpenMP to carry out CCSD calculations, restarted by GUESS=MOREAD (from file OLDMOS ) with the touch JFSGUESS trick.

Binary: ccuf1, /pkg1/chem/c4/cfour_v2b_ompi3-i18/bin compiled by Intel compiler 18 and OpenMPI 3.0.0.

The calculation could be performed manually.

Test molecule: NHC radical intermediate [7.8], open-shell singlet geomertry optimized at M06-2X/6-31+G*.

export CFOUR_NUM_CORES=28

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"

. /pkg1/intel/compilers_and_libraries_2018.1.163/linux/bin/compilervars.sh intel64

export PATH="/pkg1/chem/c4/cfour_v2b_ompi3-i18/bin:/pkg1/local/openmpi-3.0.0-i18/bin:$PATH"

Prepare ZMAT and GENBAS (and maybe also GENECP ) files. Then run by hand,
xcfour >& output.stdout &

Monitor system status with top and after all of the xvmol disappear, the SCF calculation begins by lots of xvscf processes.

Notes:

  1. MP2 module is not implemented with MPI parallelism. Add in ZMAT input with TREAT_PERTURBATION=SEQUENTIAL when using MPI-parallelized binaries for MP2-related calculations.
  2. Adding export MKL_NUM_CORES=2 might further benefit from MKL threading parallel.


PS.