Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No MKL fails #2

Open
lisucr opened this issue Jul 25, 2019 · 2 comments
Open

No MKL fails #2

lisucr opened this issue Jul 25, 2019 · 2 comments

Comments

@lisucr
Copy link

lisucr commented Jul 25, 2019

When running SlipInvNNLS without the MKL option, there seems to be a missing part of the code. I have ran the example for L'Aquila, but the program stops in the following part saying there is no code for the non-MKL option.

%SlipInvNNLS
Reading parameters...
(Warning! Assumig order epicL, epicW in input.dat!)
(Using mu values from file crustal.dat)
(reading observed data from files)
Creating matrix H...
(Correcting GFs for artifical time delay by 30.000000000000000 sec.)
Creating vector u...
Creating matrix G and vector d...
(constraint on M0 applied)
(smoothing by model covariance matrix applied)
(Preparing the covariance matrix ...)
(k^-2 in space and f^0 in time)
!!!!!!!!!!!!!!!!!!!!!!!Not yet coded!!!!!!!!!!!!!!!!!!!!!!!

The problem seems to be in the file CreateGandD.f90 right here,

#ifdef MKL
call dpotrf('U',Nseis,CD,Nseis,i) ! Upper triangle of CD becomes U
if (i>0) then
print ,' the matrix is not positive definite!'
stop
endif
call dpotri('U',Nseis,CD,Nseis,i) ! Inverse of CD
call dpotrf('U',Nseis,CD,Nseis,i) ! Upper triangle of CD becomes U
do i=1,Nseis-1 ! Transpose and clear upper triangle
! CD(i+1:Nseis,i)=CD(i,i+1:Nseis)
! CD(i,i+1:Nseis)=0.d0
CD(i+1:Nseis,i)=0.d0 ! Clear lower triangle
enddo
continue
#else
write(
,*)'!!!!!!!!!!!!!!!!!!!!!!!Not yet coded!!!!!!!!!!!!!!!!!!!!!!!'
stop
! CDinv=CD
! CALL cholsl(Nseis,CDinv,CD)
#endif

@fgallovic
Copy link
Owner

fgallovic commented Jul 29, 2019 via email

@lisucr
Copy link
Author

lisucr commented Aug 14, 2019

Thanks for your answer. I'm used to open source software, but I did not know MKL was free from Intel (at least for now). So I managed to install it in my system and worked out the compilation with gfortran.

Intel fortran compiler (ifort) stopped being free for non-commercial use and even though I work at a University, I could not get a license from them. Here is how I managed to compile your code under Ubuntu Linux 4.15.0-55-generic using gfortran

For the main program:
gfortran -I${MKLROOT}/include -L${MKLROOT}/lib/intel64 -lmkl_rt -lpthread -lm -ldl -ffree-line-length-none -DMKL -O -cpp -fopenmp -DMKL -o SlipInvNNLS SlipInvNNLS.f90 CreateGandD.f90 filters.for init.f90 dc3dmodif.f nr.for nnls.f90 OutputModel.f90 -llapack -lblas

gfortran -m64 -I${MKLROOT}/include -L${MKLROOT}/lib/intel64 -lmkl_rt -lpthread -lm -ldl -ffree-line-length-none -O -cpp -fopenmp -DMKL -DNNLSMKL -o SlipInvSVD1 SlipInvSVD1.f90 CreateGandD.f90 filters.for init.f90 dc3dmodif.f nr.for -llapack -lblas

gfortran -m64 -I${MKLROOT}/include -L${MKLROOT}/lib/intel64 -lmkl_rt -lpthread -lm -ldl -ffree-line-length-none -O -cpp -fopenmp -DMKL -DNNLSMKL -o SlipInvSVD2 SlipInvSVD2.f90 init.f90 OutputModel.f90 -llapack -lblas

For src-stations:
gfortran -ffree-line-length-none -o stations stations.f90

For src-dwn:
gfortran -O -freal-4-real-8 -o gr_nez gr_nez.for
gfortran -O -freal-4-real-8 -o cnv_nez cnv_nez.for
gfortran -O -o prepare prepare.f90
gfortran -O -o resort resort.f90

For src-graphics:
gfortran -ffree-line-length-none -o processseis processseis.f90 filters.for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants