-/* Copyright (c) 2009-2010, 2012-2013. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012-2015. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include <stdio.h>
#include <stdlib.h>
-#include "msg/msg.h"
+#include "simgrid/msg.h"
#include "xbt/log.h"
#include "xbt/asserts.h"
double task_comp_size = 2800;
double task_prio = 1.0;
- if (argc != 3) {
- printf
- ("Wrong number of arguments!\nUsage:\n\t1) task computational size in FLOPS\n\t2 task priority\n");
- exit(1);
- }
+ xbt_assert (argc == 3,"Wrong number of arguments!\nUsage: %s <task computational size in FLOPS> <task priority>", argv[0]);
- task_comp_size = atof(argv[1]);
- task_prio = atof(argv[2]);
+ task_comp_size = xbt_str_parse_double(argv[1],"Invalid computational size: %s");
+ task_prio = xbt_str_parse_double(argv[2], "Invalid task priority: %s");
XBT_INFO("Testing the trace integration cpu model: CpuTI");
XBT_INFO("Task size: %f", task_comp_size);
XBT_INFO("Test finished");
-
return 0;
}
/* Verify if the platform xml file was passed by command line. */
MSG_init(&argc, argv);
- if (argc < 2) {
- printf("Usage: %s test_trace_integration_model.xml\n", argv[0]);
- exit(1);
- }
+ xbt_assert(argc > 2, "Usage: %s test_trace_integration_model.xml deployment.xml\n", argv[0]);
/* Register SimGrid process function. */
MSG_function_register("test_trace", test_trace);
/* Run the example. */
res = MSG_main();
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ return res != MSG_OK;
}