From 80d1e8b6508b741f03b4d8d29cefd105f436b770 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Wed, 17 Jun 2015 16:27:49 +0100 Subject: [PATCH] Added script to plot tasks as a function of wallclock time. --- examples/plot.py | 2 +- examples/test_bh_new.c | 11 +++++++---- examples/test_fmm.c | 17 ++++++++++------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/examples/plot.py b/examples/plot.py index 008ed26..c2cf935 100644 --- a/examples/plot.py +++ b/examples/plot.py @@ -127,7 +127,7 @@ plot(id, errx_new , 'b.') text(id[-1], 0.18, "B-H: $%5.3f\\pm%5.3f$\n QuickShed: $%5.3f\\pm%5.3f$"%(meanx_bh, stdx_bh, meanx_new, stdx_new), backgroundcolor="w", va="top", ha="right" ) -ylim(-0.02, 0.02) +ylim(-2, 2) xlim(0,id[-1]) grid() diff --git a/examples/test_bh_new.c b/examples/test_bh_new.c index 7bce23e..8748fe1 100644 --- a/examples/test_bh_new.c +++ b/examples/test_bh_new.c @@ -38,7 +38,7 @@ /* Some local constants. */ #define cell_pool_grow 1000 #define cell_maxparts 128 -#define task_limit 1e8 +#define task_limit 1e7 #define const_G 1 // 6.6738e-8 #define dist_min 0.5 /* Used for legacy walk only */ #define dist_cutoff_ratio 1.5 @@ -1498,9 +1498,12 @@ void test_bh(int N, int nr_threads, int runs, char *fileName) { #endif /* Dump the tasks. */ - /* for ( k = 0 ; k < s.count ; k++ ) */ - /* printf( " %i %i %lli %lli\n" , s.tasks[k].type , s.tasks[k].qid , */ - /* s.tasks[k].tic , s.tasks[k].toc ); */ + FILE* taskFile = fopen("output_bh_new.out", "w"); + for ( k = 0 ; k < s.count ; k++ ) + fprintf(taskFile, " %i %i %lli %lli\n" , s.tasks[k].type , s.tasks[k].qid , + s.tasks[k].tic , s.tasks[k].toc ); + fclose(taskFile); + /* Dump the costs. */ message("costs: setup=%lli ticks, run=%lli ticks.", tot_setup, diff --git a/examples/test_fmm.c b/examples/test_fmm.c index 9c5b460..af3df1d 100644 --- a/examples/test_fmm.c +++ b/examples/test_fmm.c @@ -38,7 +38,7 @@ /* Some local constants. */ #define cell_pool_grow 1000 #define cell_maxparts 128 -#define task_limit 1 +#define task_limit 1e8 #define const_G 1 // 6.6738e-8 #define dist_min 0.5 /* Used for legacy walk only */ #define dist_cutoff_ratio 1.5 @@ -1268,7 +1268,7 @@ void test_bh(int N, int nr_threads, int runs, char *fileName) { parts[k].x[0] = ((double)rand()) / RAND_MAX; parts[k].x[1] = ((double)rand()) / RAND_MAX; parts[k].x[2] = ((double)rand()) / RAND_MAX; - parts[k].mass = ((double)rand()) / RAND_MAX; + parts[k].mass = 1.;//((double)rand()) / RAND_MAX; parts[k].a_legacy[0] = 0.0; parts[k].a_legacy[1] = 0.0; parts[k].a_legacy[2] = 0.0; @@ -1338,7 +1338,7 @@ void test_bh(int N, int nr_threads, int runs, char *fileName) { } message("Average number of parts per leaf is %f.", ((double)N) / nr_leaves); -#if ICHECK > 0 +#if 0 //ICHECK > 0 printf("----------------------------------------------------------\n"); /* Do a N^2 interactions calculation */ @@ -1431,6 +1431,7 @@ void test_bh(int N, int nr_threads, int runs, char *fileName) { tic = getticks(); qsched_run(&s, nr_threads, runner); #ifndef DOWN_AS_TASK + // message("comp down"); comp_down(root); #endif toc_run = getticks(); @@ -1484,9 +1485,11 @@ void test_bh(int N, int nr_threads, int runs, char *fileName) { #endif /* Dump the tasks. */ - /* for ( k = 0 ; k < s.count ; k++ ) - printf( " %i %i %lli %lli\n" , s.tasks[k].type , s.tasks[k].qid , - s.tasks[k].tic , s.tasks[k].toc ); */ + FILE* taskFile = fopen("output_fmm.out", "w"); + for ( k = 0 ; k < s.count ; k++ ) + fprintf( taskFile, " %i %i %lli %lli\n" , s.tasks[k].type , s.tasks[k].qid , + s.tasks[k].tic , s.tasks[k].toc ); + fclose(taskFile); /* Dump the costs. */ message("costs: setup=%lli ticks, run=%lli ticks.", tot_setup, @@ -1531,7 +1534,7 @@ int main(int argc, char *argv[]) { char fileName[100] = {0}; /* Die on FP-exceptions. */ - feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); + //feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); /* Get the number of threads. */ #pragma omp parallel shared(nr_threads) -- GitLab