1. How to compile RKMAG ?
Since >90% of the execution time RKMAG uses either FFT or eigenvalue routines, selection of proper libraries is one of the most important decisions. At first I took parts of LAPACK, EISPACK and BLAS and integrated them into my code, making my code highly portable, i.e. one needed only to recompile the sources in order to build a working binary version.
However, I quickly realized that parallelization and optimization of these codes would prove to be difficult; moreover I have seen a significant improvement in speed when using a precompiled, optimized versions of LAPACK. Since this I have decided to separate LAPACK portion from per se my code. On the negative side it complicates codes' compilation.
So there are three options - you can use the version on www.rkmag.com
, you can ask me to recompile rkmag specifically for your computer (which is very easy for me to do), or you can do the compilation yourself. In the latter case, one needs to have a version of LAPACK and ARPACK. In case of Intel CPU (Pentium, Em64t, Ithanium) I would recommend using Intel MKL or cluster MKL; the non-commerical license for the first one is available for free at http://www.intel.com/cd/software/products/asmo-na/eng/perflib/219771.htm
. I would also recommend getting Intel Fortran from there as well. If you need to use MKL commercially, the academic price is still quite low.
As soon as you install the libraries, you can compile the code by issuing:
ifort -r8 -i4 -parallel -D_LINUX -ipo -O3 -implicitnone -L<location of MKL libraries> -I<location of MKL include files> -lmkl_lapack -lguide -lpthread -lm -lmkl_ia32 <arpack_library> mkl_dfti.f90 fields.f90 masque.f90 modes.f90 tensor.f90 main.f90 driver.f modar.f90
Obviously -imlicitnone can be dropped, also -tpp7 -xP or other processor specific opimitzation should be inserted (-xP generates code specifically for SSE3 - P4 Prescott). If CPU is 64bit, -lmkl_ia64 can be used. The example above compiles a multi-thread version.
ifort -r8 -i4 -parallel -D_LINUX -ipo -O3 -implicitnone /lib/libarpack.a /lib/liblapack.a mkl_dfti.f90 fields.f90 masque.f90 modes.f90 tensor.f90 main.f90 driver.f modar.f90
This version is compiled with local version of lapack and arpack - libarpack.a and liblapack.a
I had some really bad experience with using old software: Intel Fortran 8.0 and some really old Linux kernels - lots of bugs with multi-threading.
2. Can you email me your thesis ?
I will email my thesis to you, however since it is a year old and I did not edit it recently, for most things my articles are somewhat more illustrative: