summaryrefslogtreecommitdiff
path: root/mg2d_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'mg2d_test.c')
-rw-r--r--mg2d_test.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/mg2d_test.c b/mg2d_test.c
index 7f6654d..512f747 100644
--- a/mg2d_test.c
+++ b/mg2d_test.c
@@ -10,8 +10,8 @@
#define ARRAY_ELEMS(x) (sizeof(x) / sizeof(*x))
-#define MAXITER (1 << 18)
-#define TOL 1e-2
+#define MAXITER (1 << 15)
+#define TOL 1e-9
#define DOMAIN_SIZE 1.0
@@ -93,6 +93,8 @@ int main(int argc, char **argv)
long int gridsize;
int ret = 0;
+ const char *omp_threads = getenv("OMP_NUM_THREADS");
+
if (argc < 2) {
fprintf(stderr, "Usage: %s <N>\n", argv[0]);
return 1;
@@ -119,9 +121,13 @@ int main(int argc, char **argv)
ctx->nb_cycles = 1;
ctx->nb_relax_post = 2;
ctx->tol = TOL;
- ctx->nb_threads = 1;
- ctx->log_level = MG2D_LOG_INFO;
- ctx->max_levels = 1;
+ ctx->log_level = MG2D_LOG_VERBOSE;
+ //ctx->max_levels = 4;
+ ctx->max_exact_size = 33;
+ if (omp_threads)
+ ctx->nb_threads = strtol(omp_threads, NULL, 0);
+ if (ctx->nb_threads <= 0)
+ ctx->nb_threads = 1;
for (int bnd_loc = 0; bnd_loc < ARRAY_ELEMS(ctx->boundaries); bnd_loc++) {
MG2DBoundary *bnd = ctx->boundaries[bnd_loc];
@@ -173,7 +179,6 @@ int main(int argc, char **argv)
goto fail;
}
- ctx->log_level = MG2D_LOG_VERBOSE;
mg2d_print_stats(ctx, NULL);
{