3 /* chrono - demo of GRAS benchmarking features */
5 /* Copyright (c) 2005 Martin Quinson, Arnaud Legrand. All rights reserved. */
7 /* This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package. */
13 XBT_LOG_NEW_DEFAULT_CATEGORY(Chrono,"Messages specific to this example");
16 /* Function prototypes */
17 int multiplier (int argc,char *argv[]);
19 int multiplier (int argc,char *argv[])
26 gras_init(&argc, argv, NULL);
28 A = malloc(n*n*sizeof(double));
29 B = malloc(n*n*sizeof(double));
30 C = malloc(n*n*sizeof(double));
32 INFO1("Before computation: %lg", start=gras_os_time());
35 GRAS_BENCH_ONCE_RUN_ONCE_BEGIN();
46 C[i*n+j] += A[i*n+k]*B[k*n+j];
48 GRAS_BENCH_ONCE_RUN_ONCE_END();
51 start = gras_os_time()-start;
52 INFO2("After computation: %lg; Duration: %lg ", gras_os_time(), start);