From Dalhousie University

Site: UtilizingMultipleCores

Utilizing multiple cores

There are quite a few easy to use tools that help existing code to use multiple cores and cpus. Here are some of them -

R - The build of R on the cluster uses multi threaded blas and lapack. So if there is lots of blas and lapack usage, there would be performance improvements. If there are plenty of loops, please visit http://www.rparallel.org/tutorial.php. This could utilize multiple cores. There is a comprehensive list of useful tools at http://cran.r-project.org/web/views/HighPerformanceComputing.html. Most of these tools are available on the cluster

Matlab - Matlab on the cluster uses MKL by default for Blas and Lapack. A parallel toolbox is available from Mathworks that allows utilization of multiple cores. Please also try enabling SMP option in Matlab preferences. On newer Matlab versions, this is enabled by default.

Openmp - Both GCC and Intel compilers support openmp. GCC with the -fopenmp option and Intel with -openmp option. There are a number of tutorials on the internet about how to make loops make use of multiple cores. Here is an example - http://space.mit.edu/cxc/slirp/multicore.pdf. The number of max threads can be set like this - export OMP_NUM_THREADS=<a number <= total number of available cores>. Intel has a product called Cluster Openmp, that extends Openmp to utilize multiple nodes over an interconnect. (same idea as MPI).

Clk++ - Clk++ is also available on the cluster. It is another option for C++ code to utilize multiple cores. Please visit http://web.cilk.com/_packages/documentation/ for documentation. The Clk++ version of gcc and g++ could be used like this - add the following to .bashrc - export PATH=/opt/cilk/bin:$PATH

BLAS and LAPACK - Here is the way to use multithreaded blas and lapack on the cluster -

With GCC - -L/opt/intel/Compiler/11.1/038/mkl/lib/em64t-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_lapack -lmkl_core -L/opt/intel/Compiler/11.1/038/lib/intel64 -liomp5 -lpthread

With Intel - -L/opt/intel/Compiler/11.1/038/mkl/lib/em64t -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_lapack -lmkl_core -L/opt/intel/Compiler/11.1/038/lib/intel64 -liomp5 -lpthread

Retrieved from http://www.mathstat.dal.ca/cluster/index.php/Site/UtilizingMultipleCores
Page last modified on August 07, 2009, at 06:52 AM