Differences between revisions 7 and 8
Revision 7 as of 2009-03-25 17:11:58
Size: 1125
Editor: localhost
Comment: converted to 1.6 markup
Revision 8 as of 2009-04-03 11:17:42
Size: 1240
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Some of the mex files use parallel programming with [[http://openmp.org/wp/|OpenMp]]: If the mex files are compiled with build_matlab_multithread.m (instead of build_matlab.m), some of the mex files use parallel programming with [[http://openmp.org/wp/|OpenMp]]:
Line 3: Line 3:
 * A_times_B_kronecker_C
Line 12: Line 13:
The first two lines are necessary even without parallel programming.   The first two lines are necessary even without parallel programming.

If the mex files are compiled with build_matlab_multithread.m (instead of build_matlab.m), some of the mex files use parallel programming with OpenMp:

  • sparse_hessian_times_B_kronecker_C
  • A_times_B_kronecker_C
  • simulate

Under linux an environment variable has to be defined to get the thing working because there is an incompatibility issue between the multithread library distributed with matlab (libguide.so) and the open source multithread library used by the gnu compiler (libgomp.so). The simplest workaround is to add the folowwing lines in your .bashrc file:

export LD_PRELOAD=$LD_PRELOAD:/lib/libgcc_s.so.1
export LD_PRELOAD=$LD_PRELOAD:/usr/lib/libstdc++.so.6
export LD_PRELOAD=$LD_PRELOAD:/usr/lib/libgomp.so.1

The first two lines are necessary even without parallel programming.

There is also an incompatibility issue between matlab's version of MKL (blas and lapack) and the gnu multithread library. So we cannot mix parallel programming and calls to blas or lapack (of course we may decide to use a basic version of blas or lapack routines, ie without multithreading). If my understanding is correct this problem is related of the version of MKL shipped with matlab.

DynareWiki: UsingMultithreadedDlls (last edited 2013-06-19 16:06:29 by HoutanBastani)