aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md8
-rw-r--r--doc/developers/profiling.md30
-rw-r--r--src/mvlmm.cpp6
3 files changed, 40 insertions, 4 deletions
diff --git a/README.md b/README.md
index da231f3..022801b 100644
--- a/README.md
+++ b/README.md
@@ -116,15 +116,15 @@ a typical example would be
```sh
# compute Kinship matrix
-gemma -g ../example/mouse_hs1940.geno.txt.gz -p ../example/mouse_hs1940.pheno.txt \
+gemma -g ./example/mouse_hs1940.geno.txt.gz -p ./example/mouse_hs1940.pheno.txt \
-gk -o mouse_hs1940
# run univariate LMM
-gemma -g ../example/mouse_hs1940.geno.txt.gz \
- -p ../example/mouse_hs1940.pheno.txt -n 1 -a ../example/mouse_hs1940.anno.txt \
+gemma -g ./example/mouse_hs1940.geno.txt.gz \
+ -p ./example/mouse_hs1940.pheno.txt -n 1 -a ./example/mouse_hs1940.anno.txt \
-k ./output/mouse_hs1940.cXX.txt -lmm -o mouse_hs1940_CD8_lmm
```
-Above example files can be downloaded from
+Above example files are in the git repo and can be downloaded from
[github](https://github.com/genetics-statistics/GEMMA/tree/master/example).
### Debugging and optimization
diff --git a/doc/developers/profiling.md b/doc/developers/profiling.md
new file mode 100644
index 0000000..0d26453
--- /dev/null
+++ b/doc/developers/profiling.md
@@ -0,0 +1,30 @@
+# Profiling
+
+gperftools (formerly the Google profiler) is included in the .guix-dev
+startup script. Compile gemma for profiling:
+
+ make clean
+ make profile
+
+Run the profiler
+
+ env CPUPROFILE=/tmp/prof.out ./bin/gemma -g ./example/mouse_hs1940.geno.txt.gz -p ./example/mouse_hs1940.pheno.txt -gk -o mouse_hs1940
+ pprof ./bin/gemma /tmp/prof.out
+
+and `top` shows
+
+```
+Welcome to pprof! For help, type 'help'.
+(pprof) top
+Total: 720 samples
+ 103 14.3% 14.3% 103 14.3% dgemm_kernel_ZEN
+ 39 5.4% 19.7% 79 11.0% ____strtod_l_internal
+ 37 5.1% 24.9% 53 7.4% __printf_fp_l
+ 36 5.0% 29.9% 36 5.0% __sched_yield
+ 34 4.7% 34.6% 34 4.7% __strlen_avx2
+ 31 4.3% 38.9% 31 4.3% __strspn_sse42
+ 26 3.6% 42.5% 116 16.1% ReadFile_geno
+ 25 3.5% 46.0% 26 3.6% _int_malloc
+ 23 3.2% 49.2% 23 3.2% gsl_vector_set
+ 18 2.5% 51.7% 18 2.5% __strcspn_sse42
+```
diff --git a/src/mvlmm.cpp b/src/mvlmm.cpp
index 4b8db05..51ed901 100644
--- a/src/mvlmm.cpp
+++ b/src/mvlmm.cpp
@@ -3666,6 +3666,8 @@ void MVLMM::AnalyzePlink(const gsl_matrix *U, const gsl_vector *eval,
t_last++;
}
for (vector<SNPINFO>::size_type t = 0; t < snpInfo.size(); ++t) {
+ cout << snpInfo[t].rs_number << endl;
+
if (t % d_pace == 0 || t == snpInfo.size() - 1) {
ProgressBar("Reading SNPs", t, snpInfo.size() - 1);
}
@@ -3752,6 +3754,10 @@ void MVLMM::AnalyzePlink(const gsl_matrix *U, const gsl_vector *eval,
gsl_matrix_set_zero(Xlarge);
for (size_t i = 0; i < l; i++) {
+ double t = (double(clock()-time_start)/(double(CLOCKS_PER_SEC)));
+ printf("%.2f ",t);
+ if (i>10) exit(1);
+ cout << i << "," << l << endl;
gsl_vector_view UtXlarge_col = gsl_matrix_column(UtXlarge, i);
gsl_vector_memcpy(&X_row.vector, &UtXlarge_col.vector);