This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# We are going to compile the C/C++ parts with intel's icc/icpc | |
export CC="icc" | |
export CXX="icpc" | |
export AR="xiar" | |
export LD="xild" | |
export F77='gfortran' | |
export FC='gfortran' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### (Generalized) linear mixed models in R for continous and categorical traits for animal models ### | |
# | |
# General TasK: Fit (G)LMM in R for an animal model with hundreds | |
# of thousands of observations. | |
# This is generally a feasable task, as the pedigree-based covariance structure of | |
# the main random term is very sparse (A-Inverse). | |
# Nevertheless, this is far from trivial directly in R and there are a lot of | |
# caveats. | |
# | |
# Problems: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##################################################### | |
### How to compile R and link it against OpenBLAS ### | |
##################################################### | |
# Assuming no root priviledges on the destination machine, | |
# so we have to compile our software locally | |
# set default installation directory: | |
INSTDIR=$HOME/opt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### as of september 2014 Eigen offers in its devel branch avx vectorization | |
### see: http://comments.gmane.org/gmane.comp.lib.eigen/4545 | |
### get the devel-headers | |
wget -O - http://bitbucket.org/eigen/eigen/get/default.tar.gz > Eigen-Devel.tar.gz | |
### or | |
hg clone https://bitbucket.org/eigen/eigen/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################################################### | |
### Claas Heuer, Sep. 2014 ### | |
### Example of performing Gauss-Seidel with ### | |
### residual updating using NetCDF stored data. ### | |
### Algorithm adopted from: de los Campos (2012) ### | |
#################################################### | |
# this library allows us to read/write NetCDF files in R | |
# Note: for compiling (on linux) the netcdf headers are required: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Claas Heuer, August 2013 | |
// Computing a dense crossproduct | |
// with distributed data using MPI and OpenMP. | |
// Depends Eigen (http://eigen.tuxfamily.org/index.php?title=Main_Page) | |
// compile: | |
// mpicxx -fopenmp -O2 -I/path/to/Eigen crossproduct_mpi_mp.cpp -o cross.o | |
// | |
// run the program (in shell): | |
// # MP = number of cores for openMP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# it is straightforward to change the BLAS-library that is used by an R-instance. | |
# For this we can use the environmental variable LD_PRELOAD. | |
# This variable will load any library specified prior to all others, so we | |
# can define a priority for certain libraries | |
# | |
# So in terms of R we would do something like this: | |
# imagine my BLAS-library is located in /home/user/myBLAS/BLAS.so | |
# invoke R with 'myBLAS' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cuBLAS/cuBLAS-xt is a full CUDA implementation of BLAS 1-3 | |
# ACML is AMD's BLAS 1-3 optimized for AMD GPUs and fma4-CPUs | |
### cuBLAS | |
# | |
# get cuBLAS (note: non-free, closed source) | |
https://developer.nvidia.com/cuda-downloads | |
# example of how to use: http://devblogs.nvidia.com/parallelforall/drop-in-acceleration-gnu-octave/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### using ddot and daxpy | |
# system("curl -O -s https://gist.githubusercontent.com/cheuerde/2f59dd5087e201daee78/raw/1222222c5b4b38c04c55571138da7a962a74f4d0/ddot_daxpy_R.c ") | |
# system("R CMD SHLIB ddot_daxpy_R.c") | |
# dyn.load("ddot_daxpy_R.so") | |
# | |
# in R: | |
# | |
# ddot: | |
# .Call("ddot",x,y) | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################### | |
### How to link R against OpenBLAS on a Mac ### | |
############################################### | |
# this will install brew to /usr/local | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew doctor |