aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--INSTALL.md3
-rw-r--r--src/fastblas.cpp27
-rw-r--r--src/fastopenblas.h28
-rw-r--r--src/gemma.cpp4
-rw-r--r--src/io.cpp2
-rw-r--r--src/ldr.cpp7
-rw-r--r--src/mathfunc.cpp7
-rw-r--r--src/mathfunc.h6
-rw-r--r--src/vc.cpp4
9 files changed, 51 insertions, 37 deletions
diff --git a/INSTALL.md b/INSTALL.md
index 897b062..dc03a71 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -115,7 +115,8 @@ To link a new version, compile OpenBlas as per
make -j 4
-or play with the switches
+or play with the switches (note NO_AFFINITY may be needed in a future
+version)
make USE_THREAD=1 NUM_THREADS=16 NO_AFFINITY=1 -j 4
diff --git a/src/fastblas.cpp b/src/fastblas.cpp
index 0a4eba3..3fe712c 100644
--- a/src/fastblas.cpp
+++ b/src/fastblas.cpp
@@ -24,6 +24,7 @@
#include "debug.h"
#include "fastblas.h"
#include "mathfunc.h"
+#include <string.h>
#ifndef NDEBUG
#include "eigenlib.h"
#endif
@@ -61,20 +62,20 @@ gsl_matrix *fast_copy(gsl_matrix *m, const double *mem) {
/*
Helper function fast_cblas_dgemm runs the local dgemm
*/
-void fast_cblas_dgemm(OPENBLAS_CONST enum CBLAS_ORDER Order,
- OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA,
- OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB,
- OPENBLAS_CONST blasint M,
- OPENBLAS_CONST blasint N,
- OPENBLAS_CONST blasint K,
- OPENBLAS_CONST double alpha,
- OPENBLAS_CONST double *A,
- OPENBLAS_CONST blasint lda,
- OPENBLAS_CONST double *B,
- OPENBLAS_CONST blasint ldb,
- OPENBLAS_CONST double beta,
+void fast_cblas_dgemm(const enum CBLAS_ORDER Order,
+ const enum CBLAS_TRANSPOSE TransA,
+ const enum CBLAS_TRANSPOSE TransB,
+ const blasint M,
+ const blasint N,
+ const blasint K,
+ const double alpha,
+ const double *A,
+ const blasint lda,
+ const double *B,
+ const blasint ldb,
+ const double beta,
double *C,
- OPENBLAS_CONST blasint ldc) {
+ const blasint ldc) {
#ifndef NDEBUG
size_t i,j;
if (is_debug_mode()) {
diff --git a/src/fastopenblas.h b/src/fastopenblas.h
index 824b686..a0904c3 100644
--- a/src/fastopenblas.h
+++ b/src/fastopenblas.h
@@ -6,19 +6,21 @@
#include <cblas.h> // For OpenBlas
#include "gsl/gsl_matrix.h"
-void fast_cblas_dgemm(OPENBLAS_CONST enum CBLAS_ORDER Order,
- OPENBLAS_CONST enum CBLAS_TRANSPOSE TransA,
- OPENBLAS_CONST enum CBLAS_TRANSPOSE TransB,
- OPENBLAS_CONST blasint M,
- OPENBLAS_CONST blasint N,
- OPENBLAS_CONST blasint K,
- OPENBLAS_CONST double alpha,
- OPENBLAS_CONST double *A,
- OPENBLAS_CONST blasint lda,
- OPENBLAS_CONST double *B,
- OPENBLAS_CONST blasint ldb,
- OPENBLAS_CONST double beta,
+#ifndef
+
+void fast_cblas_dgemm(const enum CBLAS_ORDER Order,
+ const enum CBLAS_TRANSPOSE TransA,
+ const enum CBLAS_TRANSPOSE TransB,
+ const blasint M,
+ const blasint N,
+ const blasint K,
+ const double alpha,
+ const double *A,
+ const blasint lda,
+ const double *B,
+ const blasint ldb,
+ const double beta,
double *C,
- OPENBLAS_CONST blasint ldc);
+ const blasint ldc);
#endif
diff --git a/src/gemma.cpp b/src/gemma.cpp
index e2881a4..a1aeaa3 100644
--- a/src/gemma.cpp
+++ b/src/gemma.cpp
@@ -3087,6 +3087,9 @@ void GEMMA::BatchRun(PARAM &cPar) {
return;
}
+#include "Eigen/Dense"
+// using namespace Eigen;
+
void GEMMA::WriteLog(int argc, char **argv, PARAM &cPar) {
string file_str;
file_str = cPar.path_out + "/" + cPar.file_out;
@@ -3103,6 +3106,7 @@ void GEMMA::WriteLog(int argc, char **argv, PARAM &cPar) {
outfile << "## GSL Version = " << GSL_VERSION << endl;
outfile << "## Eigen Version = " << EIGEN_WORLD_VERSION << "." << EIGEN_MAJOR_VERSION << "." << EIGEN_MINOR_VERSION << endl;
#ifdef OPENBLAS
+
outfile << "## OpenBlas = " << openblas_get_config() << " - " << openblas_get_corename() << endl;
outfile << "## threads = " << openblas_get_num_threads() << endl;
diff --git a/src/io.cpp b/src/io.cpp
index cc0f064..d1c4bc2 100644
--- a/src/io.cpp
+++ b/src/io.cpp
@@ -3017,7 +3017,7 @@ bool PlinkKin(const string &file_bed, const int display_pace,
gsl_matrix_submatrix(Xlarge, 0, msize * i_vc, ni_test, msize);
gsl_matrix_view kin_sub =
gsl_matrix_submatrix(matrix_kin, 0, ni_test * i_vc, ni_test, ni_test);
- eigenlib_dgemm("N", "T", 1.0, &X_sub.matrix, &X_sub.matrix, 1.0,
+ fast_dgemm("N", "T", 1.0, &X_sub.matrix, &X_sub.matrix, 1.0,
&kin_sub.matrix);
}
}
diff --git a/src/ldr.cpp b/src/ldr.cpp
index 3554efa..f70eb85 100644
--- a/src/ldr.cpp
+++ b/src/ldr.cpp
@@ -29,7 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "Eigen/Dense"
+// #include "Eigen/Dense"
#include "gsl/gsl_blas.h"
#include "gsl/gsl_cdf.h"
#include "gsl/gsl_eigen.h"
@@ -46,7 +46,7 @@
#include "param.h"
using namespace std;
-using namespace Eigen;
+// using namespace Eigen;
void LDR::CopyFromParam(PARAM &cPar) {
a_mode = cPar.a_mode;
@@ -70,8 +70,10 @@ void LDR::CopyFromParam(PARAM &cPar) {
return;
}
+
void LDR::CopyToParam(PARAM &cPar) { return; }
+/*
// X is a p by n matrix.
void LDR::VB(const vector<vector<unsigned char>> &Xt, const gsl_matrix *W_gsl,
const gsl_vector *y_gsl) {
@@ -107,3 +109,4 @@ void LDR::VB(const vector<vector<unsigned char>> &Xt, const gsl_matrix *W_gsl,
return;
}
+*/
diff --git a/src/mathfunc.cpp b/src/mathfunc.cpp
index d0a9d65..f55f3c6 100644
--- a/src/mathfunc.cpp
+++ b/src/mathfunc.cpp
@@ -32,7 +32,7 @@
#include <tuple>
#include <vector>
-#include "Eigen/Dense"
+// #include "Eigen/Dense"
#include "gsl/gsl_version.h"
@@ -54,7 +54,7 @@
#include "mathfunc.h"
using namespace std;
-using namespace Eigen;
+// using namespace Eigen;
bool has_nan(const vector<double> v) {
for (const auto& e: v) {
@@ -524,6 +524,7 @@ unsigned char Double02ToUchar(const double dosage) {
return (int)(dosage * 100);
}
+/*
void uchar_matrix_get_row(const vector<vector<unsigned char>> &X,
const size_t i_row, VectorXd &x_row) {
if (i_row < X.size()) {
@@ -535,3 +536,5 @@ void uchar_matrix_get_row(const vector<vector<unsigned char>> &X,
exit(1);
}
}
+
+*/
diff --git a/src/mathfunc.h b/src/mathfunc.h
index 804bc20..1319a64 100644
--- a/src/mathfunc.h
+++ b/src/mathfunc.h
@@ -19,7 +19,7 @@
#ifndef __MATHFUNC_H__
#define __MATHFUNC_H__
-#include "Eigen/Dense"
+// #include "Eigen/Dense"
#include "gsl/gsl_matrix.h"
#include "gsl/gsl_vector.h"
@@ -57,7 +57,7 @@ void KroneckerSym(const gsl_matrix *K, const gsl_matrix *V, gsl_matrix *H);
double UcharToDouble02(const unsigned char c);
unsigned char Double02ToUchar(const double dosage);
-void uchar_matrix_get_row(const vector<vector<unsigned char>> &X,
- const size_t i_row, Eigen::VectorXd &x_row);
+// void uchar_matrix_get_row(const vector<vector<unsigned char>> &X,
+// const size_t i_row, Eigen::VectorXd &x_row);
#endif
diff --git a/src/vc.cpp b/src/vc.cpp
index 1465f16..f8cc2b5 100644
--- a/src/vc.cpp
+++ b/src/vc.cpp
@@ -41,7 +41,7 @@
#include "gsl/gsl_min.h"
#include "gsl/gsl_multiroots.h"
-#include "Eigen/Dense"
+// #include "Eigen/Dense"
#include "eigenlib.h"
#include "gzstream.h"
@@ -53,7 +53,7 @@
#include "vc.h"
using namespace std;
-using namespace Eigen;
+// using namespace Eigen;
// In this file, X, Y are already transformed (i.e. UtX and UtY).
void VC::CopyFromParam(PARAM &cPar) {