diff options
-rw-r--r-- | flake.nix | 5 | ||||
-rw-r--r-- | readme | 3 | ||||
-rwxr-xr-x | src/2/main | bin | 34312 -> 0 bytes | |||
-rw-r--r-- | src/2/main.c | 22 |
4 files changed, 7 insertions, 23 deletions
@@ -10,13 +10,12 @@ | |||
10 | , nixpkgs | 10 | , nixpkgs |
11 | }: | 11 | }: |
12 | let | 12 | let |
13 | allPrograms = [ 1 2 ]; | ||
13 | supportedSystems = [ "x86_64-linux" ]; | 14 | supportedSystems = [ "x86_64-linux" ]; |
14 | forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); | 15 | forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); |
15 | |||
16 | nixpkgsFor = forAllSystems (system: | 16 | nixpkgsFor = forAllSystems (system: |
17 | import nixpkgs { inherit system; } | 17 | import nixpkgs { inherit system; } |
18 | ); | 18 | ); |
19 | |||
20 | in | 19 | in |
21 | { | 20 | { |
22 | devShell = forAllSystems | 21 | devShell = forAllSystems |
@@ -33,7 +32,7 @@ | |||
33 | (system: | 32 | (system: |
34 | let | 33 | let |
35 | pkgs = nixpkgsFor."${system}"; | 34 | pkgs = nixpkgsFor."${system}"; |
36 | execs = with builtins; map toString [ 1 2 ]; | 35 | execs = with builtins; map toString allPrograms; |
37 | mkApp = name: with pkgs; stdenv.mkDerivation { | 36 | mkApp = name: with pkgs; stdenv.mkDerivation { |
38 | name = "${name}"; | 37 | name = "${name}"; |
39 | src = ./src; | 38 | src = ./src; |
@@ -0,0 +1,3 @@ | |||
1 | run experiment N with: | ||
2 | |||
3 | nix run .#N | ||
diff --git a/src/2/main b/src/2/main deleted file mode 100755 index b999f77..0000000 --- a/src/2/main +++ /dev/null | |||
Binary files differ | |||
diff --git a/src/2/main.c b/src/2/main.c index ee7f2c8..58295a5 100644 --- a/src/2/main.c +++ b/src/2/main.c | |||
@@ -31,8 +31,7 @@ int main() { | |||
31 | 31 | ||
32 | printf("L: %d, M: %d, N: %d\n", l, m, n); | 32 | printf("L: %d, M: %d, N: %d\n", l, m, n); |
33 | 33 | ||
34 | // input for A | 34 | // populate A |
35 | // printf("Enter A:\n"); | ||
36 | for(int i = 0; i < l; i++) { | 35 | for(int i = 0; i < l; i++) { |
37 | for(int j = 0; j < m; j++) { | 36 | for(int j = 0; j < m; j++) { |
38 | // _ = scanf("%d", &a[i][j]); | 37 | // _ = scanf("%d", &a[i][j]); |
@@ -40,8 +39,7 @@ int main() { | |||
40 | } | 39 | } |
41 | } | 40 | } |
42 | 41 | ||
43 | // input for B | 42 | // populate B |
44 | // printf("Enter B:\n"); | ||
45 | for(int i = 0; i < m; i++) { | 43 | for(int i = 0; i < m; i++) { |
46 | for(int j = 0; j < n; j++) { | 44 | for(int j = 0; j < n; j++) { |
47 | // _ = scanf("%d", &b[i][j]); | 45 | // _ = scanf("%d", &b[i][j]); |
@@ -49,22 +47,6 @@ int main() { | |||
49 | } | 47 | } |
50 | } | 48 | } |
51 | 49 | ||
52 | // printf("\nA: \n"); | ||
53 | for(int i = 0; i < l; i++) { | ||
54 | for(int j = 0; j < m; j++) { | ||
55 | // printf("%d\t", a[i][j]); | ||
56 | } | ||
57 | // printf("\n"); | ||
58 | } | ||
59 | |||
60 | // printf("\nB: \n"); | ||
61 | for(int i = 0; i < m; i++) { | ||
62 | for(int j = 0; j < n; j++) { | ||
63 | // printf("%d\t", b[i][j]); | ||
64 | } | ||
65 | // printf("\n"); | ||
66 | } | ||
67 | |||
68 | double start_time = omp_get_wtime(); | 50 | double start_time = omp_get_wtime(); |
69 | int i, j, k; | 51 | int i, j, k; |
70 | #pragma omp parallel for private(j, k) num_threads(1) | 52 | #pragma omp parallel for private(j, k) num_threads(1) |