Hi Julie, thanks for the link. However, I am still having problems.
/opt/intel/Compiler/11.0/083/lib/ia64/libguide.so: undefined reference to `pthread_atfork'
Failed to exec command "mcmcobsinfwdaugmentinfprdvarrjeffbetanewu10Gibbs.out": No such file or directory
admin wrote:Taka a look here :http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/
It should get you the correct linking sequence with MKL.
Julie
Hi, i tried this using call potrf( newidentity2) and I got:
ifort -free -o testrandomMVnorm.out testrandomMVnorm.f90 randmvnorm.f90 -L/opt/intel/Compiler/11.1/064/mkl/lib/64 -lmkl_lapack95_ilp64 -Wl,--start-group -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread
/tmp/ifortVr7Gud.o(.text+0x15b2): In function `MAIN__':
I also tried removing reference to potrf and just creating a upper triangular matrix, and my program runs, i.e. it creates random numbers from a multivariate normal. However, I get the following:
testrandomMVnor(30750): unaligned access to 0x60000fffffffa164, ip=0x20000000003c50d0
testrandomMVnor(30750): unaligned access to 0x60000fffffffa164, ip=0x20000000003c58f0
testrandomMVnor(30750): unaligned access to 0x60000fffffffa09c, ip=0x20000000003c5930
testrandomMVnor(30750): unaligned access to 0x60000fffffffa164, ip=0x20000000003c5311
testrandomMVnor(30750): unaligned access to 0x60000fffffffa09c, ip=0x20000000003c5340
However, when I xomment out some code to create a test upper traingler matrix and use call spotrf('U', dimen, newidentity2, dimen) I get a segmentation error
forrtl: severe (174): SIGSEGV, segmentation fault occurred. However, since I am using Fortran 77 code and compiling with f90 code, why am I not getting worse
here is the version of my code with spotrf('U', dimen, newidentity2, dimen)
program mcnet
implicit none
integer :: i, j
real :: harvest1, harvest2, sd
integer :: dimen, seed_in1, seed_in2, n_rand_obs_in
real , dimension (:, :), allocatable :: newidentity, sigmanew, meanvectnorm, meanvectnormtrans, meanvect, meanvecttrans, &
meanvectold, meanvecttransold, Q, r_mvgaussian_list1, r_mvgaussian_list2, sigmanewchol, newidentity2
interface
subroutine gaussianmv_rng_mkl(seed_in, n_rand_obs_in, r_mvgaussian_list, dimen, mean, tcv)
implicit none
integer, intent(in) :: seed_in, n_rand_obs_in, dimen
real, dimension(1:n_rand_obs_in, 1:dimen), intent(out) :: r_mvgaussian_list
real, dimension(1:1, 1:dimen), intent(in) :: mean
real, dimension(1:dimen, 1:dimen), intent(in) :: tcv
end subroutine gaussianmv_rng_mkl
end interface
! allowing for easy changes in dimensionality
dimen = 3
n_rand_obs_in = 3
call random_seed
allocate(newidentity(1:dimen, 1:dimen))
!allocate(sigmanew(1:dimen, 1:dimen))
allocate(meanvectnorm(1:dimen, 1:1))
allocate(meanvectnormtrans(1:1, 1:dimen))
allocate(newidentity2(1:dimen, 1:dimen))
allocate(r_mvgaussian_list2(1:n_rand_obs_in, 1:dimen) )
allocate(Q(1:dimen, 1:1))
!allocate(tcv(1:dimen, 1:dimen))
newidentity = 1.0
!scaling factor as per algoritm
sd = (2.38)**2/dimen
meanvect = 0.0
meanvectnorm = 0.0
do j = 1, dimen
! identity matrix times scaling factor as per Roberts and Rosthenthal (2009) gives innitial value of covariance matrix
newidentity( j, j) = 1.0*(0.01)/dimen
end do
!print *, newidentity
call random_number(harvest1)
seed_in1 = aint(harvest1 * 2.0e0**31)
meanvectnorm(1,1) = 0.2
meanvectnorm(2,1) = 0.3
meanvectnorm(3,1) = 0.001
newidentity2 = newidentity
!print *, meanvectnorm
meanvectnormtrans = transpose(meanvectnorm)
call spotrf('U', dimen, newidentity2, dimen)
!call potrf( newidentity2)
! note that since cholesky decomposition of newidentity does not change, since newidentity does not change one only needs to derive it once
newidentity2 = 0.0
!do i = 1, dimen
!do j = 1, dimen
!if (i .ge. j) then
! newidentity2(i,j) = newidentity(i,j)
!end if
!end do
!end do
print *, newidentity2
print *, "test"
call gaussianmv_rng_mkl(seed_in1, n_rand_obs_in, r_mvgaussian_list2, dimen, meanvectnormtrans, newidentity2)
!subroutine gaussianmv_rng_mkl(seed_in, n_rand_obs_in, r_mvgaussian_list, dimen, mean, tcv)
do i = 1, n_rand_obs_in
do j = 1, dimen
print *, r_mvgaussian_list2(i, j)
end do
end do
end program