X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/276b2d9b83a3e3afcd449fb53a2dd8d662070036..53f94d305342966b29fe32f1d397071a22c16417:/testsuite/xbt/parmap_bench.c diff --git a/testsuite/xbt/parmap_bench.c b/testsuite/xbt/parmap_bench.c index 112fbae788..e6558bc986 100644 --- a/testsuite/xbt/parmap_bench.c +++ b/testsuite/xbt/parmap_bench.c @@ -1,9 +1,16 @@ +/* Copyright (c) 2012-2014. 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. */ + #include #include #include #include #include -#include /* HAVE_FUTEX_H */ +#include /* HAVE_FUTEX_H */ +#include "simgrid/simix.h" #include "xbt/xbt_os_time.h" #define MODES_DEFAULT 0x7 @@ -30,7 +37,7 @@ static const char *parmap_mode_name(e_xbt_parmap_mode_t mode) snprintf(name, sizeof name, "DEFAULT"); break; default: - snprintf(name, sizeof name, "UNKNOWN(%d)", mode); + snprintf(name, sizeof name, "UNKNOWN(%d)", (int)mode); break; } return name; @@ -166,6 +173,8 @@ int main(int argc, char *argv[]) int nthreads; unsigned modes = MODES_DEFAULT; + SIMIX_global_init(&argc, argv); + if (argc != 2 && argc != 3) { fprintf(stderr, "Usage: %s nthreads [modes]\n" @@ -180,7 +189,7 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } if (argc == 3) - modes = atoi(argv[2]); + modes = strtol(argv[2], NULL, 0); printf("Parmap benchmark with %d workers (modes = %#x)...\n\n", nthreads, modes);