X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a3848e5ea6b2305d6059c89705edaccbec356455..244700130bf34687c5212bc1c6cbc7fc3c8ba281:/src/simdag/sd_daxloader.c diff --git a/src/simdag/sd_daxloader.c b/src/simdag/sd_daxloader.c index 1ef9172bc2..e48ca55e51 100644 --- a/src/simdag/sd_daxloader.c +++ b/src/simdag/sd_daxloader.c @@ -1,14 +1,13 @@ -/* Copyright (c) 2009, 2010. The SimGrid Team. +/* Copyright (c) 2009-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 "private.h" -#include "simdag/simdag.h" +#include "simgrid/simdag.h" #include "xbt/misc.h" #include "xbt/log.h" -#include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_daxparse, sd, "Parsing DAX files"); @@ -275,10 +274,9 @@ xbt_dynar_t SD_daxload(const char *filename) xbt_dynar_push(result, &root_task); end_task = SD_task_create_comp_seq("end", NULL, 0); - _XBT_GNUC_UNUSED int res; - res = dax_lex(); - xbt_assert(!res, "Parse error in %s: %s", filename, - dax__parse_err_msg()); + int res = dax_lex(); + if (res != 0) + xbt_die("Parse error in %s: %s", filename, dax__parse_err_msg()); dax__delete_buffer(input_buffer); fclose(in_file); dax_lex_destroy(); @@ -299,7 +297,6 @@ xbt_dynar_t SD_daxload(const char *filename) newfile = SD_task_create_comm_e2e(file->name, NULL, file->amount); SD_task_dependency_add(NULL, NULL, root_task, newfile); SD_task_dependency_add(NULL, NULL, newfile, depafter->dst); -#ifdef HAVE_TRACING if (depafter->src){ const char *category = depafter->src->category; if (category){ @@ -307,7 +304,6 @@ xbt_dynar_t SD_daxload(const char *filename) TRACE_sd_set_task_category(newfile, category); } } -#endif xbt_dynar_push(result, &newfile); } } else if (xbt_dynar_is_empty(file->tasks_after)) { @@ -315,7 +311,6 @@ xbt_dynar_t SD_daxload(const char *filename) newfile = SD_task_create_comm_e2e(file->name, NULL, file->amount); SD_task_dependency_add(NULL, NULL, depbefore->src, newfile); SD_task_dependency_add(NULL, NULL, newfile, end_task); -#ifdef HAVE_TRACING if (depbefore->src){ const char *category = depbefore->src->category; if (category){ @@ -323,7 +318,6 @@ xbt_dynar_t SD_daxload(const char *filename) TRACE_sd_set_task_category(newfile, category); } } -#endif xbt_dynar_push(result, &newfile); } } else { @@ -337,7 +331,6 @@ xbt_dynar_t SD_daxload(const char *filename) newfile = SD_task_create_comm_e2e(file->name, NULL, file->amount); SD_task_dependency_add(NULL, NULL, depbefore->src, newfile); SD_task_dependency_add(NULL, NULL, newfile, depafter->dst); -#ifdef HAVE_TRACING if (depbefore->src){ const char *category = depbefore->src->category; if (category){ @@ -345,7 +338,6 @@ xbt_dynar_t SD_daxload(const char *filename) TRACE_sd_set_task_category(newfile, category); } } -#endif xbt_dynar_push(result, &newfile); } } @@ -375,8 +367,7 @@ xbt_dynar_t SD_daxload(const char *filename) } if (!acyclic_graph_detail(result)){ - XBT_ERROR("The DAX described in %s is not a DAG. It contains a cycle.", - basename((char*)filename)); + XBT_ERROR("The DAX described in %s is not a DAG. It contains a cycle.", filename); xbt_dynar_foreach(result, cpt, file) SD_task_destroy(file); xbt_dynar_free_container(&result); @@ -403,13 +394,11 @@ void STag_dax__job(void) runtime *= 4200000000.; /* Assume that timings were done on a 4.2GFlops machine. I mean, why not? */ // XBT_INFO("See ",A_dax__job_id,A_dax__job_runtime,runtime); current_job = SD_task_create_comp_seq(name, NULL, runtime); -#ifdef HAVE_TRACING char *category = A_dax__job_name; if (category){ TRACE_category (category); TRACE_sd_set_task_category(current_job, category); } -#endif xbt_dict_set(jobs, A_dax__job_id, current_job, NULL); free(name); xbt_dynar_push(result, ¤t_job);