Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cleanup XML jungle in teshsuite
[simgrid.git] / teshsuite / msg / task_destroy_cancel / task_destroy_cancel.c
index 04cecd0..a2cdc76 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2014. The SimGrid Team.
+/* Copyright (c) 2010-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -94,7 +94,7 @@ static int worker_main(int argc, char *argv[])
 int slave(int argc, char *argv[])
 {
   msg_task_t task;
-  _XBT_GNUC_UNUSED int res;
+  XBT_ATTRIB_UNUSED int res;
   int id = -1;
   char mailbox[80];
   double start, end;
@@ -124,9 +124,9 @@ int slave(int argc, char *argv[])
     MSG_task_execute(task);
     end = MSG_get_clock();
     XBT_INFO("Task \"%s\" done in %f (amount %f)"
-               , MSG_task_get_name(task)
-               , end - start
-               , MSG_task_get_remaining_computation(task));
+        , MSG_task_get_name(task)
+        , end - start
+        , MSG_task_get_flops_amount(task));
 
     MSG_task_destroy(task);
     task = NULL;
@@ -144,15 +144,12 @@ int main(int argc, char *argv[])
   const char *application_file;
 
   MSG_init(&argc, argv);
-  if (argc != 3) {
-    printf("Usage: %s platform_file deployment_file\n", argv[0]);
-    printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
-    exit(1);
-  }
+  xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
+       "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+  
   platform_file = argv[1];
   application_file = argv[2];
 
-  /* MSG_config("workstation/model","KCCFLN05"); */
   {                             /*  Simulation setting */
     MSG_create_environment(platform_file);
   }
@@ -166,8 +163,5 @@ int main(int argc, char *argv[])
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
 
-  if (res == MSG_OK)
-    return 0;
-  else
-    return 1;
+  return res != MSG_OK;
 }                               /* end_of_main */