Earlier versions of Intel MKL (such as 10.x) work perfectly fine. I haven't found a single version of MPICH that does not crash the following code. The command line used to compile the code is
mpif90 -fast -I/opt/intel/composer_xe_2013_sp1.1.103/mkl/include main.f90 -L/opt/intel/composer_xe_2013_sp1.1.103/mkl/lib -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -openmp -lpthread -lm -o main
Below is the minimal code that can be used to reproduce the error. I'm using 24 threads with mpiexec on the same computer. Using 4/8 threads only "occasionally" crashes the code. MPICH is compiled using clang (gcc) and ifort, since I do not have intel c++ compiler.
INCLUDE "mkl_df.f90"
PROGRAM main
USE MPI
USE MKL_DF_TYPE
USE MKL_DF
IMPLICIT NONE
INTEGER :: ierror, rank,nproc,splinestat
TYPE(DF_TASK) :: taskval
REAL(8), ALLOCATABLE, DIMENSION(:) :: V
REAL(8), ALLOCATABLE, DIMENSION(:) :: inc
INTEGER :: nIgrids,ny
CALL MPI_INIT(ierror)
CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierror)
CALL MPI_COMM_SIZE(MPI_COMM_WORLD,nproc,ierror)
nIgrids=120
ny=1
ALLOCATE(inc(nIgrids))
ALLOCATE(V(nIgrids))
inc=0.0D0
V=0.0D0
splinestat = dfdnewtask1d(taskval,nIgrids,inc,DF_QUASI_UNIFORM_PARTITION,ny,V,DF_MATRIX_STORAGE_COLS)
WRITE(*,*) 1,rank,splinestat
CALL MPI_BARRIER(MPI_COMM_WORLD,ierror)
CALL MPI_FINALIZE(ierror)
END PROGRAM main