diff --git a/.gitignore b/.gitignore index d01ef90..9682f6d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*.GCC_ +*.exe main *.o .vscode/ diff --git a/ex3/code/main.cpp b/ex3/code/main.cpp index f6d50a5..dc96dfa 100644 --- a/ex3/code/main.cpp +++ b/ex3/code/main.cpp @@ -8,10 +8,9 @@ #include "task_7.h" #include "timing.h" #include // cBLAS Library -#include - #include #include +#include void task_1() { printf("\n\n-------------- Task 1 --------------\n\n"); @@ -235,31 +234,33 @@ void task_7() { // Benchmark cout << fixed << setprecision(4); - size_t NLOOPS = 1000; - cout << "N = " << " | 1 | 2 | 4 | 8 | 16 | 32 " << endl; - cout << "---------|--------|--------|--------|--------|--------|-------" << endl; - for (int exp = 1; exp < 10; ++exp) { - cout << "Nrhs = " << static_cast(pow(2,exp)); + size_t NLOOPS = 200; + size_t Nrhs = 2000; + cout << "Solution time per right hand side in milliseconds: sec*1000/Nrhs" << endl; + cout << "N = " << " | 1 | 2 | 4 | 8 | 16 | 32 " << endl; + cout << "------------|--------|--------|--------|--------|--------|-------" << endl; + for (int k = 1; k < 10; ++k) { + cout << "Nrhs = " << Nrhs*k; for (size_t N : {1, 2, 4, 8, 16, 32}) { tic(); for (size_t i = 0; i < NLOOPS; ++i) { - benchmark_lapacke(N, static_cast(pow(2,exp))); + benchmark_lapacke(N, Nrhs*k); } - double sec = toc(); + double sec = toc()*1000 / (static_cast(Nrhs)*k); cout << " | " << sec; } cout << endl; } - printf("\nFor fixed n, the solution time per rhs does not slow down consistently and scales very well.\nIts faster than expected."); + printf("\nFor fixed n, the solution time per rhs stays roughly constant."); } int main() { - task_1(); - task_2(); - task_3(); - task_4(); - task_5(); - task_6(); + // task_1(); + // task_2(); + // task_3(); + // task_4(); + // task_5(); + // task_6(); task_7(); printf("\n\n"); diff --git a/ex3/code/task_3.cpp b/ex3/code/task_3.cpp index 57c5561..bf69079 100644 --- a/ex3/code/task_3.cpp +++ b/ex3/code/task_3.cpp @@ -1,7 +1,7 @@ #include "task_3.h" -#include #include #include +#include using namespace std; diff --git a/ex3/code/task_4+6.cpp b/ex3/code/task_4+6.cpp index 51359f9..90a89af 100644 --- a/ex3/code/task_4+6.cpp +++ b/ex3/code/task_4+6.cpp @@ -2,8 +2,8 @@ #include "task_4+6.h" #include "timing.h" #include // cBLAS Library -#include #include +#include using namespace std; void print_performance(double sec, size_t memory, size_t flops, unsigned int size) { diff --git a/ex3/code/task_5.cpp b/ex3/code/task_5.cpp index 7c1812f..b8431b1 100644 --- a/ex3/code/task_5.cpp +++ b/ex3/code/task_5.cpp @@ -1,9 +1,9 @@ #include "task_4+6.h" #include "task_5.h" #include "timing.h" -#include -#include #include +#include +#include using namespace std; double norm(vector const &x) { diff --git a/ex3/code/task_7.cpp b/ex3/code/task_7.cpp index 86b523d..24e99bf 100644 --- a/ex3/code/task_7.cpp +++ b/ex3/code/task_7.cpp @@ -1,8 +1,8 @@ #include "task_7.h" +#include +#include #include #include -#include -#include using namespace std; tuple, vector> init_M(size_t N, size_t Nrhs) { diff --git a/ex3/ex3_results.txt b/ex3/ex3_results.txt index bf4f26c..1eef17a 100644 --- a/ex3/ex3_results.txt +++ b/ex3/ex3_results.txt @@ -183,20 +183,20 @@ A * x = 0.000000 1.000000 -N = | 1 | 2 | 4 | 8 | 16 | 32 ----------|--------|--------|--------|--------|--------|------- -Nrhs = 2 | 0.0047 | 0.0045 | 0.0046 | 0.0130 | 0.0203 | 0.0476 -Nrhs = 4 | 0.0027 | 0.0031 | 0.0033 | 0.0046 | 0.0085 | 0.0250 -Nrhs = 8 | 0.0035 | 0.0035 | 0.0045 | 0.0061 | 0.0119 | 0.0300 -Nrhs = 16 | 0.0085 | 0.0062 | 0.0221 | 0.0113 | 0.0599 | 0.0757 -Nrhs = 32 | 0.0122 | 0.0165 | 0.0112 | 0.0123 | 0.0238 | 0.0834 -Nrhs = 64 | 0.0072 | 0.0078 | 0.0164 | 0.0133 | 0.0421 | 0.0666 -Nrhs = 128 | 0.0073 | 0.0189 | 0.0269 | 0.0199 | 0.0337 | 0.1041 -Nrhs = 256 | 0.0107 | 0.0135 | 0.0279 | 0.0351 | 0.0582 | 0.1438 -Nrhs = 512 | 0.0276 | 0.0174 | 0.0237 | 0.1027 | 0.1113 | 0.2417 +Solution time per right hand side in milliseconds: sec*1000/Nrhs +N = | 1 | 2 | 4 | 8 | 16 | 32 +------------|--------|--------|--------|--------|--------|------- +Nrhs = 2000 | 0.2122 | 0.0048 | 0.0079 | 0.0544 | 0.0850 | 0.1523 +Nrhs = 4000 | 0.0036 | 0.0053 | 0.0085 | 0.0142 | 0.0748 | 0.1596 +Nrhs = 6000 | 0.0033 | 0.0043 | 0.0069 | 0.0147 | 0.0327 | 0.1801 +Nrhs = 8000 | 0.0036 | 0.0041 | 0.0069 | 0.0197 | 0.0342 | 0.1795 +Nrhs = 10000 | 0.0028 | 0.0042 | 0.0067 | 0.0140 | 0.0328 | 0.1883 +Nrhs = 12000 | 0.0025 | 0.0044 | 0.0067 | 0.0157 | 0.0320 | 0.1981 +Nrhs = 14000 | 0.0023 | 0.0038 | 0.0065 | 0.0157 | 0.0333 | 0.1916 +Nrhs = 16000 | 0.0022 | 0.0036 | 0.0073 | 0.0140 | 0.0324 | 0.1824 +Nrhs = 18000 | 0.0028 | 0.0038 | 0.0066 | 0.0145 | 0.0337 | 0.1741 -For fixed n, the solution time per rhs does not slow down consistently and scales very well. -Its faster than expected. +For fixed n, the solution time per rhs stays roughly constant. -------------- Task 8 -------------- diff --git a/ex3/seq/skalar/compile.log b/ex3/seq/skalar/compile.log deleted file mode 100644 index 8b13789..0000000 --- a/ex3/seq/skalar/compile.log +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ex3/seq/skalar_stl/compile.log b/ex3/seq/skalar_stl/compile.log deleted file mode 100644 index 8b13789..0000000 --- a/ex3/seq/skalar_stl/compile.log +++ /dev/null @@ -1 +0,0 @@ -