X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9932a0c0d2c44e34633c97a827b2b04d615cb4e9..347996b4a10c4e8579080692afa60e0afb88b60a:/teshsuite/simdag/availability/availability_test.c diff --git a/teshsuite/simdag/availability/availability_test.c b/teshsuite/simdag/availability/availability_test.c index 9389625db9..a0f3c73c3a 100644 --- a/teshsuite/simdag/availability/availability_test.c +++ b/teshsuite/simdag/availability/availability_test.c @@ -1,66 +1,18 @@ -/* Copyright (c) 2013-2014. The SimGrid Team. +/* Copyright (c) 2013-2015. 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 #include -#include -#include - -typedef struct { - FILE *daxFile; - FILE *envFile; -} XMLfiles; - - -static void usage(char *name) -{ - fprintf(stdout, "Error on parameters.\n"); - fprintf(stdout, "usage: %s \n", name); -} - -static void checkParameters(int argc, char *argv[]) -{ - if (argc != 3) { - int i; - printf("====%d===\n",argc); - for(i=0; i 2, "Usage: %s platform_file dax_file\n" + "\tExample: %s simulacrum_7_hosts.xml Montage_25.xml", argv[0], argv[0]); - /* Check parameters */ - checkParameters(*argc,argv); - - /* Create environment */ SD_create_environment(argv[1]); - /* Load DAX file */ xbt_dynar_t dax = SD_daxload(argv[2]); - // createDottyFile(dax, argv[2]); - - // Schedule DAX - fprintf(stdout, "Scheduling DAX...\n"); + XBT_INFO("Scheduling DAX..."); scheduleDAX(dax); - fprintf(stdout, "DAX scheduled\n"); - xbt_dynar_t ret = SD_simulate(-1); - xbt_dynar_free(&ret); - fprintf(stdout, "Simulation end. Time: %f\n", SD_get_clock()); + XBT_INFO("DAX scheduled"); + SD_simulate(-1); + XBT_INFO("Simulation done."); - return dax; -} - -/** - * Garbage collector :D - */ -static void garbageCollector(xbt_dynar_t dax) -{ + // Free memory while (!xbt_dynar_is_empty(dax)) { SD_task_t task = xbt_dynar_pop_as(dax, SD_task_t); SD_task_destroy(task); } xbt_dynar_free(&dax); SD_exit(); -} - - - -/** - * Main procedure - * @param argc - * @param argv - * @return - */ -int main(int argc, char *argv[]) -{ - - /* Start process... */ - xbt_dynar_t dax = initDynamicThrottling(&argc, argv); - - // Free memory - garbageCollector(dax); return 0; }