X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4de869aa8bcf5a24acf31227f46f577e4bdb1479..d19029c26682d4c5ae520a8ee7bb34a7b18e5471:/examples/gras/chrono/chrono2.c diff --git a/examples/gras/chrono/chrono2.c b/examples/gras/chrono/chrono2.c index 147fb4e041..a64936acb2 100644 --- a/examples/gras/chrono/chrono2.c +++ b/examples/gras/chrono/chrono2.c @@ -1,8 +1,7 @@ -/* $Id$ */ - /* chrono - demo of GRAS benchmarking features */ -/* Copyright (c) 2005 Martin Quinson, Arnaud Legrand. All rights reserved. */ +/* Copyright (c) 2005, 2010. The SimGrid Team. + * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -10,64 +9,64 @@ #include "gras.h" #include "xbt/log.h" -XBT_LOG_NEW_DEFAULT_CATEGORY(Chrono,"Messages specific to this example"); +XBT_LOG_NEW_DEFAULT_CATEGORY(Chrono, "Messages specific to this example"); #include void cblas_dgemm(const enum CBLAS_ORDER Order, - const enum CBLAS_TRANSPOSE TransA, - const enum CBLAS_TRANSPOSE TransB, const int M, - const int N, const int K, const double alpha, - const double *A, const int lda, const double *B, - const int ldb, const double beta, double *C, - const int ldc); + const enum CBLAS_TRANSPOSE TransA, + const enum CBLAS_TRANSPOSE TransB, const int M, + const int N, const int K, const double alpha, + const double *A, const int lda, const double *B, + const int ldb, const double beta, double *C, + const int ldc); /* Function prototypes */ static int mat_mult(int n) { - int i,j,k,l; - double *A,*B,*C; + int i, j, k, l; + double *A, *B, *C; double start = 0.0; double now = 0.0; - A = malloc(n*n*sizeof(double)); - B = malloc(n*n*sizeof(double)); - C = malloc(n*n*sizeof(double)); + A = malloc(n * n * sizeof(double)); + B = malloc(n * n * sizeof(double)); + C = malloc(n * n * sizeof(double)); - start=now=gras_os_time(); + start = now = gras_os_time(); - INFO1("Matrix size: %d",n); -/* INFO1("Before computation: %lg", start); */ + XBT_INFO("Matrix size: %d", n); +/* XBT_INFO("Before computation: %lg", start); */ - for(l=0; l<40; l++) { - now=gras_os_time(); + for (l = 0; l < 40; l++) { + now = gras_os_time(); GRAS_BENCH_ONCE_RUN_ONCE_BEGIN(); - for(i=0; i