Updated benchmark definitions (.in)

This commit is contained in:
Marco De Lucia 2024-04-10 22:54:16 +02:00
parent 1e17594389
commit 268312346e

View File

@ -3,6 +3,7 @@
#include <string>
#include <vector>
#include <iostream>
struct init_boundary {
const std::vector<int> north_const;
@ -30,6 +31,27 @@ struct bench_input {
const int iterations;
};
static const std::vector<int> gen_vec(int elems) {
std::vector<int> vec(elems);
for (int i = 0; i < elems; i++) {
vec[i] = i;
}
return vec;
}
static const std::vector<int> gen_vec_rev(int from, int to) {
int size = to - from+1;
std::vector<int> vec(size);
for (int i = from; i < to; i++) {
vec[i] = i;
std::cout << "i: " << i << "\n";
}
return vec;
}
static bench_input barite_200_input = {
.csv_file_init = "@BARITE_200_BENCH@/barite_200_init.csv",
.csv_alpha_x = "@BARITE_200_BENCH@/alpha_x.csv",
@ -48,57 +70,84 @@ static bench_input barite_200_input = {
.iterations = 50
};
// static bench_input barite_large_input = {
// .csv_file_init = "@BARITE_LARGE_BENCH@/barite_large.csv",
// .csv_alpha_x = "@BARITE_LARGE_BENCH@/alpha_x.csv",
// .csv_alpha_y = "@BARITE_LARGE_BENCH@/alpha_y.csv",
// .ncols = 2000,
// .nrows = 1000,
// .s_x = 20,
// .s_y = 10,
// .boundary = {.north_const = {},
// .south_const = {},
// .east_const = {},
// .west_const = {},
// .values = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
// .timestep = 50,
// .iterations = 10
// };
static bench_input barite_large_input = {
.csv_file_init = "@BARITE_LARGE_BENCH@/barite_large_init.csv",
.csv_alpha_x = "@BARITE_LARGE_BENCH@/barite_large_alpha.csv",
.csv_alpha_y = "@BARITE_LARGE_BENCH@/barite_large_alpha.csv",
.ncols = 1000,
.nrows = 1000,
.s_x = 10,
.s_y = 10,
.boundary = {.north_const = {},
.south_const = {},
.east_const = {},
.west_const = {},
.values = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}},
.timestep = 100,
.iterations = 5
};
// static const std::vector<int> gen_vec(int elems) {
// std::vector<int> vec(elems);
// for (int i = 0; i < elems; i++) {
// vec[i] = i;
// }
// return vec;
// }
// static bench_input surfex_input = {
// .csv_file_init = "@SURFEX_BENCH@/surfex.csv",
// .csv_alpha_x = "@SURFEX_BENCH@/alpha_x.csv",
// .csv_alpha_y = "@SURFEX_BENCH@/alpha_y.csv",
// .ncols = 1000,
// .nrows = 1000,
// .s_x = 100,
// .s_y = 100,
// .boundary = {.north_const = gen_vec(500),
// .south_const = {},
// .east_const = {},
// .west_const = {},
// .values = {0.147659686316291, 0.0739242798146046,
// 7.46361643222701e-20, 2.92438561098248e-21,
// 2.65160558871092e-06, 2.89001071336443e-05,
// 0.000429291158114428, 1.90823391198114e-07,
// 3.10832423034763e-12, 2.7888235127385e-15,
// 2.5301787e-06, 2.31391999937907e-05,
// 0.00036746969, 1.01376078438546e-14,
// 1.42247026981542e-19, 9.49422092568557e-18,
// 2.19812504654191e-05, 6.01218519999999e-07,
// 4.82255946569383e-12, 5.49050615347901e-13,
// 1.32462838991902e-09}},
// .timestep = 200,
// .iterations = 10
// };
static bench_input surfex_input = {
.csv_file_init = "@SURFEX_BENCH@/surfex_init.csv",
.csv_alpha_x = "@SURFEX_BENCH@/surfex_alpha.csv",
.csv_alpha_y = "@SURFEX_BENCH@/surfex_alpha.csv",
.ncols = 200,
.nrows = 100,
.s_x = 0.02,
.s_y = 0.01,
.boundary = {.north_const = gen_vec(200),
.south_const = gen_vec(200),
.east_const = gen_vec(100),
.west_const = gen_vec(100),
.values = {120.0, // H
55.1, // O
8.0e-17, // Charge
2.0e-15, // CH4
0.2, // C
0.03, // Ca
0.5, // Cl
0.0002, // Fe2
2.0e-08, // Fe3
2.0e-11, // H0
1.0e-05, // K
0.2, // Mg
0.3, // Na
0, // HS2
8.3e-12, // S2
5.1e-14, // S4
0.026, // S6
0.045, // Sr
2.5e-08, // U4
1.6e-10, // U5
1.0e-05}}, // U6
.timestep = 3600,
.iterations = 20
};
#endif // _BENCH_DEFS_HPP