[Genabel-commits] r1635 - in pkg/OmicABELnoMM: . tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Mar 5 20:54:09 CET 2014


Author: afrank
Date: 2014-03-05 20:54:09 +0100 (Wed, 05 Mar 2014)
New Revision: 1635

Added:
   pkg/OmicABELnoMM/tests/
   pkg/OmicABELnoMM/tests/Makefile
   pkg/OmicABELnoMM/tests/test.cpp
Log:
Added base tests for validity under tests folder. This should be passed by any build of the solver.

Added: pkg/OmicABELnoMM/tests/Makefile
===================================================================
--- pkg/OmicABELnoMM/tests/Makefile	                        (rev 0)
+++ pkg/OmicABELnoMM/tests/Makefile	2014-03-05 19:54:09 UTC (rev 1635)
@@ -0,0 +1,2 @@
+normal:
+		g++ *.cpp ../src/Algorithm.cpp ../src/Utility.cpp ../src/AIOwrapper.cpp -o test.out -L/usr/lib/openblas-base -lpthread -lopenblas -llapacke -fopenmp -O2 -g -Wall -pedantic -Wunused-result -Wmaybe-uninitialized -Wformat -g
\ No newline at end of file


Property changes on: pkg/OmicABELnoMM/tests/Makefile
___________________________________________________________________
Added: svn:executable
   + *

Added: pkg/OmicABELnoMM/tests/test.cpp
===================================================================
--- pkg/OmicABELnoMM/tests/test.cpp	                        (rev 0)
+++ pkg/OmicABELnoMM/tests/test.cpp	2014-03-05 19:54:09 UTC (rev 1635)
@@ -0,0 +1,85 @@
+//export MKL_NUM_THREADS=1 OMP_NUM_THREADS=1 OMP_NESTED=true
+#include <unistd.h>
+#include <getopt.h>
+
+
+
+#include "../src/Definitions.h"
+#include "../src/Algorithm.h"
+
+
+
+int main(int argc, char *argv[] )
+{
+    struct Settings params;
+
+    params.ForceCheck = true;
+
+
+    //!default params
+    params.r = 1;
+    params.threads = 1;
+
+    omp_set_num_threads(params.threads);
+    blas_set_num_threads(params.threads);
+
+    Algorithm alg;
+
+    params.use_fake_files = true;
+    int iters = 10;
+    int max_threads = 2;
+
+
+    for (int th = 0; th < max_threads; th++)
+    {
+        params.threads = th;
+
+        params.n=10; params.l=4;  params.r=1;
+        params.t=16; params.tb=1; params.m=16; params.mb=1;
+
+        struct Outputs out = {0};
+        for (int i = 0; i < iters; i++)
+        {
+            alg.solve(params, out, P_NEQ_B_OPT_MD);
+        }
+        cout << endl;
+        /******************************/
+        params.n=10; params.l=4;  params.r=2;
+        params.t=16; params.tb=4; params.m=16; params.mb=4;
+
+
+        for (int i = 0; i < iters; i++)
+        {
+            alg.solve(params, out, P_NEQ_B_OPT_MD);
+        }
+        cout << endl;
+        /******************************/
+        params.n=10; params.l=4;  params.r=2;
+        params.t=16; params.tb=5; params.m=16; params.mb=3;
+
+
+        for (int i = 0; i < iters; i++)
+        {
+            alg.solve(params, out, P_NEQ_B_OPT_MD);
+        }
+        cout << endl;
+        /******************************/
+        params.n=10; params.l=4;  params.r=2;
+        params.t=4; params.tb=4; params.m=4; params.mb=4;
+
+
+        for (int i = 0; i < iters; i++)
+        {
+            alg.solve(params, out, P_NEQ_B_OPT_MD);
+        }
+        cout << endl;
+
+    }
+
+    cout << "\nTest finished succesfully\n";
+
+
+
+
+    return 0;
+}



More information about the Genabel-commits mailing list