X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/61661270913163ed28fbcbbabc902cf7f44fb2d8..b777cd7570d38c138ba99fc044fe55dc9a44b3aa:/examples/gras/chrono/chrono.c?ds=sidebyside diff --git a/examples/gras/chrono/chrono.c b/examples/gras/chrono/chrono.c index 48a77a149a..74c3c341e9 100644 --- a/examples/gras/chrono/chrono.c +++ b/examples/gras/chrono/chrono.c @@ -24,7 +24,7 @@ int multiplier (int argc,char *argv[]) double start = 0.0; double now = 0.0; - gras_init(&argc, argv, NULL); + gras_init(&argc, argv); A = malloc(n*n*sizeof(double)); B = malloc(n*n*sizeof(double)); @@ -32,7 +32,7 @@ int multiplier (int argc,char *argv[]) start=now=gras_os_time(); - INFO1("Before computation: %lg", start); + INFO1("Begin matrix multiplication loop (time: %lg)", start); for(l=0; l<4; l++) { now=gras_os_time(); @@ -55,7 +55,27 @@ int multiplier (int argc,char *argv[]) } now=gras_os_time()-start; - INFO2("After computation: %lg; Duration: %lg ", gras_os_time(), now); + INFO2("End matrix multiplication loop (time: %lg; Duration: %lg)", gras_os_time(), now); + + start=now=gras_os_time(); + INFO1("Begin malloc loop (time: %lg)", start); + for(l=0; l<4; l++) { + now=gras_os_time(); + GRAS_BENCH_ONCE_RUN_ONCE_BEGIN(); + free(A); + A = malloc(n*n*sizeof(double)); + GRAS_BENCH_ONCE_RUN_ONCE_END(); + now=gras_os_time()-now; + INFO2("Iteration %d : %lg ", l, now); + } + + start=now=gras_os_time(); + INFO1("Begin integer incrementation loop (time: %lg)", start); + for(l=0; l<4; l++) { + GRAS_BENCH_ONCE_RUN_ONCE_BEGIN(); + j++; + GRAS_BENCH_ONCE_RUN_ONCE_END(); + } return 0; }