*/
for (i = 0; i < MATSIZE; i++)
for (j = 0; i < MATSIZE; i++)
- xbt_assert4(xbt_matrix_get_as(answer, i, j, double) ==
+ xbt_assert(xbt_matrix_get_as(answer, i, j, double) ==
xbt_matrix_get_as(request[1], i, j, double),
"Answer does not match expectations. Found %f at cell %d,%d instead of %f",
xbt_matrix_get_as(answer, i, j, double), i, j,
*/
for (i = 0; i < MATSIZE; i++)
for (j = 0; i < MATSIZE; i++)
- xbt_assert4(xbt_matrix_get_as(answer, i, j, double) ==
+ xbt_assert(xbt_matrix_get_as(answer, i, j, double) ==
xbt_matrix_get_as(request[1], i, j, double),
"Answer does not match expectations. Found %f at cell %d,%d instead of %f",
xbt_matrix_get_as(answer, i, j, double), i, j,
C = xbt_matrix_double_new_zeros(DATA_MATRIX_SIZE, DATA_MATRIX_SIZE);
/* Create the connexions */
- xbt_assert0(argc > 1, "Usage: master <port>");
+ xbt_assert(argc > 1, "Usage: master <port>");
gras_socket_server(atoi(argv[1]));
peers = amok_pm_group_new("pmm");
xbt_dynar_get_cpy(peers, i, &grid[i]);
socket[i] = gras_socket_client(grid[i]->name, grid[i]->port);
}
- xbt_assert2(i == SLAVE_COUNT,
+ xbt_assert(i == SLAVE_COUNT,
"Not enough slaves for this setting (got %d of %d). Change the deployment file",
i, SLAVE_COUNT);
XBT_INFO("== Try to get a process property that does not exist");
value = gras_process_property_value("Nonexisting");
- xbt_assert0(!value, "nonexisting property exists!!");
+ xbt_assert(!value, "nonexisting property exists!!");
/* Modify an existing property. First check it exists */
XBT_INFO("== Trying to modify a process property");
value = gras_process_property_value("new prop");
- xbt_assert0(!value, "Property 'new prop' exists before I add it!");
+ xbt_assert(!value, "Property 'new prop' exists before I add it!");
xbt_dict_set(process_props, "new prop", xbt_strdup("new value"),
xbt_free_f);
/* Test if we have changed the value */
value = gras_process_property_value("new prop");
- xbt_assert1(!strcmp(value, "new value"),
+ xbt_assert(!strcmp(value, "new value"),
"New property does have the value I've set ('%s' != 'new value')",
value);
XBT_INFO("== Try to get a property that does not exist");
value = gras_os_host_property_value("non existing key");
- xbt_assert1(value == NULL,
+ xbt_assert(value == NULL,
"The key 'non existing key' exists (with value '%s')!!",
value);
declare_msg();
- xbt_assert0(argc == 3, "usage: replay_master tracefile port");
+ xbt_assert(argc == 3, "usage: replay_master tracefile port");
gras_socket_server(atoi(argv[2])); /* open my master socket, even if I don't use it */
xbt_dynar_t peers = amok_pm_group_new("replay"); /* group of slaves */
xbt_peer_t peer;
{
FILE *file_in;
file_in = fopen(filename, "r");
- xbt_assert1(file_in, "cannot open tracefile '%s'", filename);
+ xbt_assert(file_in, "cannot open tracefile '%s'", filename);
char *str_in = xbt_str_from_file(file_in);
fclose(file_in);
xbt_dynar_t in = xbt_str_split(str_in, "\n");
if (!gotit) {
THROWF(unknown_error, 0, "Didn't got the remote exception!");
}
- xbt_assert2(e.category == unknown_error,
+ xbt_assert(e.category == unknown_error,
"Got wrong category: %d (instead of %d)", e.category,
unknown_error);
- xbt_assert1(e.value == 42, "Got wrong value: %d (!=42)", e.value);
- xbt_assert1(!strncmp(e.msg, exception_msg, strlen(exception_msg)),
+ xbt_assert(e.value == 42, "Got wrong value: %d (!=42)", e.value);
+ xbt_assert(!strncmp(e.msg, exception_msg, strlen(exception_msg)),
"Got wrong message: %s", e.msg);
xbt_ex_free(e);
}
}
CATCH(e) {
gotit = 1;
- xbt_assert2(e.category == unknown_error,
+ xbt_assert(e.category == unknown_error,
"Got wrong category: %d (instead of %d)",
e.category, unknown_error);
- xbt_assert1(e.value == 42, "Got wrong value: %d (!=42)", e.value);
- xbt_assert1(!strncmp(e.msg, exception_msg, strlen(exception_msg)),
+ xbt_assert(e.value == 42, "Got wrong value: %d (!=42)", e.value);
+ xbt_assert(!strncmp(e.msg, exception_msg, strlen(exception_msg)),
"Got wrong message: %s", e.msg);
XBT_INFO
("Got the expected exception when calling the exception raising RPC");
if (!gotit) {
THROWF(unknown_error, 0, "Didn't got the remote exception!");
}
- xbt_assert1(e.value == 42, "Got wrong value: %d (!=42)", e.value);
- xbt_assert1(!strncmp(e.msg, exception_msg, strlen(exception_msg)),
+ xbt_assert(e.value == 42, "Got wrong value: %d (!=42)", e.value);
+ xbt_assert(!strncmp(e.msg, exception_msg, strlen(exception_msg)),
"Got wrong message: %s", e.msg);
- xbt_assert2(e.category == unknown_error,
+ xbt_assert(e.category == unknown_error,
"Got wrong category: %d (instead of %d)",
e.category, unknown_error);
XBT_INFO
}
state[id] = EATING;
- xbt_assert1(state[(id + (philosopher_amount - 1)) % philosopher_amount]
+ xbt_assert(state[(id + (philosopher_amount - 1)) % philosopher_amount]
== THINKING
&& state[(id + 1) % philosopher_amount] == THINKING,
"Philosopher %d eats at the same time that one of its neighbors!!!",
xbt_thread_t *philosophers;
gras_init(&argc, argv);
- xbt_assert0(argc >= 2,
+ xbt_assert(argc >= 2,
"This program expects one argument (the amount of philosophers)");
/* initializations of the philosopher mecanisms */
double clock = MSG_get_clock();
process_globals_t globals = (process_globals_t) MSG_process_get_data(MSG_process_self());
- xbt_assert1(xbt_dynar_length(globals->irecvs),
+ xbt_assert(xbt_dynar_length(globals->irecvs),
"action wait not preceded by any irecv: %s", xbt_str_join_array(action," "));
if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
process_globals_t counters = (process_globals_t) MSG_process_get_data(MSG_process_self());
- xbt_assert0(communicator_size, "Size of Communicator is not defined, "
+ xbt_assert(communicator_size, "Size of Communicator is not defined, "
"can't use collective operations");
process_name = MSG_process_get_name(MSG_process_self());
process_globals_t counters = (process_globals_t) MSG_process_get_data(MSG_process_self());
- xbt_assert0(communicator_size, "Size of Communicator is not defined, "
+ xbt_assert(communicator_size, "Size of Communicator is not defined, "
"can't use collective operations");
process_name = MSG_process_get_name(MSG_process_self());
process_globals_t counters = (process_globals_t) MSG_process_get_data(MSG_process_self());
- xbt_assert0(communicator_size, "Size of Communicator is not defined, "
+ xbt_assert(communicator_size, "Size of Communicator is not defined, "
"can't use collective operations");
process_name = MSG_process_get_name(MSG_process_self());
int read;
read = sscanf(argv[1], "%d", &number_of_tasks);
- xbt_assert1(read, "Invalid argument %s\n", argv[1]);
+ xbt_assert(read, "Invalid argument %s\n", argv[1]);
read = sscanf(argv[2], "%lg", &task_comp_size);
- xbt_assert1(read, "Invalid argument %s\n", argv[2]);
+ xbt_assert(read, "Invalid argument %s\n", argv[2]);
read = sscanf(argv[3], "%lg", &task_comm_size);
- xbt_assert1(read, "Invalid argument %s\n", argv[3]);
+ xbt_assert(read, "Invalid argument %s\n", argv[3]);
{
/* Task creation */
while (1) {
res = MSG_task_receive(&(task), MSG_host_get_name(MSG_host_self()));
- xbt_assert0(res == MSG_OK, "MSG_task_receive failed");
+ xbt_assert(res == MSG_OK, "MSG_task_receive failed");
XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
double next_check_predecessor_date = init_time + periodic_check_predecessor_delay;
double next_lookup_date = init_time + periodic_lookup_delay;
- xbt_assert0(argc == 3 || argc == 5, "Wrong number of arguments for this node");
+ xbt_assert(argc == 3 || argc == 5, "Wrong number of arguments for this node");
// initialize my node
s_node_t node = {0};
/* data size */
int read;
read = sscanf(argv[1], "%lg", &task_comm_size);
- xbt_assert1(read, "Invalid argument %s\n", argv[1]);
+ xbt_assert(read, "Invalid argument %s\n", argv[1]);
/* slave name */
slavename = argv[2];
int read;
read = sscanf(argv[1], "%d", &id);
- xbt_assert1(read,
+ xbt_assert(read,
"Invalid argument %s\n", argv[1]);
MSG_process_sleep(sleep_start_time);
if (sleep_test_time == 0) {
res = MSG_comm_wait(res_irecv, -1);
- xbt_assert0(res == MSG_OK, "MSG_task_get failed");
+ xbt_assert(res == MSG_OK, "MSG_task_get failed");
} else {
while (MSG_comm_test(res_irecv) == 0) {
MSG_process_sleep(sleep_test_time);
msg_comm_t res_irecv;
int read;
read = sscanf(argv[1], "%d", &id);
- xbt_assert1(read, "Invalid argument %s\n", argv[1]);
+ xbt_assert(read, "Invalid argument %s\n", argv[1]);
MSG_process_sleep(10);
sprintf(mailbox, "receiver-%d", id);
while (1) {
res_irecv = MSG_task_irecv(&(task), mailbox);
XBT_INFO("Wait to receive a task");
res = MSG_comm_wait(res_irecv, -1);
- xbt_assert0(res == MSG_OK, "MSG_task_get failed");
+ xbt_assert(res == MSG_OK, "MSG_task_get failed");
XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
if (!strcmp(MSG_task_get_name(task), "finalize")) {
MSG_task_destroy(task);
task = NULL;
res_irecv = MSG_task_irecv(&(task), mailbox);
res_wait = MSG_comm_wait(res_irecv, -1);
- xbt_assert0(res_wait == MSG_OK, "MSG_comm_wait failed");
+ xbt_assert(res_wait == MSG_OK, "MSG_comm_wait failed");
MSG_comm_destroy(res_irecv);
MSG_task_destroy(task);
}
int read;
read = sscanf(argv[1], "%d", &id);
- xbt_assert1(read, "Invalid argument %s\n", argv[1]);
+ xbt_assert(read, "Invalid argument %s\n", argv[1]);
sprintf(mailbox, "receiver-%d", id);
MSG_process_sleep(10);
msg_comm_t res_irecv;
MSG_task_execute(task_com);
XBT_INFO("\"%s\" done", MSG_task_get_name(task_com));
err = MSG_task_destroy(task_com);
- xbt_assert0(err == MSG_OK, "MSG_task_destroy failed");
+ xbt_assert(err == MSG_OK, "MSG_task_destroy failed");
}
xbt_dynar_free(&comms);
xbt_free(task);
int read;
read = sscanf(argv[1], "%d", &number_of_tasks);
- xbt_assert1(read, "Invalid argument %s\n", argv[1]);
+ xbt_assert(read, "Invalid argument %s\n", argv[1]);
read = sscanf(argv[2], "%lg", &task_comp_size);
- xbt_assert1(read, "Invalid argument %s\n", argv[2]);
+ xbt_assert(read, "Invalid argument %s\n", argv[2]);
read = sscanf(argv[3], "%lg", &task_comm_size);
- xbt_assert1(read, "Invalid argument %s\n", argv[3]);
+ xbt_assert(read, "Invalid argument %s\n", argv[3]);
{ /* Task creation */
char sprintf_buffer[64];
int read;
read = sscanf(argv[1], "%d", &number_of_tasks);
- xbt_assert1(read, "Invalid argument %s\n", argv[1]);
+ xbt_assert(read, "Invalid argument %s\n", argv[1]);
read = sscanf(argv[2], "%lg", &task_comp_size);
- xbt_assert1(read, "Invalid argument %s\n", argv[2]);
+ xbt_assert(read, "Invalid argument %s\n", argv[2]);
read = sscanf(argv[3], "%lg", &task_comm_size);
- xbt_assert1(read, "Invalid argument %s\n", argv[3]);
+ xbt_assert(read, "Invalid argument %s\n", argv[3]);
{ /* Task creation */
char sprintf_buffer[64];
int read;
read = sscanf(argv[1], "%d", &id);
- xbt_assert1(read, "Invalid argument %s\n", argv[1]);
+ xbt_assert(read, "Invalid argument %s\n", argv[1]);
sprintf(mailbox, "slave-%d", id);
while (1) {
res = MSG_task_receive(&(task), mailbox);
- xbt_assert0(res == MSG_OK, "MSG_task_get failed");
+ xbt_assert(res == MSG_OK, "MSG_task_get failed");
XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
if (!strcmp(MSG_task_get_name(task), "finalize")) {
int read;
read = sscanf(argv[1], "%d", &number_of_tasks);
- xbt_assert1(read, "Invalid argument %s\n", argv[1]);
+ xbt_assert(read, "Invalid argument %s\n", argv[1]);
read = sscanf(argv[2], "%lg", &task_comp_size);
- xbt_assert1(read, "Invalid argument %s\n", argv[2]);
+ xbt_assert(read, "Invalid argument %s\n", argv[2]);
read = sscanf(argv[3], "%lg", &task_comm_size);
- xbt_assert1(read, "Invalid argument %s\n", argv[3]);
+ xbt_assert(read, "Invalid argument %s\n", argv[3]);
{ /* Process organisation */
slaves_count = argc - 4;
int i;
int res = sscanf(argv[1], "%d", &number_of_tasks);
- xbt_assert1(res,"Invalid argument %s\n", argv[1]);
+ xbt_assert(res,"Invalid argument %s\n", argv[1]);
res = sscanf(argv[2], "%lg", &task_comp_size);
- xbt_assert1(res, "Invalid argument %s\n", argv[2]);
+ xbt_assert(res, "Invalid argument %s\n", argv[2]);
res = sscanf(argv[3], "%lg", &task_comm_size);
- xbt_assert1(res, "Invalid argument %s\n", argv[3]);
+ xbt_assert(res, "Invalid argument %s\n", argv[3]);
{ /* Task creation */
char sprintf_buffer[64];
for (i = 4; i < argc; i++) {
slaves[i - 4] = MSG_get_host_by_name(argv[i]);
- xbt_assert1(slaves[i - 4] != NULL, "Unknown host %s. Stopping Now! ",
+ xbt_assert(slaves[i - 4] != NULL, "Unknown host %s. Stopping Now! ",
argv[i]);
}
}
int res;
while (1) {
res = MSG_task_get(&(task), PORT_22);
- xbt_assert0(res == MSG_OK, "MSG_task_get failed");
+ xbt_assert(res == MSG_OK, "MSG_task_get failed");
XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
if (!strcmp(MSG_task_get_name(task), "finalize")) {
int read;
read = sscanf(argv[1], "%d", &id);
- xbt_assert1(read, "Invalid argument %s\n", argv[1]);
+ xbt_assert(read, "Invalid argument %s\n", argv[1]);
sprintf(mailbox, "slave-%d", id);
while (1) {
res = MSG_task_receive(&(task), mailbox);
- xbt_assert0(res == MSG_OK, "MSG_task_get failed");
+ xbt_assert(res == MSG_OK, "MSG_task_get failed");
// XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
if (!strcmp(MSG_task_get_name(task), "finalize")) {
m_host_list = calloc(host_list_size, sizeof(m_host_t));
for (i = 1; i <= host_list_size; i++) {
m_host_list[i - 1] = MSG_get_host_by_name(argv[i]);
- xbt_assert1(m_host_list[i - 1] != NULL,
+ xbt_assert(m_host_list[i - 1] != NULL,
"Unknown host %s. Stopping Now! ", argv[i]);
}
int read;
read = sscanf(argv[argc - 2], "%lg", &computation_amount);
- xbt_assert1(read, "Invalid argument %s\n", argv[argc - 2]);
+ xbt_assert(read, "Invalid argument %s\n", argv[argc - 2]);
read = sscanf(argv[argc - 1], "%lg", &communication_amount);
- xbt_assert1(read, "Invalid argument %s\n", argv[argc - 1]);
+ xbt_assert(read, "Invalid argument %s\n", argv[argc - 1]);
computation_duration = (double *) calloc(host_list_size, sizeof(double));
communication_table =
(double *) calloc(host_list_size * host_list_size, sizeof(double));
m_host_list = calloc(host_list_size, sizeof(m_host_t));
for (i = 1; i <= host_list_size; i++) {
m_host_list[i - 1] = MSG_get_host_by_name(argv[i]);
- xbt_assert1(m_host_list[i - 1] != NULL,
+ xbt_assert(m_host_list[i - 1] != NULL,
"Unknown host %s. Stopping Now! ", argv[i]);
}
int read;
read = sscanf(argv[argc - 1], "%lg", &communication_amount);
- xbt_assert1(read, "Invalid argument %s\n", argv[argc - 1]);
+ xbt_assert(read, "Invalid argument %s\n", argv[argc - 1]);
computation_duration = (double *) calloc(host_list_size, sizeof(double));
communication_table =
(double *) calloc(host_list_size * host_list_size, sizeof(double));
xbt_matrix_t A, B, C = NULL, sA, sB, sC;
result_t result;
- xbt_assert0(argc != 1, "Wrong number of arguments for this node");
+ xbt_assert(argc != 1, "Wrong number of arguments for this node");
/* Initialize the node's data-structures */
myid = atoi(argv[1]);
m_task_t task = NULL;
int res = sscanf(argv[1], "%lg", &computation_amount);
- xbt_assert1(res, "Invalid argument %s\n", argv[1]);
+ xbt_assert(res, "Invalid argument %s\n", argv[1]);
res = sscanf(argv[2], "%lg", &priority);
- xbt_assert1(res, "Invalid argument %s\n", argv[2]);
+ xbt_assert(res, "Invalid argument %s\n", argv[2]);
XBT_INFO("Hello! Running a task of size %g with priority %g",
computation_amount, priority);
XBT_INFO("== Try to get a host property that does not exist");
value = MSG_host_get_property_value(host1, noexist);
- xbt_assert0(!value, "The key exists (it's not supposed to)");
+ xbt_assert(!value, "The key exists (it's not supposed to)");
XBT_INFO("== Try to get a host property that does exist");
value = MSG_host_get_property_value(host1, exist);
- xbt_assert1(value, "\tProperty %s is undefined (where it should)",
+ xbt_assert(value, "\tProperty %s is undefined (where it should)",
exist);
- xbt_assert2(!strcmp(value, "180"),
+ xbt_assert(!strcmp(value, "180"),
"\tValue of property %s is defined to %s (where it should be 180)",
exist, value);
XBT_INFO(" Property: %s old value: %s", exist, value);
/* Test if we have changed the value */
value = MSG_host_get_property_value(host1, exist);
- xbt_assert1(value, "Property %s is undefined (where it should)", exist);
- xbt_assert2(!strcmp(value, "250"),
+ xbt_assert(value, "Property %s is undefined (where it should)", exist);
+ xbt_assert(!strcmp(value, "250"),
"Value of property %s is defined to %s (where it should be 250)",
exist, value);
XBT_INFO(" Property: %s old value: %s", exist, value);
XBT_INFO("== Try to get a process property that does not exist");
value = MSG_process_get_property_value(MSG_process_self(), noexist);
- xbt_assert0(!value, "The property is defined (it shouldnt)");
+ xbt_assert(!value, "The property is defined (it shouldnt)");
return 0;
}
("------------------- Produce the trace file---------------------------");
XBT_INFO("Producing the trace of the run into %s", tracefilename);
FILE *out = fopen(tracefilename, "w");
- xbt_assert1(out, "Cannot write to %s", tracefilename);
+ xbt_assert(out, "Cannot write to %s", tracefilename);
free(tracefilename);
xbt_dynar_foreach(dax, cursor, task) {
("------------------- Produce the trace file---------------------------");
XBT_INFO("Producing the trace of the run into %s", tracefilename);
FILE *out = fopen(tracefilename, "w");
- xbt_assert1(out, "Cannot write to %s", tracefilename);
+ xbt_assert(out, "Cannot write to %s", tracefilename);
free(tracefilename);
xbt_dynar_foreach(dot, cursor, task) {
("------------------- Produce the trace file---------------------------");
XBT_INFO("Producing the trace of the run into %s", tracefilename);
FILE *out = fopen(tracefilename, "w");
- xbt_assert1(out, "Cannot write to %s", tracefilename);
+ xbt_assert(out, "Cannot write to %s", tracefilename);
free(tracefilename);
xbt_dynar_foreach(dot, cursor, task) {
("------------------- Produce the trace file---------------------------");
XBT_INFO("Producing the trace of the run into %s", tracefilename);
out = fopen(tracefilename, "w");
- xbt_assert1(out, "Cannot write to %s", tracefilename);
+ xbt_assert(out, "Cannot write to %s", tracefilename);
free(tracefilename);
output_xml(out, dax);
xbt_dynar_get_cpy(changed_tasks, 0, &checkD);
xbt_dynar_get_cpy(changed_tasks, 1, &checkB);
- xbt_assert0(checkD == taskD &&
+ xbt_assert(checkD == taskD &&
checkB == taskB, "Unexpected simulation results");
xbt_dynar_free_container(&changed_tasks);
xbt_dynar_get_cpy(changed_tasks, 0, &checkD);
xbt_dynar_get_cpy(changed_tasks, 1, &checkB);
- xbt_assert0(checkD == taskD &&
+ xbt_assert(checkD == taskD &&
checkB == taskB, "Unexpected simulation results");
xbt_dynar_free_container(&changed_tasks);
do { if (!(cond)) THROWF(0, 0, __VA_ARGS__); } while (0)
#endif
-#if 1 || defined(XBT_USE_DEPRECATED)
+#ifdef XBT_USE_DEPRECATED
#define xbt_assert0(...) xbt_assert(__VA_ARGS__)
#define xbt_assert1(...) xbt_assert(__VA_ARGS__)
THROWF(unknown_error, 0, "Function %s unimplemented",_XBT_FUNCTION)
#ifndef NDEBUG
-# define DIE_IMPOSSIBLE xbt_assert0(0,"The Impossible Did Happen (yet again)")
+# define DIE_IMPOSSIBLE xbt_assert(0,"The Impossible Did Happen (yet again)")
#else
# define DIE_IMPOSSIBLE exit(1);
#endif
((request->msg_size / ((double) 64 * 1024 * 1024))
* request->msg_amount) + 1;
- xbt_assert0(new_amount > request->msg_amount,
+ xbt_assert(new_amount > request->msg_amount,
"Overflow on the number of messages! You must have a *really* fat pipe. Please fix your platform");
request->msg_amount = new_amount;
xbt_dynar_t res = xbt_dynar_new(sizeof(xbt_peer_t),
xbt_peer_free_voidp);
- xbt_assert0(amok_pm_moddata_id != -1, "Run amok_pm_init first!");
+ xbt_assert(amok_pm_moddata_id != -1, "Run amok_pm_init first!");
g = gras_moddata_by_id(amok_pm_moddata_id);
XBT_DEBUG("retrieved groups=%p", g->groups);
OUT = fopen(filename, "w");
- xbt_assert1(OUT, "Unable to open %s for writing", filename);
+ xbt_assert(OUT, "Unable to open %s for writing", filename);
fprintf(OUT, "%s", SIM_PREEMBULE);
sprintf(filename, RL_SOURCENAME, project, key);
OUT = fopen(filename, "w");
- xbt_assert1(OUT, "Unable to open %s for writing", filename);
+ xbt_assert(OUT, "Unable to open %s for writing", filename);
fprintf(OUT, "/* specific to Borland Compiler */\n"
"#ifdef __BORLANDC__\n"
sprintf(filename, MAKEFILE_FILENAME_AM, project);
OUT = fopen(filename, "w");
- xbt_assert1(OUT, "Unable to open %s for writing", filename);
+ xbt_assert(OUT, "Unable to open %s for writing", filename);
fprintf(OUT, "# AUTOMAKE variable definition\n");
fprintf(OUT, "INCLUDES= @CFLAGS_SimGrid@\n\n");
sprintf(filename, MAKEFILE_FILENAME_LOCAL, project);
OUT = fopen(filename, "w");
- xbt_assert1(OUT, "Unable to open %s for writing", filename);
+ xbt_assert(OUT, "Unable to open %s for writing", filename);
free(filename);
fprintf(OUT,
/* Start the co-routine */
lua_getglobal(L, argv[0]);
- xbt_assert1(lua_isfunction(L, -1),
+ xbt_assert(lua_isfunction(L, -1),
"The lua function %s does not seem to exist", argv[0]);
// push arguments onto the stack
// Call the function (in resume)
int err;
err = lua_pcall(L, argc - 1, 1, 0);
- xbt_assert2(err == 0, "error running function `%s': %s", argv[0],
+ xbt_assert(err == 0, "error running function `%s': %s", argv[0],
lua_tostring(L, -1));
/* retrieve result */
if (lua_isnil(L, -1)) {
done = 1;
} else {
- xbt_assert1(lua_isstring(L, -1),
+ xbt_assert(lua_isstring(L, -1),
"argv[%d] got from lua is no string", argc - 1);
- xbt_assert2(argc < LUA_MAX_ARGS_COUNT,
+ xbt_assert(argc < LUA_MAX_ARGS_COUNT,
"Too many arguments, please increase LUA_MAX_ARGS_COUNT in %s before recompiling SimGrid if you insist on having more than %d args on command line",
__FILE__, LUA_MAX_ARGS_COUNT - 1);
argv[argc - 1] = (char *) luaL_checkstring(L, -1);
unsigned int cursor = 0;
char *name = NULL;
- xbt_assert0(xbt_dynar_length(ps->frames),
+ xbt_assert(xbt_dynar_length(ps->frames),
"More block_end than block_begin");
xbt_dynar_pop(ps->frames, &frame);
{
int ret;
- xbt_assert0(xbt_dynar_length(ps->lints) > 0,
+ xbt_assert(xbt_dynar_length(ps->lints) > 0,
"gras_cbps_i_pop: no value to pop");
ret = xbt_dynar_pop_as(ps->lints, int);
XBT_DEBUG("pop %d as a size", ret);
XBT_DEBUG("Resize integer %d from %lu @%p to %lu @%p",
cpt, r_size, r_data, l_size, l_data);
- xbt_assert0(r_data != l_data, "Impossible to resize in place");
+ xbt_assert(r_data != l_data, "Impossible to resize in place");
if (sizeChange < 0) {
XBT_DEBUG("Truncate %d bytes (%s,%s)", -sizeChange,
XBT_IN("");
res = gras_datadesc_by_name_or_null(name);
if (res) {
- xbt_assert1(res->category_code == e_gras_datadesc_type_cat_scalar,
+ xbt_assert(res->category_code == e_gras_datadesc_type_cat_scalar,
"Redefinition of type %s does not match", name);
- xbt_assert1(res->category.scalar_data.encoding == encoding,
+ xbt_assert(res->category.scalar_data.encoding == encoding,
"Redefinition of type %s does not match", name);
- xbt_assert1(res->category.scalar_data.type == type,
+ xbt_assert(res->category.scalar_data.type == type,
"Redefinition of type %s does not match", name);
XBT_VERB("Discarding redefinition of %s", name);
return res;
res = gras_datadesc_by_name_or_null(name);
if (res) {
/* FIXME: Check that field redefinition matches */
- xbt_assert1(res->category_code == e_gras_datadesc_type_cat_struct,
+ xbt_assert(res->category_code == e_gras_datadesc_type_cat_struct,
"Redefinition of type %s does not match", name);
XBT_DEBUG("Discarding redefinition of %s", name);
return res;
gras_dd_cat_field_t field;
int arch;
- xbt_assert2(field_type,
+ xbt_assert(field_type,
"Cannot add the field '%s' into struct '%s': its type is NULL",
name, struct_type->name);
XBT_IN("(%s %s.%s;)", field_type->name, struct_type->name, name);
return;
}
- xbt_assert1(field_type->size[GRAS_THISARCH] >= 0,
+ xbt_assert(field_type->size[GRAS_THISARCH] >= 0,
"Cannot add a dynamically sized field in structure %s",
struct_type->name);
int arch;
XBT_IN("(%s)", name);
- xbt_assert0(selector,
+ xbt_assert(selector,
"Attempt to creat an union without field_count function");
res = gras_datadesc_by_name_or_null(name);
if (res) {
/* FIXME: Check that field redefinition matches */
- xbt_assert1(res->category_code == e_gras_datadesc_type_cat_union,
+ xbt_assert(res->category_code == e_gras_datadesc_type_cat_union,
"Redefinition of type %s does not match", name);
- xbt_assert1(res->category.union_data.selector == selector,
+ xbt_assert(res->category.union_data.selector == selector,
"Redefinition of type %s does not match", name);
XBT_VERB("Discarding redefinition of %s", name);
return res;
int arch;
XBT_IN("(%s %s.%s;)", field_type->name, union_type->name, name);
- xbt_assert1(field_type->size[GRAS_THISARCH] >= 0,
+ xbt_assert(field_type->size[GRAS_THISARCH] >= 0,
"Cannot add a dynamically sized field in union %s",
union_type->name);
XBT_IN("(%s)", name);
res = gras_datadesc_by_name_or_null(name);
if (res) {
- xbt_assert1(res->category_code == e_gras_datadesc_type_cat_ref,
+ xbt_assert(res->category_code == e_gras_datadesc_type_cat_ref,
"Redefinition of %s does not match", name);
- xbt_assert1(res->category.ref_data.type == referenced_type,
+ xbt_assert(res->category.ref_data.type == referenced_type,
"Redefinition of %s does not match", name);
- xbt_assert1(res->category.ref_data.selector == NULL,
+ xbt_assert(res->category.ref_data.selector == NULL,
"Redefinition of %s does not match", name);
XBT_DEBUG("Discarding redefinition of %s", name);
return res;
res = gras_ddt_new(name);
- xbt_assert0(pointer_type, "Cannot get the description of data pointer");
+ xbt_assert(pointer_type, "Cannot get the description of data pointer");
for (arch = 0; arch < gras_arch_count; arch++) {
res->size[arch] = pointer_type->size[arch];
res = gras_datadesc_by_name_or_null(name);
if (res) {
- xbt_assert1(res->category_code == e_gras_datadesc_type_cat_ref,
+ xbt_assert(res->category_code == e_gras_datadesc_type_cat_ref,
"Redefinition of type %s does not match", name);
- xbt_assert1(res->category.ref_data.type == NULL,
+ xbt_assert(res->category.ref_data.type == NULL,
"Redefinition of type %s does not match", name);
- xbt_assert1(res->category.ref_data.selector == selector,
+ xbt_assert(res->category.ref_data.selector == selector,
"Redefinition of type %s does not match", name);
XBT_VERB("Discarding redefinition of %s", name);
return res;
}
res = gras_ddt_new(name);
- xbt_assert0(pointer_type, "Cannot get the description of data pointer");
+ xbt_assert(pointer_type, "Cannot get the description of data pointer");
for (arch = 0; arch < gras_arch_count; arch++) {
res->size[arch] = pointer_type->size[arch];
XBT_IN("(%s)", name);
res = gras_datadesc_by_name_or_null(name);
if (res) {
- xbt_assert1(res->category_code == e_gras_datadesc_type_cat_array,
+ xbt_assert(res->category_code == e_gras_datadesc_type_cat_array,
"Redefinition of type %s does not match", name);
if (res->category.array_data.type != element_type) {
gras_datadesc_type_dump(element_type);
}
- xbt_assert1(res->category.array_data.fixed_size == fixed_size,
+ xbt_assert(res->category.array_data.fixed_size == fixed_size,
"Redefinition of type %s does not match", name);
- xbt_assert1(res->category.array_data.dynamic_size == NULL,
+ xbt_assert(res->category.array_data.dynamic_size == NULL,
"Redefinition of type %s does not match", name);
XBT_VERB("Discarding redefinition of %s", name);
}
res = gras_ddt_new(name);
- xbt_assert1(fixed_size >= 0, "'%s' is a array of negative fixed size",
+ xbt_assert(fixed_size >= 0, "'%s' is a array of negative fixed size",
name);
for (arch = 0; arch < gras_arch_count; arch++) {
res->size[arch] = fixed_size * element_type->aligned_size[arch];
int arch;
XBT_IN("(%s)", name);
- xbt_assert1(dynamic_size,
+ xbt_assert(dynamic_size,
"'%s' is a dynamic array without size discriminant", name);
res = gras_datadesc_by_name_or_null(name);
if (res) {
- xbt_assert1(res->category_code == e_gras_datadesc_type_cat_array,
+ xbt_assert(res->category_code == e_gras_datadesc_type_cat_array,
"Redefinition of type %s does not match", name);
- xbt_assert1(res->category.array_data.type == element_type,
+ xbt_assert(res->category.array_data.type == element_type,
"Redefinition of type %s does not match", name);
- xbt_assert1(res->category.array_data.fixed_size == -1,
+ xbt_assert(res->category.array_data.fixed_size == -1,
"Redefinition of type %s does not match", name);
- xbt_assert1(res->category.array_data.dynamic_size == dynamic_size,
+ xbt_assert(res->category.array_data.dynamic_size == dynamic_size,
"Redefinition of type %s does not match", name);
XBT_VERB("Discarding redefinition of %s", name);
{
char *l_data = NULL;
- xbt_assert1(size > 0, "Cannot allocate %ld bytes!", size);
+ xbt_assert(size > 0, "Cannot allocate %ld bytes!", size);
l_data = xbt_malloc((size_t) size);
*l_ref = l_data;
char *field_dst;
struct_data = type->category.struct_data;
- xbt_assert1(struct_data.closed,
+ xbt_assert(struct_data.closed,
"Please call gras_datadesc_declare_struct_close on %s before copying it",
type->name);
XBT_VERB(">> Copy all fields of the structure %s", type->name);
union_data = type->category.union_data;
- xbt_assert1(union_data.closed,
+ xbt_assert(union_data.closed,
"Please call gras_datadesc_declare_union_close on %s before copying it",
type->name);
/* retrieve the field number */
field_num = union_data.selector(type, state, src);
- xbt_assert1(field_num > 0,
+ xbt_assert(field_num > 0,
"union field selector of %s gave a negative value",
type->name);
- xbt_assert3(field_num < xbt_dynar_length(union_data.fields),
+ xbt_assert(field_num < xbt_dynar_length(union_data.fields),
"union field selector of %s returned %d but there is only %lu fields",
type->name, field_num,
xbt_dynar_length(union_data.fields));
array_count = subsize;
if (array_count == -1) {
array_count = array_data.dynamic_size(type, state, src);
- xbt_assert1(array_count >= 0,
+ xbt_assert(array_count >= 0,
"Invalid (negative) array size for type %s",
type->name);
}
static xbt_dict_t refs = NULL; /* all references already sent */
int size = 0;
- xbt_assert0(type, "called with NULL type descriptor");
+ xbt_assert(type, "called with NULL type descriptor");
XBT_DEBUG("Memcopy a %s from %p to %p", gras_datadesc_get_name(type), src,
dst);
char *field_data;
struct_data = type->category.struct_data;
- xbt_assert1(struct_data.closed,
+ xbt_assert(struct_data.closed,
"Please call gras_datadesc_declare_struct_close on %s before sending it",
type->name);
XBT_VERB(">> Send all fields of the structure %s", type->name);
union_data = type->category.union_data;
- xbt_assert1(union_data.closed,
+ xbt_assert(union_data.closed,
"Please call gras_datadesc_declare_union_close on %s before sending it",
type->name);
/* retrieve the field number */
field_num = union_data.selector(type, state, data);
- xbt_assert1(field_num > 0,
+ xbt_assert(field_num > 0,
"union field selector of %s gave a negative value",
type->name);
- xbt_assert3(field_num < xbt_dynar_length(union_data.fields),
+ xbt_assert(field_num < xbt_dynar_length(union_data.fields),
"union field selector of %s returned %d but there is only %lu fields",
type->name, field_num,
xbt_dynar_length(union_data.fields));
count = array_data.fixed_size;
if (count == -1) {
count = array_data.dynamic_size(type, state, data);
- xbt_assert1(count >= 0,
+ xbt_assert(count >= 0,
"Invalid (negative) array size for type %s",
type->name);
gras_dd_send_int(sock, &count, 0 /*non-stable */ );
static gras_cbps_t state = NULL;
static xbt_dict_t refs = NULL; /* all references already sent */
- xbt_assert0(type, "called with NULL type descriptor");
+ xbt_assert(type, "called with NULL type descriptor");
if (!state) {
state = gras_cbps_new();
struct_data = type->category.struct_data;
- xbt_assert1(struct_data.closed,
+ xbt_assert(struct_data.closed,
"Please call gras_datadesc_declare_struct_close on %s before receiving it",
type->name);
XBT_VERB(">> Receive all fields of the structure %s", type->name);
union_data = type->category.union_data;
- xbt_assert1(union_data.closed,
+ xbt_assert(union_data.closed,
"Please call gras_datadesc_declare_union_close on %s before receiving it",
type->name);
/* retrieve the field number */
refs = xbt_dict_new();
}
- xbt_assert0(type, "called with NULL type descriptor");
+ xbt_assert(type, "called with NULL type descriptor");
TRY {
gras_datadesc_recv_rec(sock, state, refs, type,
r_arch, NULL, 0, (char *) dst, -1, type->cycle);
(gras_msg_procdata_t) gras_libdata_by_id(gras_msg_libdata_id);
unsigned int cpt;
- xbt_assert0(msg_got, "msg_got is an output parameter");
+ xbt_assert(msg_got, "msg_got is an output parameter");
start = gras_os_time();
XBT_VERB("Waiting for message '%s' for %fs",
gras_msg_wait_ext_(timeout, msgt_want, NULL, NULL, NULL, &msg);
if (msgt_want->ctn_type) {
- xbt_assert1(payload,
+ xbt_assert(payload,
"Message type '%s' convey a payload that you must accept",
msgt_want->name);
} else {
- xbt_assert1(!payload,
+ xbt_assert(!payload,
"No payload was declared for message type '%s' (don't expect one)",
msgt_want->name);
}
&gras_msg_wait_or_filter, (void *) msgt_want, &msg);
if (msg.type->ctn_type) {
- xbt_assert1(payload,
+ xbt_assert(payload,
"Message type '%s' convey a payload you must accept",
msg.type->name);
}
{
if (msgtype->ctn_type) {
- xbt_assert1(payload,
+ xbt_assert(payload,
"Message type '%s' convey a payload you must provide",
msgtype->name);
} else {
- xbt_assert1(!payload,
+ xbt_assert(!payload,
"No payload was declared for message type '%s'",
msgtype->name);
}
/* we served a timer, we're done */
return;
} else {
- xbt_assert1(untiltimer > 0, "Negative timer (%f). I'm 'puzzeled'",
+ xbt_assert(untiltimer > 0, "Negative timer (%f). I'm 'puzzeled'",
untiltimer);
XBT_WARN
("No timer elapsed, in contrary to expectations (next in %f sec)",
}
}
- xbt_assert1(!ctx.answer_due,
+ xbt_assert(!ctx.answer_due,
"Bug in user code: RPC callback to message '%s' didn't call gras_msg_rpcreturn",
msg.type->name);
if (ctx.answer_due)
XBT_DEBUG
("Re-register version %d of message '%s' (same kind & payload, ignored).",
version, name);
- xbt_assert3(msgtype->kind == kind,
+ xbt_assert(msgtype->kind == kind,
"Message %s re-registered as a %s (it was known as a %s)",
namev, e_gras_msg_kind_names[kind],
e_gras_msg_kind_names[msgtype->kind]);
- xbt_assert3(!gras_datadesc_type_cmp
+ xbt_assert(!gras_datadesc_type_cmp
(msgtype->ctn_type, payload_request),
"Message %s re-registred with another payload (%s was %s)",
namev, gras_datadesc_get_name(payload_request),
gras_datadesc_get_name(msgtype->ctn_type));
- xbt_assert3(!gras_datadesc_type_cmp
+ xbt_assert(!gras_datadesc_type_cmp
(msgtype->answer_type, payload_answer),
"Message %s re-registred with another answer payload (%s was %s)",
namev, gras_datadesc_get_name(payload_answer),
static gras_datadesc_type_t ulong_type = NULL;
char c_kind = (char) kind;
- xbt_assert0(msgtype, "Cannot send the NULL message");
+ xbt_assert(msgtype, "Cannot send the NULL message");
if (!string_type) {
string_type = gras_datadesc_by_name("string");
char *msg_name = NULL;
char c_kind;
- xbt_assert1(!gras_socket_is_meas(sock),
+ xbt_assert(!gras_socket_is_meas(sock),
"Asked to receive a message on the measurement socket %p",
sock);
if (!string_type) {
/* answer to RPC */
if (msg->type->answer_type) {
msg->payl_size = gras_datadesc_size(msg->type->answer_type);
- xbt_assert2(msg->payl_size > 0,
+ xbt_assert(msg->payl_size > 0,
"%s %s",
"Dynamic array as payload is forbided for now (FIXME?).",
"Reference to dynamic array is allowed.");
/* regular message */
if (msg->type->ctn_type) {
msg->payl_size = gras_datadesc_size(msg->type->ctn_type);
- xbt_assert2(msg->payl_size > 0,
+ xbt_assert(msg->payl_size > 0,
"%s %s",
"Dynamic array as payload is forbided for now (FIXME?).",
"Reference to dynamic array is allowed.");
gras_msg_cb_ctx_t ctx = xbt_mallocator_get(gras_msg_ctx_mallocator);
if (msgtype->ctn_type) {
- xbt_assert1(request,
+ xbt_assert(request,
"RPC type '%s' convey a payload you must provide",
msgtype->name);
} else {
- xbt_assert1(!request,
+ xbt_assert(!request,
"No payload was declared for RPC type '%s'",
msgtype->name);
}
s_gras_msg_t received;
if (ctx->msgtype->answer_type) {
- xbt_assert1(answer,
+ xbt_assert(answer,
"Answers to RPC '%s' convey a payload you must accept",
ctx->msgtype->name);
} else {
- xbt_assert1(!answer,
+ xbt_assert(!answer,
"No payload was declared for answers to RPC '%s'",
ctx->msgtype->name);
}
void gras_msg_rpcreturn(double timeOut, gras_msg_cb_ctx_t ctx,
void *answer)
{
- xbt_assert0(ctx->answer_due,
+ xbt_assert(ctx->answer_due,
"RPC return not allowed here. Either not a RPC message or already returned a result");
ctx->answer_due = 0;
XBT_DEBUG("Return to RPC '%s' from %s:%d (tOut=%f, payl=%p)",
* an iterator, incremented only when the socket has a comm. And we've the right socket
* when that iterator is equal to "got", the result of waitany. Not needed if B holds.
*/
- xbt_assert1(sock_data->comm_recv,
+ xbt_assert(sock_data->comm_recv,
"Comm_recv of socket %p is empty; please report that nasty bug",
sock);
/* End of paranoia */
wVersionRequested = MAKEWORD(2, 0);
int res;
res = WSAStartup(wVersionRequested, &wsaData);
- xbt_assert0(res == 0, "Cannot find a usable WinSock DLL");
+ xbt_assert(res == 0, "Cannot find a usable WinSock DLL");
/* Confirm that the WinSock DLL supports 2.0. */
/* Note that if the DLL supports versions greater */
/* 2.0 in wVersion since that is the version we */
/* requested. */
- xbt_assert0(LOBYTE(wsaData.wVersion) == 2 &&
+ xbt_assert(LOBYTE(wsaData.wVersion) == 2 &&
HIBYTE(wsaData.wVersion) == 0,
"Cannot find a usable WinSock DLL");
XBT_INFO("Found and initialized winsock2");
WSADATA wsaData;
int res;
res = WSAStartup(0x0101, &wsaData);
- xbt_assert0(res == 0, "Cannot find a usable WinSock DLL");
+ xbt_assert(res == 0, "Cannot find a usable WinSock DLL");
XBT_INFO("Found and initialized winsock");
}
#endif
XBT_IN("");
XBT_VERB("Close %p", sock);
if (sock == _gras_lastly_selected_socket) {
- xbt_assert0(!gras_opt_trp_nomoredata_on_close || !sock->moredata,
+ xbt_assert(!gras_opt_trp_nomoredata_on_close || !sock->moredata,
"Closing a socket having more data in buffer while the nomoredata_on_close option is activated");
if (sock->moredata)
*/
void gras_trp_send(gras_socket_t sd, char *data, long int size, int stable)
{
- xbt_assert0(sd->outgoing, "Socket not suited for data send");
+ xbt_assert(sd->outgoing, "Socket not suited for data send");
(*sd->plugin->send) (sd, data, size, stable);
}
*/
void gras_trp_recv(gras_socket_t sd, char *data, long int size)
{
- xbt_assert0(sd->incoming, "Socket not suited for data receive");
+ xbt_assert(sd->incoming, "Socket not suited for data receive");
(sd->plugin->recv) (sd, data, size);
}
if (gras_if_RL())
chunk = xbt_malloc0(msg_size);
- xbt_assert0(peer->meas,
+ xbt_assert(peer->meas,
"Asked to send measurement data on a regular socket");
- xbt_assert0(peer->outgoing,
+ xbt_assert(peer->outgoing,
"Socket not suited for data send (was created with gras_socket_server(), not gras_socket_client())");
for (sent_sofar = 0; sent_sofar < msg_amount; sent_sofar++) {
if (gras_if_RL())
chunk = xbt_malloc(msg_size);
- xbt_assert0(peer->meas,
+ xbt_assert(peer->meas,
"Asked to receive measurement data on a regular socket");
- xbt_assert0(peer->incoming, "Socket not suited for data receive");
+ xbt_assert(peer->incoming, "Socket not suited for data receive");
for (got_sofar = 0; got_sofar < msg_amount; got_sofar++) {
XBT_CDEBUG(gras_trp_meas,
THROWF(unknown_error,0,"measurement sockets were broken in this release of SimGrid and should be ported back in the future."
"If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
- xbt_assert0(peer->meas,
+ xbt_assert(peer->meas,
"No need to accept on non-measurement sockets (it's automatic)");
if (!peer->accepting) {
{
gras_socket_t res;
- xbt_assert0(gras_if_RL(), "Cannot use file as socket in the simulator");
+ xbt_assert(gras_if_RL(), "Cannot use file as socket in the simulator");
gras_trp_socket_new(0, &res);
{
gras_socket_t res;
- xbt_assert0(gras_if_RL(), "Cannot use file as socket in the simulator");
+ xbt_assert(gras_if_RL(), "Cannot use file as socket in the simulator");
gras_trp_socket_new(1, &res);
const char *data, unsigned long int size)
{
- xbt_assert0(sock->outgoing, "Cannot write on client file socket");
- xbt_assert0(size >= 0, "Cannot send a negative amount of data");
+ xbt_assert(sock->outgoing, "Cannot write on client file socket");
+ xbt_assert(size >= 0, "Cannot send a negative amount of data");
while (size) {
int status = 0;
int got = 0;
- xbt_assert0(sock, "Cannot recv on an NULL socket");
- xbt_assert0(sock->incoming, "Cannot recv on client file socket");
- xbt_assert0(size >= 0, "Cannot receive a negative amount of data");
+ xbt_assert(sock, "Cannot recv on an NULL socket");
+ xbt_assert(sock->incoming, "Cannot recv on client file socket");
+ xbt_assert(size >= 0, "Cannot receive a negative amount of data");
if (sock->recvd) {
data[0] = sock->recvd_val;
unsigned int cpt;
gras_sg_portrec_t pr;
- xbt_assert0(hd, "Please run gras_process_init on each process");
+ xbt_assert(hd, "Please run gras_process_init on each process");
xbt_dynar_foreach(hd->ports, cpt, pr) {
if (pr->port == port)
gras_sg_portrec_t pr;
gras_trp_sg_sock_data_t data;
- xbt_assert0(hd, "Please run gras_process_init on each process");
+ xbt_assert(hd, "Please run gras_process_init on each process");
sock->accepting = 1;
if (!sock)
return;
- xbt_assert0(hd, "Please run gras_process_init on each process");
+ xbt_assert(hd, "Please run gras_process_init on each process");
gras_trp_sg_sock_data_t sockdata = sock->data;
gras_msg_t msg; /* message to send */
//gras_trp_sg_sock_data_t sock_data = (gras_trp_sg_sock_data_t) sock->data;
- xbt_assert0(sock->meas,
+ xbt_assert(sock->meas,
"SG chunk exchange shouldn't be used on non-measurement sockets");
gras_trp_procdata_t trp_proc =
(gras_trp_procdata_t) gras_libdata_by_id(gras_trp_libdata_id);
- xbt_assert0(sock->meas,
+ xbt_assert(sock->meas,
"SG chunk exchange shouldn't be used on non-measurement sockets");
xbt_queue_shift_timed(trp_proc->meas_selectable_sockets,
&remote_socket, 60);
if (returnValue == 0) {
fetchedEntry = getprotobyname("tcp");
- xbt_assert0(fetchedEntry, "getprotobyname(tcp) gave NULL");
+ xbt_assert(fetchedEntry, "getprotobyname(tcp) gave NULL");
returnValue = fetchedEntry->p_proto;
}
}
if (found) {
- xbt_assert1(mod->init_f == init_f,
+ xbt_assert(mod->init_f == init_f,
"Module %s reregistered with a different init_f!", name);
- xbt_assert1(mod->exit_f == exit_f,
+ xbt_assert(mod->exit_f == exit_f,
"Module %s reregistered with a different exit_f!", name);
- xbt_assert1(mod->join_f == join_f,
+ xbt_assert(mod->join_f == join_f,
"Module %s reregistered with a different join_f!", name);
- xbt_assert1(mod->leave_f == leave_f,
+ xbt_assert(mod->leave_f == leave_f,
"Module %s reregistered with a different leave_f!", name);
- xbt_assert1(mod->datasize == datasize,
+ xbt_assert(mod->datasize == datasize,
"Module %s reregistered with a different datasize!", name);
- xbt_assert1(mod->p_id == ID,
+ xbt_assert(mod->p_id == ID,
"Module %s reregistered with a different p_id field!",
name);
XBT_DEBUG("Go ahead for cursor %d, there is %ld libdata",
cursor, xbt_set_length(pd->libdata));
- xbt_assert1(fab.name, "Name of fabric #%d is NULL!", cursor);
+ xbt_assert(fab.name, "Name of fabric #%d is NULL!", cursor);
XBT_DEBUG("Create the procdata for %s", fab.name);
/* Check for our own errors */
TRY {
gras_procdata_t *gras_procdata_get(void)
{
- xbt_assert0(_gras_procdata, "Run gras_process_init (ie, gras_init)!");
+ xbt_assert(_gras_procdata, "Run gras_process_init (ie, gras_init)!");
return _gras_procdata;
}
int gras_bench_always_begin(const char *location, int line)
{
- xbt_assert0(!benchmarking, "Already benchmarking");
+ xbt_assert(!benchmarking, "Already benchmarking");
benchmarking = 1;
if (!timer)
int gras_bench_always_end(void)
{
- xbt_assert0(benchmarking, "Not benchmarking yet");
+ xbt_assert(benchmarking, "Not benchmarking yet");
benchmarking = 0;
xbt_os_timer_stop(timer);
duration = xbt_os_timer_elapsed(timer);
int gras_bench_once_begin(const char *location, int line)
{
double *ir = NULL;
- xbt_assert0(!benchmarking, "Already benchmarking");
+ xbt_assert(!benchmarking, "Already benchmarking");
benchmarking = 1;
if (!locbuf || locbufsize < strlen(location) + 64) {
int gras_bench_once_end(void)
{
- xbt_assert0(benchmarking, "Not benchmarking yet");
+ xbt_assert(benchmarking, "Not benchmarking yet");
benchmarking = 0;
if (duration > 0) {
xbt_os_timer_stop(timer);
xbt_queue_free(&trp_pd->meas_selectable_sockets);
- xbt_assert0(hd, "Run gras_process_init (ie, gras_init)!!");
+ xbt_assert(hd, "Run gras_process_init (ie, gras_init)!!");
XBT_VERB("GRAS: Finalizing process '%s' (%d)",
SIMIX_req_process_get_name(SIMIX_process_self()), gras_os_getpid());
gras_procdata_t *pd =
(gras_procdata_t *) SIMIX_req_process_get_data(SIMIX_process_self());
- xbt_assert0(pd, "Run gras_process_init! (ie, gras_init)");
+ xbt_assert(pd, "Run gras_process_init! (ie, gras_init)");
return pd;
}
{
gras_procdata_t *pd = (gras_procdata_t *) SIMIX_req_process_get_data(p);
- xbt_assert2(pd,
+ xbt_assert(pd,
"process '%s' on '%s' didn't run gras_process_init! (ie, gras_init)",
SIMIX_req_process_get_name(p),
SIMIX_req_host_get_name(SIMIX_req_process_get_host(p)));
void TRACE_activate (void)
{
- xbt_assert0 (trace_active==0, "Tracing is already active.");
+ xbt_assert (trace_active==0, "Tracing is already active.");
trace_active = 1;
XBT_DEBUG ("Tracing is on");
}
char *name, *value;
FILE *file = fopen (output, "w");
- xbt_assert1 (file != NULL,
+ xbt_assert (file != NULL,
"Unable to open file (%s) for writing triva graph "
"configuration (uncategorized).", output);
}
FILE *file = fopen (output, "w");
- xbt_assert1 (file != NULL,
+ xbt_assert (file != NULL,
"Unable to open file (%s) for writing triva graph "
"configuration (categorized).", output);
if (!(TRACE_is_active() && category != NULL))
return;
- xbt_assert1 (instr_platform_traced(),
+ xbt_assert (instr_platform_traced(),
"%s must be called after environment creation", __FUNCTION__);
//check if category is already created
if (!TRACE_is_active())
return;
- xbt_assert1 (instr_platform_traced(),
+ xbt_assert (instr_platform_traced(),
"%s must be called after environment creation", __FUNCTION__);
char valuestr[100];
if (!TRACE_is_active())
return;
- xbt_assert1 (instr_platform_traced(),
+ xbt_assert (instr_platform_traced(),
"%s must be called after environment creation", __FUNCTION__);
char valuestr[100];
if (!TRACE_is_active())
return;
- xbt_assert3(task->category == NULL, "Task %p(%s) already has a category (%s).",
+ xbt_assert(task->category == NULL, "Task %p(%s) already has a category (%s).",
task, task->name, task->category);
if (TRACE_msg_task_is_enabled()){
- xbt_assert2(task->name != NULL,
+ xbt_assert(task->name != NULL,
"Task %p(%s) must have a unique name in order to be traced, if --cfg=tracing/msg/task:1 is used.",
task, task->name);
- xbt_assert3(getContainer(task->name)==NULL,
+ xbt_assert(getContainer(task->name)==NULL,
"Task %p(%s). Tracing already knows a task with name %s."
"The name of each task must be unique, if --cfg=tracing/msg/task:1 is used.", task, task->name, task->name);
}
m_host_t host = MSG_host_self();
container_t host_container = getContainer(host->name);
//check to see if there is a container with the task->name
- xbt_assert3(getContainer(task->name) == NULL,
+ xbt_assert(getContainer(task->name) == NULL,
"Task %p(%s). Tracing already knows a task with name %s."
"The name of each task must be unique, if --cfg=tracing/msg/task:1 is used.", task, task->name, task->name);
container_t msg = newContainer(task->name, INSTR_MSG_TASK, host_container);
{
char *filename = TRACE_get_filename();
tracing_file = fopen(filename, "w");
- xbt_assert1 (tracing_file != NULL, "Tracefile %s could not be opened for writing.", filename);
+ xbt_assert (tracing_file != NULL, "Tracefile %s could not be opened for writing.", filename);
XBT_DEBUG("Filename %s is open for writing", filename);
type_t a2_type = a2_container->type;
container_t container = findCommonFather (getRootContainer(), a1_container, a2_container);
- xbt_assert0 (container != NULL, "common father not found");
+ xbt_assert (container != NULL, "common father not found");
//declare type
char link_typename[INSTR_DEFAULT_STR_SIZE];
//no route between them, that's possible
continue;
}
- xbt_assert2(route!=NULL,
+ xbt_assert(route!=NULL,
"there is no ASroute between %s and %s", child_name1, child_name2);
unsigned int cpt;
void *link;
snprintf(aux, INSTR_DEFAULT_STR_SIZE, "%d#%d", src, dst);
xbt_dynar_t d = xbt_dict_get_or_null(keys, aux);
- xbt_assert1(xbt_dynar_length(d)!=0,
+ xbt_assert(xbt_dynar_length(d)!=0,
"Trying to get a link key (for message reception) that has no corresponding send (%s).", __FUNCTION__);
char *s = xbt_dynar_get_as (d, 0, char *);
snprintf (key, n, "%s", s);
}else{
father = getContainer ("0");
}
- xbt_assert2(father!=NULL,
+ xbt_assert(father!=NULL,
"Could not find a parent for mpi rank %s at function %s", str, __FUNCTION__);
newContainer(str, INSTR_SMPI, father);
}
/* to be returned. */
fp = fopen("/proc/self/maps", "r");
- xbt_assert0(fp,
+ xbt_assert(fp,
"Cannot open /proc/self/maps to investigate the memory map of the process. Please report this bug.");
ret = xbt_new0(s_memory_map_t, 1);
void MSG_launch_application(const char *file)
{
- xbt_assert0(msg_global,
+ xbt_assert(msg_global,
"MSG_global_init_args has to be called before MSG_launch_application.");
SIMIX_launch_application(file);
*/
MSG_error_t MSG_set_channel_number(int number)
{
- xbt_assert0((msg_global)
+ xbt_assert((msg_global)
&& (msg_global->max_channel == 0),
"Channel number already set!");
*/
int MSG_get_channel_number(void)
{
- xbt_assert0((msg_global)
+ xbt_assert((msg_global)
&& (msg_global->max_channel != 0),
"Channel number not set yet!");
simdata = task->simdata;
- xbt_assert0(simdata->host_nb == 0,
+ xbt_assert(simdata->host_nb == 0,
"This is a parallel task. Go to hell.");
#ifdef HAVE_TRACING
TRACE_msg_task_execute_start(task);
#endif
- xbt_assert1((!simdata->compute) && (task->simdata->isused == 0),
+ xbt_assert((!simdata->compute) && (task->simdata->isused == 0),
"This task is executed somewhere else. Go fix your code! %d",
task->simdata->isused);
simdata = task->simdata;
p_simdata = SIMIX_process_self_get_data();
- xbt_assert0((!simdata->compute)
+ xbt_assert((!simdata->compute)
&& (task->simdata->isused == 0),
"This task is executed somewhere else. Go fix your code!");
- xbt_assert0(simdata->host_nb,
+ xbt_assert(simdata->host_nb,
"This is not a parallel task. Go to hell.");
XBT_DEBUG("Parallel computing on %s", p_simdata->m_host->name);
MSG_task_get_ext(m_task_t * task, m_channel_t channel, double timeout,
m_host_t host)
{
- xbt_assert1((channel >= 0)
+ xbt_assert((channel >= 0)
&& (channel < msg_global->max_channel), "Invalid channel %d",
channel);
t_simdata->sender = process;
t_simdata->source = MSG_host_self();
- xbt_assert0(t_simdata->isused == 0,
+ xbt_assert(t_simdata->isused == 0,
"This task is still being used somewhere else. You cannot send it now. Go fix your code!");
t_simdata->isused = 1;
t_simdata->sender = process;
t_simdata->source = MSG_host_self();
- xbt_assert0(t_simdata->isused == 0,
+ xbt_assert(t_simdata->isused == 0,
"This task is still being used somewhere else. You cannot send it now. Go fix your code!");
t_simdata->isused = 1;
/* FIXME: these functions are not tracable */
/* Sanity check */
- xbt_assert0(task, "Null pointer for the task storage");
+ xbt_assert(task, "Null pointer for the task storage");
if (*task)
XBT_CRITICAL
xbt_ex_free(e);
}
- xbt_assert0(finished_index != -1, "WaitAny returned -1");
+ xbt_assert(finished_index != -1, "WaitAny returned -1");
xbt_dynar_free(&s_comms);
comm = xbt_dynar_get_as(comms, finished_index, msg_comm_t);
m_task_t MSG_comm_get_task(msg_comm_t comm)
{
- xbt_assert0(comm, "Invalid parameter");
+ xbt_assert(comm, "Invalid parameter");
return comm->task_received ? *comm->task_received : comm->task_sent;
}
MSG_task_put_with_timeout(m_task_t task, m_host_t dest,
m_channel_t channel, double timeout)
{
- xbt_assert1((channel >= 0)
+ xbt_assert((channel >= 0)
&& (channel < msg_global->max_channel), "Invalid channel %d",
channel);
*/
int MSG_task_Iprobe(m_channel_t channel)
{
- xbt_assert1((channel >= 0)
+ xbt_assert((channel >= 0)
&& (channel < msg_global->max_channel), "Invalid channel %d",
channel);
*/
int MSG_task_probe_from_host(int channel, m_host_t host)
{
- xbt_assert1((channel >= 0)
+ xbt_assert((channel >= 0)
&& (channel < msg_global->max_channel), "Invalid channel %d",
channel);
CHECK_HOST();
- xbt_assert1((channel >= 0)
+ xbt_assert((channel >= 0)
&& (channel < msg_global->max_channel), "Invalid channel %d",
channel);
*/
MSG_error_t MSG_host_set_data(m_host_t host, void *data)
{
- xbt_assert0((host != NULL), "Invalid parameters");
- xbt_assert0((host->data == NULL), "Data already set");
+ xbt_assert((host != NULL), "Invalid parameters");
+ xbt_assert((host->data == NULL), "Data already set");
/* Assign data */
host->data = data;
void *MSG_host_get_data(m_host_t host)
{
- xbt_assert0((host != NULL), "Invalid parameters");
+ xbt_assert((host != NULL), "Invalid parameters");
/* Return data */
return (host->data);
const char *MSG_host_get_name(m_host_t host)
{
- xbt_assert0((host != NULL)
+ xbt_assert((host != NULL)
&& (host->simdata != NULL), "Invalid parameters");
/* Return data */
int i = 0;
char alias[MAX_ALIAS_NAME + 1] = { 0 }; /* buffer used to build the key of the mailbox */
- xbt_assert0((host != NULL), "Invalid parameters");
+ xbt_assert((host != NULL), "Invalid parameters");
/* Clean Simulator data */
/* SIMIX host will be cleaned when MSG_clean calls SIMIX_clean */
*/
int MSG_get_host_msgload(m_host_t h)
{
- xbt_assert0((h != NULL), "Invalid parameters");
+ xbt_assert((h != NULL), "Invalid parameters");
xbt_die( "Not implemented yet");
return (0);
*/
double MSG_get_host_speed(m_host_t h)
{
- xbt_assert0((h != NULL), "Invalid parameters");
+ xbt_assert((h != NULL), "Invalid parameters");
return (SIMIX_req_host_get_speed(h->simdata->smx_host));
}
*/
xbt_dict_t MSG_host_get_properties(m_host_t host)
{
- xbt_assert0((host != NULL), "Invalid parameters (host is NULL)");
+ xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
return (SIMIX_req_host_get_properties(host->simdata->smx_host));
}
*/
int MSG_host_is_avail(m_host_t h)
{
- xbt_assert0((h != NULL), "Invalid parameters (host is NULL)");
+ xbt_assert((h != NULL), "Invalid parameters (host is NULL)");
return (SIMIX_req_host_get_state(h->simdata->smx_host));
}
int argc, char **argv,
xbt_dict_t properties)
{
- xbt_assert0(code != NULL && host != NULL, "Invalid parameters");
+ xbt_assert(code != NULL && host != NULL, "Invalid parameters");
simdata_process_t simdata = xbt_new0(s_simdata_process_t, 1);
m_process_t process;
*/
void* MSG_process_get_data(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
/* get from SIMIX the MSG process data, and then the user data */
simdata_process_t simdata = SIMIX_req_process_get_data(process);
*/
MSG_error_t MSG_process_set_data(m_process_t process, void *data)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
simdata_process_t simdata = SIMIX_req_process_get_data(process);
simdata->data = data;
*/
m_host_t MSG_process_get_host(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
simdata_process_t simdata = SIMIX_req_process_get_data(process);
return simdata->m_host;
*/
int MSG_process_get_PPID(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
simdata_process_t simdata = SIMIX_req_process_get_data(process);
*/
const char *MSG_process_get_name(m_process_t process)
{
- xbt_assert0(process, "Invalid parameter");
+ xbt_assert(process, "Invalid parameter");
return SIMIX_req_process_get_name(process);
}
*/
xbt_dict_t MSG_process_get_properties(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
return SIMIX_req_process_get_properties(process);
*/
MSG_error_t MSG_process_suspend(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
CHECK_HOST();
#ifdef HAVE_TRACING
*/
MSG_error_t MSG_process_resume(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
CHECK_HOST();
#ifdef HAVE_TRACING
*/
int MSG_process_is_suspended(m_process_t process)
{
- xbt_assert0(process != NULL, "Invalid parameter");
+ xbt_assert(process != NULL, "Invalid parameter");
return SIMIX_req_process_is_suspended(process);
}
free(evt);
}
} else { // Should have got my trace file in argument
- xbt_assert1(argc >= 2,
+ xbt_assert(argc >= 2,
"No '%s' agent function provided, no simulation-wide trace file provided to MSG_action_trace_run(), "
"and no process-wide trace file provided in deployment file. Aborting.",
argv[0]
if (path) {
action_fp = fopen(path, "r");
- xbt_assert2(action_fp != NULL, "Cannot open %s: %s", path,
+ xbt_assert(action_fp != NULL, "Cannot open %s: %s", path,
strerror(errno));
}
res = MSG_main();
msg_mailbox_t MSG_mailbox_get_by_channel(m_host_t host,
m_channel_t channel)
{
- xbt_assert0((host != NULL), "Invalid host");
- xbt_assert1((channel >= 0)
+ xbt_assert((host != NULL), "Invalid host");
+ xbt_assert((channel >= 0)
&& (channel < msg_global->max_channel), "Invalid channel %d",
channel);
#endif
/* Sanity check */
- xbt_assert0(task, "Null pointer for the task storage");
+ xbt_assert(task, "Null pointer for the task storage");
if (*task)
XBT_CRITICAL
t_simdata->sender = process;
t_simdata->source = MSG_host_self();
- xbt_assert0(t_simdata->isused == 0,
+ xbt_assert(t_simdata->isused == 0,
"This task is still being used somewhere else. You cannot send it now. Go fix your code!");
t_simdata->isused=1;
#define MSG_RETURN(val) do {PROCESS_SET_ERRNO(val);return(val);} while(0)
/* #define CHECK_ERRNO() ASSERT((PROCESS_GET_ERRNO()!=MSG_HOST_FAILURE),"Host failed, you cannot call this function.") */
-/*#define CHECK_HOST() xbt_assert1(SIMIX_req_host_get_state(SIMIX_host_self())==1,\
+/*#define CHECK_HOST() xbt_assert(SIMIX_req_host_get_state(SIMIX_host_self())==1,\
"Host failed, you cannot call this function. (state=%d)",SIMIX_req_host_get_state(SIMIX_host_self()))*/
#define CHECK_HOST()
*/
void *MSG_task_get_data(m_task_t task)
{
- xbt_assert0((task != NULL), "Invalid parameter");
+ xbt_assert((task != NULL), "Invalid parameter");
return (task->data);
}
*/
void MSG_task_set_data(m_task_t task, void *data)
{
- xbt_assert0((task != NULL), "Invalid parameter");
+ xbt_assert((task != NULL), "Invalid parameter");
task->data = data;
}
*/
m_process_t MSG_task_get_sender(m_task_t task)
{
- xbt_assert0(task, "Invalid parameters");
+ xbt_assert(task, "Invalid parameters");
return ((simdata_task_t) task->simdata)->sender;
}
*/
m_host_t MSG_task_get_source(m_task_t task)
{
- xbt_assert0(task, "Invalid parameters");
+ xbt_assert(task, "Invalid parameters");
return ((simdata_task_t) task->simdata)->source;
}
*/
const char *MSG_task_get_name(m_task_t task)
{
- xbt_assert0(task, "Invalid parameters");
+ xbt_assert(task, "Invalid parameters");
return task->name;
}
*/
void MSG_task_set_name(m_task_t task, const char *name)
{
- xbt_assert0(task, "Invalid parameters");
+ xbt_assert(task, "Invalid parameters");
task->name = xbt_strdup(name);
}
MSG_error_t MSG_task_destroy(m_task_t task)
{
smx_action_t action = NULL;
- xbt_assert0((task != NULL), "Invalid parameter");
+ xbt_assert((task != NULL), "Invalid parameter");
/* why? if somebody is using, then you can't free! ok... but will return MSG_OK? when this task will be destroyed? isn't the user code wrong? */
if (task->simdata->isused > 0) {
*/
MSG_error_t MSG_task_cancel(m_task_t task)
{
- xbt_assert0((task != NULL), "Invalid parameter");
+ xbt_assert((task != NULL), "Invalid parameter");
if (task->simdata->compute) {
SIMIX_req_host_execution_cancel(task->simdata->compute);
*/
double MSG_task_get_compute_duration(m_task_t task)
{
- xbt_assert0((task != NULL)
+ xbt_assert((task != NULL)
&& (task->simdata != NULL), "Invalid parameter");
return task->simdata->computation_amount;
void MSG_task_set_compute_duration(m_task_t task,
double computation_amount)
{
- xbt_assert0(task, "Invalid parameter");
+ xbt_assert(task, "Invalid parameter");
task->simdata->computation_amount = computation_amount;
}
*/
double MSG_task_get_remaining_computation(m_task_t task)
{
- xbt_assert0((task != NULL)
+ xbt_assert((task != NULL)
&& (task->simdata != NULL), "Invalid parameter");
if (task->simdata->compute) {
*/
double MSG_task_get_remaining_communication(m_task_t task)
{
- xbt_assert0((task != NULL)
+ xbt_assert((task != NULL)
&& (task->simdata != NULL), "Invalid parameter");
XBT_DEBUG("calling SIMIX_req_communication_get_remains(%p)",
task->simdata->comm);
*/
int MSG_task_is_latency_bounded(m_task_t task)
{
- xbt_assert0((task != NULL)
+ xbt_assert((task != NULL)
&& (task->simdata != NULL), "Invalid parameter");
XBT_DEBUG("calling SIMIX_req_communication_is_latency_bounded(%p)",
task->simdata->comm);
*/
double MSG_task_get_data_size(m_task_t task)
{
- xbt_assert0((task != NULL)
+ xbt_assert((task != NULL)
&& (task->simdata != NULL), "Invalid parameter");
return task->simdata->message_size;
*/
void MSG_task_set_priority(m_task_t task, double priority)
{
- xbt_assert0((task != NULL)
+ xbt_assert((task != NULL)
&& (task->simdata != NULL), "Invalid parameter");
task->simdata->priority = 1 / priority;
#include <stdbool.h>
#define SD_INITIALISED() (sd_global != NULL)
-#define SD_CHECK_INIT_DONE() xbt_assert0(SD_INITIALISED(), "Call SD_init() first");
+#define SD_CHECK_INIT_DONE() xbt_assert(SD_INITIALISED(), "Call SD_init() first");
/* Global variables */
SD_task_t file;
char *name;
FILE *in_file = fopen(filename, "r");
- xbt_assert1(in_file, "Unable to open \"%s\"\n", filename);
+ xbt_assert(in_file, "Unable to open \"%s\"\n", filename);
input_buffer = dax__create_buffer(in_file, 10);
dax__switch_to_buffer(input_buffer);
dax_lineno = 1;
int res;
res = dax_lex();
- xbt_assert2(!res, "Parse error in %s: %s", filename,
+ xbt_assert(!res, "Parse error in %s: %s", filename,
dax__parse_err_msg());
dax__delete_buffer(input_buffer);
fclose(in_file);
double version;
version = dax_parse_double(A_dax__adag_version);
- xbt_assert1(version == 2.1,
+ xbt_assert(version == 2.1,
"Expected version 2.1 in <adag> tag, got %f. Fix the parser or your file",
version);
}
xbt_dynar_t SD_dotload_generic(const char * filename)
{
- xbt_assert0(filename, "Unable to use a null file descriptor\n");
+ xbt_assert(filename, "Unable to use a null file descriptor\n");
dag_dot = agopen((char*)filename,Agstrictdirected,0);
result = xbt_dynar_new(sizeof(SD_task_t), dot_task_free);
s_SD_task_t task;
- xbt_assert0(!SD_INITIALISED(), "SD_init() already called");
+ xbt_assert(!SD_INITIALISED(), "SD_init() already called");
/* Connect our log channels: that must be done manually under windows */
XBT_LOG_CONNECT(sd_kernel, sd);
const char *name;
SD_CHECK_INIT_DONE();
- xbt_assert0(surf_link != NULL, "surf_link is NULL !");
+ xbt_assert(surf_link != NULL, "surf_link is NULL !");
link = xbt_new(s_SD_link_t, 1);
link->surf_link = surf_link;
int i;
SD_CHECK_INIT_DONE();
- xbt_assert0(SD_link_get_number() > 0, "There is no link!");
+ xbt_assert(SD_link_get_number() > 0, "There is no link!");
if (sd_global->link_list == NULL) { /* this is the first time the function is called */
sd_global->link_list = xbt_new(SD_link_t, link_lib->count);
void *SD_link_get_data(SD_link_t link)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(link != NULL, "Invalid parameter");
+ xbt_assert(link != NULL, "Invalid parameter");
return link->data;
}
void SD_link_set_data(SD_link_t link, void *data)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(link != NULL, "Invalid parameter");
+ xbt_assert(link != NULL, "Invalid parameter");
link->data = data;
}
const char *SD_link_get_name(SD_link_t link)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(link != NULL, "Invalid parameter");
+ xbt_assert(link != NULL, "Invalid parameter");
return surf_resource_name(link->surf_link);
}
double SD_link_get_current_bandwidth(SD_link_t link)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(link != NULL, "Invalid parameter");
+ xbt_assert(link != NULL, "Invalid parameter");
return surf_workstation_model->extension.workstation.
get_link_bandwidth(link->surf_link);
}
double SD_link_get_current_latency(SD_link_t link)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(link != NULL, "Invalid parameter");
+ xbt_assert(link != NULL, "Invalid parameter");
return surf_workstation_model->extension.workstation.
get_link_latency(link->surf_link);
}
e_SD_link_sharing_policy_t SD_link_get_sharing_policy(SD_link_t link)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(link != NULL, "Invalid parameter");
+ xbt_assert(link != NULL, "Invalid parameter");
return link->sharing_policy;
}
void __SD_link_destroy(void *link)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(link != NULL, "Invalid parameter");
+ xbt_assert(link != NULL, "Invalid parameter");
/* link->surf_link is freed by surf_exit and link->data is freed by the user */
xbt_free(link);
}
void *SD_task_get_data(SD_task_t task)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
+ xbt_assert(task != NULL, "Invalid parameter");
return task->data;
}
void SD_task_set_data(SD_task_t task, void *data)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
+ xbt_assert(task != NULL, "Invalid parameter");
task->data = data;
}
e_SD_task_state_t SD_task_get_state(SD_task_t task)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
+ xbt_assert(task != NULL, "Invalid parameter");
return task->state;
}
const char *SD_task_get_name(SD_task_t task)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
+ xbt_assert(task != NULL, "Invalid parameter");
return task->name;
}
xbt_dynar_t parents;
SD_dependency_t dep;
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
+ xbt_assert(task != NULL, "Invalid parameter");
parents = xbt_dynar_new(sizeof(SD_task_t), NULL);
xbt_dynar_foreach(task->tasks_before, i, dep) {
xbt_dynar_t children;
SD_dependency_t dep;
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
+ xbt_assert(task != NULL, "Invalid parameter");
children = xbt_dynar_new(sizeof(SD_task_t), NULL);
xbt_dynar_foreach(task->tasks_after, i, dep) {
int SD_task_get_workstation_count(SD_task_t task)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
- // xbt_assert1( task->state_set != sd_global->scheduled_task_set,
+ xbt_assert(task != NULL, "Invalid parameter");
+ //xbt_assert(task->state_set != sd_global->scheduled_task_set,
// "Unscheduled task %s", task->name);
return task->workstation_nb;
}
SD_workstation_t *SD_task_get_workstation_list(SD_task_t task)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
- //xbt_assert1( task->state_set != sd_global->scheduled_task_set,
+ xbt_assert(task != NULL, "Invalid parameter");
+ //xbt_assert(task->state_set != sd_global->scheduled_task_set,
// "Unscheduled task %s", task->name);
return task->workstation_list;
}
double SD_task_get_amount(SD_task_t task)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
+ xbt_assert(task != NULL, "Invalid parameter");
return task->amount;
}
double SD_task_get_remaining_amount(SD_task_t task)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
+ xbt_assert(task != NULL, "Invalid parameter");
if (task->surf_action)
return surf_workstation_model->get_remains(task->surf_action);
SD_dependency_t dependency;
SD_CHECK_INIT_DONE();
- xbt_assert0(src != NULL && dst != NULL, "Invalid parameter");
+ xbt_assert(src != NULL && dst != NULL, "Invalid parameter");
dynar = src->tasks_after;
length = xbt_dynar_length(dynar);
SD_dependency_t dependency;
SD_CHECK_INIT_DONE();
- xbt_assert0(src != NULL
+ xbt_assert(src != NULL
|| dst != NULL,
"Invalid parameter: both src and dst are NULL");
SD_dependency_t dependency;
SD_CHECK_INIT_DONE();
- xbt_assert0(src != NULL && dst != NULL, "Invalid parameter");
+ xbt_assert(src != NULL && dst != NULL, "Invalid parameter");
/* remove the dependency from src->tasks_after */
dynar = src->tasks_after;
}
}
/* should never happen... */
- xbt_assert4(found,
+ xbt_assert(found,
"SimDag error: task '%s' is a successor of '%s' but task '%s' is not a predecessor of task '%s'",
SD_task_get_name(dst), SD_task_get_name(src),
SD_task_get_name(src), SD_task_get_name(dst));
SD_CHECK_INIT_DONE();
- xbt_assert0(src != NULL && dst != NULL, "Invalid parameter");
+ xbt_assert(src != NULL && dst != NULL, "Invalid parameter");
dynar = src->tasks_after;
length = xbt_dynar_length(dynar);
void SD_task_watch(SD_task_t task, e_SD_task_state_t state)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
+ xbt_assert(task != NULL, "Invalid parameter");
if (state & SD_NOT_SCHEDULED)
THROWF(arg_error, 0,
void SD_task_unwatch(SD_task_t task, e_SD_task_state_t state)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
- xbt_assert0(state != SD_NOT_SCHEDULED,
+ xbt_assert(task != NULL, "Invalid parameter");
+ xbt_assert(state != SD_NOT_SCHEDULED,
"SimDag error: Cannot have a watch point for state SD_NOT_SCHEDULED");
task->watch_points = task->watch_points & ~state;
double time, max_time = 0.0;
int i, j;
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL && workstation_nb > 0
+ xbt_assert(task != NULL && workstation_nb > 0
&& workstation_list != NULL, "Invalid parameter");
/* the task execution time is the maximum execution time of the parallel tasks */
int communication_nb;
task->workstation_nb = 0;
task->rate = -1;
- xbt_assert0(workstation_count > 0, "workstation_nb must be positive");
+ xbt_assert(workstation_count > 0, "workstation_nb must be positive");
task->workstation_nb = workstation_count;
task->rate = rate;
void SD_task_unschedule(SD_task_t task)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
+ xbt_assert(task != NULL, "Invalid parameter");
if (task->state_set != sd_global->scheduled_task_set &&
task->state_set != sd_global->runnable_task_set &&
void **surf_workstations;
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
- xbt_assert2(__SD_task_is_runnable_or_in_fifo(task),
+ xbt_assert(task != NULL, "Invalid parameter");
+ xbt_assert(__SD_task_is_runnable_or_in_fifo(task),
"Task '%s' is not runnable or in a fifo! Task state: %d",
SD_task_get_name(task), SD_task_get_state(task));
- xbt_assert1(task->workstation_list != NULL,
+ xbt_assert(task->workstation_list != NULL,
"Task '%s': workstation_list is NULL!",
SD_task_get_name(task));
if (SD_workstation_get_access_mode(task->workstation_list[i]) ==
SD_WORKSTATION_SEQUENTIAL_ACCESS) {
task->workstation_list[i]->current_task = task;
- xbt_assert0(__SD_workstation_is_busy(task->workstation_list[i]),
+ xbt_assert(__SD_workstation_is_busy(task->workstation_list[i]),
"The workstation should be busy now");
}
}
__SD_task_destroy_scheduling_data(task); /* now the scheduling data are not useful anymore */
__SD_task_set_state(task, SD_RUNNING);
- xbt_assert2(__SD_task_is_running(task), "Bad state of task '%s': %d",
+ xbt_assert(__SD_task_is_running(task), "Bad state of task '%s': %d",
SD_task_get_name(task), SD_task_get_state(task));
}
SD_workstation_t workstation;
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
- xbt_assert2(__SD_task_is_runnable(task),
+ xbt_assert(task != NULL, "Invalid parameter");
+ xbt_assert(__SD_task_is_runnable(task),
"Task '%s' is not runnable! Task state: %d",
SD_task_get_name(task), SD_task_get_state(task));
}
}
__SD_task_set_state(task, SD_IN_FIFO);
- xbt_assert2(__SD_task_is_in_fifo(task), "Bad state of task '%s': %d",
+ xbt_assert(__SD_task_is_in_fifo(task), "Bad state of task '%s': %d",
SD_task_get_name(task), SD_task_get_state(task));
XBT_DEBUG("Task '%s' state is now SD_IN_FIFO", SD_task_get_name(task));
} else {
int can_start = 1;
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
- xbt_assert1(__SD_task_is_running(task),
+ xbt_assert(task != NULL, "Invalid parameter");
+ xbt_assert(__SD_task_is_running(task),
"The task must be running! Task state: %d",
SD_task_get_state(task));
- xbt_assert1(task->workstation_list != NULL,
+ xbt_assert(task->workstation_list != NULL,
"Task '%s': workstation_list is NULL!",
SD_task_get_name(task));
XBT_DEBUG("Workstation '%s': access_mode = %d",
SD_workstation_get_name(workstation), workstation->access_mode);
if (workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS) {
- xbt_assert1(workstation->task_fifo != NULL,
+ xbt_assert(workstation->task_fifo != NULL,
"Workstation '%s' has sequential access but no fifo!",
SD_workstation_get_name(workstation));
- xbt_assert2(workstation->current_task =
+ xbt_assert(workstation->current_task =
task, "Workstation '%s': current task should be '%s'",
SD_workstation_get_name(workstation),
SD_task_get_name(task));
if (candidate != NULL) {
XBT_DEBUG("Candidate: '%s'", SD_task_get_name(candidate));
- xbt_assert2(__SD_task_is_in_fifo(candidate),
+ xbt_assert(__SD_task_is_in_fifo(candidate),
"Bad state of candidate '%s': %d",
SD_task_get_name(candidate),
SD_task_get_state(candidate));
continue; /* we have already evaluated that task */
}
- xbt_assert2(__SD_task_is_in_fifo(candidate),
+ xbt_assert(__SD_task_is_in_fifo(candidate),
"Bad state of candidate '%s': %d",
SD_task_get_name(candidate), SD_task_get_state(candidate));
XBT_DEBUG("Head of the fifo: '%s'",
(candidate !=
NULL) ? SD_task_get_name(candidate) : "NULL");
- xbt_assert0(candidate == candidates[i],
+ xbt_assert(candidate == candidates[i],
"Error in __SD_task_just_done: bad first task in the fifo");
}
} /* for each workstation */
("Calling __SD_task_is_running: task '%s', state set: %p, running_task_set: %p, is running: %d",
SD_task_get_name(candidate), candidate->state_set,
sd_global->running_task_set, __SD_task_is_running(candidate));
- xbt_assert2(__SD_task_is_running(candidate),
+ xbt_assert(__SD_task_is_running(candidate),
"Bad state of task '%s': %d",
SD_task_get_name(candidate),
SD_task_get_state(candidate));
double SD_task_get_start_time(SD_task_t task)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
+ xbt_assert(task != NULL, "Invalid parameter");
if (task->surf_action)
return surf_workstation_model->
action_get_start_time(task->surf_action);
double SD_task_get_finish_time(SD_task_t task)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
+ xbt_assert(task != NULL, "Invalid parameter");
if (task->surf_action) /* should never happen as actions are destroyed right after their completion */
return surf_workstation_model->
void SD_task_destroy(SD_task_t task)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(task != NULL, "Invalid parameter");
+ xbt_assert(task != NULL, "Invalid parameter");
XBT_DEBUG("Destroying task %s...", SD_task_get_name(task));
int i;
SD_dependency_t dep;
unsigned int cpt;
- xbt_assert1(task->kind != 0,
+ xbt_assert(task->kind != 0,
"Task %s is not typed. Cannot automatically schedule it.",
SD_task_get_name(task));
switch (task->kind) {
SD_workstation_t workstation;
const char *name;
SD_CHECK_INIT_DONE();
- xbt_assert0(surf_workstation != NULL, "surf_workstation is NULL !");
+ xbt_assert(surf_workstation != NULL, "surf_workstation is NULL !");
workstation = xbt_new(s_SD_workstation_t, 1);
workstation->surf_workstation = surf_workstation;
{
SD_CHECK_INIT_DONE();
- xbt_assert0(name != NULL, "Invalid parameter");
+ xbt_assert(name != NULL, "Invalid parameter");
return xbt_lib_get_or_null(host_lib, name, SD_HOST_LEVEL);
}
int i;
SD_CHECK_INIT_DONE();
- xbt_assert0(SD_workstation_get_number() > 0, "There is no workstation!");
+ xbt_assert(SD_workstation_get_number() > 0, "There is no workstation!");
if (sd_global->workstation_list == NULL) { /* this is the first time the function is called */
sd_global->workstation_list =
void *SD_workstation_get_data(SD_workstation_t workstation)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(workstation != NULL, "Invalid parameter");
+ xbt_assert(workstation != NULL, "Invalid parameter");
return workstation->data;
}
void SD_workstation_set_data(SD_workstation_t workstation, void *data)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(workstation != NULL, "Invalid parameter");
+ xbt_assert(workstation != NULL, "Invalid parameter");
workstation->data = data;
}
const char *SD_workstation_get_name(SD_workstation_t workstation)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(workstation != NULL, "Invalid parameter");
+ xbt_assert(workstation != NULL, "Invalid parameter");
return surf_resource_name(workstation->surf_workstation);
}
xbt_dict_t SD_workstation_get_properties(SD_workstation_t workstation)
{
SD_CHECK_INIT_DONE();
- xbt_assert0((workstation != NULL), "Invalid parameters");
+ xbt_assert((workstation != NULL), "Invalid parameters");
return surf_workstation_model->extension.
workstation.get_properties(workstation->surf_workstation);
double SD_workstation_get_power(SD_workstation_t workstation)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(workstation != NULL, "Invalid parameter");
+ xbt_assert(workstation != NULL, "Invalid parameter");
return surf_workstation_model->extension.workstation.
get_speed(workstation->surf_workstation, 1.0);
}
double SD_workstation_get_available_power(SD_workstation_t workstation)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(workstation != NULL, "Invalid parameter");
+ xbt_assert(workstation != NULL, "Invalid parameter");
return surf_workstation_model->extension.
workstation.get_available_speed(workstation->surf_workstation);
}
double computation_amount)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(workstation != NULL, "Invalid parameter");
- xbt_assert0(computation_amount >= 0,
+ xbt_assert(workstation != NULL, "Invalid parameter");
+ xbt_assert(computation_amount >= 0,
"computation_amount must be greater than or equal to zero");
return computation_amount / SD_workstation_get_power(workstation);
}
int i;
SD_CHECK_INIT_DONE();
- xbt_assert0(src != NULL && dst != NULL, "Invalid parameter");
+ xbt_assert(src != NULL && dst != NULL, "Invalid parameter");
links = SD_route_get_list(src, dst);
nb_links = SD_route_get_size(src, dst);
latency = 0.0;
int i;
SD_CHECK_INIT_DONE();
- xbt_assert0(src != NULL && dst != NULL, "Invalid parameter");
+ xbt_assert(src != NULL && dst != NULL, "Invalid parameter");
links = SD_route_get_list(src, dst);
nb_links = SD_route_get_size(src, dst);
int i;
SD_CHECK_INIT_DONE();
- xbt_assert0(src != NULL && dst != NULL, "Invalid parameter");
- xbt_assert0(communication_amount >= 0,
+ xbt_assert(src != NULL && dst != NULL, "Invalid parameter");
+ xbt_assert(communication_amount >= 0,
"communication_amount must be greater than or equal to zero");
SD_workstation_get_access_mode(SD_workstation_t workstation)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(workstation != NULL, "Invalid parameter");
+ xbt_assert(workstation != NULL, "Invalid parameter");
return workstation->access_mode;
}
access_mode)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(workstation != NULL, "Invalid parameter");
+ xbt_assert(workstation != NULL, "Invalid parameter");
if (access_mode == workstation->access_mode) {
return; // nothing is changed
*//*
int __SD_workstation_can_start(SD_workstation_t workstation, SD_task_t task) {
SD_CHECK_INIT_DONE();
- xbt_assert0(workstation != NULL && task != NULL, "Invalid parameter");
+ xbt_assert(workstation != NULL && task != NULL, "Invalid parameter");
return !__SD_workstation_is_busy(workstation) &&
(xbt_fifo_size(workstation->task_fifo) == 0) || xbt_fifo_get_first_item(workstation->task_fifo) == task);
int __SD_workstation_is_busy(SD_workstation_t workstation)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(workstation != NULL, "Invalid parameter");
+ xbt_assert(workstation != NULL, "Invalid parameter");
XBT_DEBUG
("Workstation '%s' access mode: '%s', current task: %s, fifo size: %d",
SD_workstation_t w;
SD_CHECK_INIT_DONE();
- xbt_assert0(workstation != NULL, "Invalid parameter");
+ xbt_assert(workstation != NULL, "Invalid parameter");
/* workstation->surf_workstation is freed by surf_exit and workstation->data is freed by the user */
w = (SD_workstation_t) workstation;
SD_task_t SD_workstation_get_current_task(SD_workstation_t workstation)
{
SD_CHECK_INIT_DONE();
- xbt_assert0(workstation != NULL, "Invalid parameter");
- xbt_assert0(workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS,
+ xbt_assert(workstation != NULL, "Invalid parameter");
+ xbt_assert(workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS,
"Access mode must be set to SD_WORKSTATION_SEQUENTIAL_ACCESS"
" to use this function");
*/
XBT_INLINE void SIMIX_context_set_nthreads(int nb_threads) {
- xbt_assert1(nb_threads > 0, "Invalid number of parallel threads: %d", nb_threads);
+ xbt_assert(nb_threads > 0, "Invalid number of parallel threads: %d", nb_threads);
if (nb_threads > 1) {
#ifndef CONTEXT_THREADS
int res;
res = getcontext(&(context->uc));
- xbt_assert2(res == 0,
+ xbt_assert(res == 0,
"Error in context saving: %d (%s)", errno,
strerror(errno));
int rv;
rv = swapcontext(&((smx_ctx_sysv_t) context)->uc, &((smx_ctx_sysv_t)context)->old_uc);
- xbt_assert0((rv == 0), "Context swapping failure");
+ xbt_assert((rv == 0), "Context swapping failure");
}
void smx_ctx_sysv_resume(smx_context_t context)
int rv;
rv = swapcontext(&((smx_ctx_sysv_t)context)->old_uc, &((smx_ctx_sysv_t) context)->uc);
- xbt_assert0((rv == 0), "Context swapping failure");
+ xbt_assert((rv == 0), "Context swapping failure");
}
void smx_ctx_sysv_runall(xbt_dynar_t processes)
rv = swapcontext(&((smx_ctx_sysv_t)context)->old_uc, &((smx_ctx_sysv_t) context)->uc);
smx_current_context = (smx_context_t)maestro_context;
- xbt_assert0((rv == 0), "Context swapping failure");
+ xbt_assert((rv == 0), "Context swapping failure");
}
void smx_ctx_sysv_runall_parallel(xbt_dynar_t processes)
static void parse_process_init(void)
{
parse_host = xbt_strdup(A_surfxml_process_host);
- xbt_assert1(SIMIX_host_get_by_name(parse_host),
+ xbt_assert(SIMIX_host_get_by_name(parse_host),
"Host '%s' unknown", parse_host);
parse_code = SIMIX_get_registered_function(A_surfxml_process_function);
- xbt_assert1(parse_code, "Function '%s' unknown",
+ xbt_assert(parse_code, "Function '%s' unknown",
A_surfxml_process_function);
parse_argc = 0;
parse_argv = NULL;
void SIMIX_launch_application(const char *file)
{
int parse_status;
- xbt_assert0(simix_global,
+ xbt_assert(simix_global,
"SIMIX_global_init has to be called before SIMIX_launch_application.");
// Reset callbacks
surf_parse_open(file);
parse_status = surf_parse();
surf_parse_close();
- xbt_assert1(!parse_status, "Parse error in %s", file);
+ xbt_assert(!parse_status, "Parse error in %s", file);
}
/**
XBT_INLINE void SIMIX_function_register(const char *name,
xbt_main_func_t code)
{
- xbt_assert0(simix_global,
+ xbt_assert(simix_global,
"SIMIX_global_init has to be called before SIMIX_function_register.");
xbt_dict_set(simix_global->registered_functions, name, code, NULL);
*/
void SIMIX_function_register_default(xbt_main_func_t code)
{
- xbt_assert0(simix_global,
+ xbt_assert(simix_global,
"SIMIX_global_init has to be called before SIMIX_function_register.");
default_function = code;
xbt_main_func_t SIMIX_get_registered_function(const char *name)
{
xbt_main_func_t res = NULL;
- xbt_assert0(simix_global,
+ xbt_assert(simix_global,
"SIMIX_global_init has to be called before SIMIX_get_registered_function.");
res = xbt_dict_get_or_null(simix_global->registered_functions, name);
/* init process */
parse_host = xbt_strdup(process_host);
- xbt_assert1(SIMIX_host_get_by_name(parse_host),
+ xbt_assert(SIMIX_host_get_by_name(parse_host),
"Host '%s' unknown", parse_host);
parse_code = SIMIX_get_registered_function(process_function);
- xbt_assert1(parse_code, "Function '%s' unknown", process_function);
+ xbt_assert(parse_code, "Function '%s' unknown", process_function);
parse_argc = 0;
parse_argv = NULL;
{
smx_host_t host = (smx_host_t) h;
- xbt_assert0((host != NULL), "Invalid parameters");
+ xbt_assert((host != NULL), "Invalid parameters");
/* Clean Simulator data */
if (xbt_swag_size(host->process_list) != 0) {
smx_host_t SIMIX_host_get_by_name(const char *name)
{
- xbt_assert0(((simix_global != NULL)
+ xbt_assert(((simix_global != NULL)
&& (host_lib != NULL)),
"Environment not set yet");
const char* SIMIX_host_get_name(smx_host_t host)
{
- xbt_assert0((host != NULL), "Invalid parameters");
+ xbt_assert((host != NULL), "Invalid parameters");
return host->name;
}
xbt_dict_t SIMIX_host_get_properties(smx_host_t host)
{
- xbt_assert0((host != NULL), "Invalid parameters (simix host is NULL)");
+ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
return surf_workstation_model->extension.workstation.get_properties(host->host);
}
double SIMIX_host_get_speed(smx_host_t host)
{
- xbt_assert0((host != NULL), "Invalid parameters (simix host is NULL)");
+ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
return surf_workstation_model->extension.workstation.
get_speed(host->host, 1.0);
double SIMIX_host_get_available_speed(smx_host_t host)
{
- xbt_assert0((host != NULL), "Invalid parameters (simix host is NULL)");
+ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
return surf_workstation_model->extension.workstation.
get_available_speed(host->host);
int SIMIX_host_get_state(smx_host_t host)
{
- xbt_assert0((host != NULL), "Invalid parameters (simix host is NULL)");
+ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
return surf_workstation_model->extension.workstation.
get_state(host->host);
void* SIMIX_host_get_data(smx_host_t host)
{
- xbt_assert0((host != NULL), "Invalid parameters (simix host is NULL)");
+ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
return host->data;
}
void SIMIX_host_set_data(smx_host_t host, void *data)
{
- xbt_assert0((host != NULL), "Invalid parameters");
- xbt_assert0((host->data == NULL), "Data already set");
+ xbt_assert((host != NULL), "Invalid parameters");
+ xbt_assert((host->data == NULL), "Data already set");
host->data = data;
}
void SIMIX_comm_copy_pointer_callback(smx_action_t comm, size_t buff_size)
{
- xbt_assert1((buff_size == sizeof(void *)),
+ xbt_assert((buff_size == sizeof(void *)),
"Cannot copy %zu bytes: must be sizeof(void*)", buff_size);
*(void **) (comm->comm.dst_buff) = comm->comm.src_buff;
}
else {
*process = xbt_new0(s_smx_process_t, 1);
- xbt_assert0(((code != NULL) && (host != NULL)), "Invalid parameters");
+ xbt_assert(((code != NULL) && (host != NULL)), "Invalid parameters");
/* Process data */
(*process)->pid = simix_process_maxpid++;
{
smx_host_t h1 = NULL;
smx_host_t h2 = NULL;
- xbt_assert0((process != NULL), "Invalid parameters");
+ xbt_assert((process != NULL), "Invalid parameters");
h1 = SIMIX_host_get_by_name(source);
h2 = SIMIX_host_get_by_name(dest);
process->smx_host = h2;
void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
{
- xbt_assert0((process != NULL), "Invalid parameters");
+ xbt_assert((process != NULL), "Invalid parameters");
process->suspended = 0;
XBT_DEBUG("Destroy condition %p", cond);
if (cond != NULL) {
- xbt_assert0(xbt_swag_size(cond->sleeping) == 0,
+ xbt_assert(xbt_swag_size(cond->sleeping) == 0,
"Cannot destroy conditional since someone is still using it");
xbt_swag_free(cond->sleeping);
{
XBT_DEBUG("Destroy semaphore %p", sem);
if (sem != NULL) {
- xbt_assert0(xbt_swag_size(sem->sleeping) == 0,
+ xbt_assert(xbt_swag_size(sem->sleeping) == 0,
"Cannot destroy semaphore since someone is still using it");
xbt_swag_free(sem->sleeping);
xbt_free(sem);
*/
void SIMIX_req_process_suspend(smx_process_t process)
{
- xbt_assert0(process, "Invalid parameters");
+ xbt_assert(process, "Invalid parameters");
smx_req_t req = SIMIX_req_mine();
smx_rdv_t SIMIX_req_rdv_get_by_name(const char *name)
{
- xbt_assert0(name != NULL, "Invalid parameter for SIMIX_req_rdv_get_by_name (name is NULL)");
+ xbt_assert(name != NULL, "Invalid parameter for SIMIX_req_rdv_get_by_name (name is NULL)");
/* FIXME: this is a horrible lost of performance, so we hack it out by
* skipping the request (for now). It won't work on distributed but
int (*match_fun)(void *, void *), void *data,
double timeout)
{
- xbt_assert0(rdv, "No rendez-vous point defined for send");
+ xbt_assert(rdv, "No rendez-vous point defined for send");
if (MC_IS_ENABLED) {
/* the model-checker wants two separate requests */
int (*match_fun)(void *, void *), void *data,
int detached)
{
- xbt_assert0(rdv, "No rendez-vous point defined for isend");
+ xbt_assert(rdv, "No rendez-vous point defined for isend");
smx_req_t req = SIMIX_req_mine();
void SIMIX_req_comm_recv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size,
int (*match_fun)(void *, void *), void *data, double timeout)
{
- xbt_assert0(rdv, "No rendez-vous point defined for recv");
+ xbt_assert(rdv, "No rendez-vous point defined for recv");
if (MC_IS_ENABLED) {
/* the model-checker wants two separate requests */
smx_action_t SIMIX_req_comm_irecv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size,
int (*match_fun)(void *, void *), void *data)
{
- xbt_assert0(rdv, "No rendez-vous point defined for irecv");
+ xbt_assert(rdv, "No rendez-vous point defined for irecv");
smx_req_t req = SIMIX_req_mine();
void SIMIX_req_comm_destroy(smx_action_t comm)
{
- xbt_assert0(comm, "Invalid parameter");
+ xbt_assert(comm, "Invalid parameter");
/* FIXME remove this request type: comms are auto-destroyed now,
* but what happens with unfinished comms? */
MPI_Request ref = (MPI_Request)a;
MPI_Request req = (MPI_Request)b;
- xbt_assert0(ref, "Cannot match recv against null reference");
- xbt_assert0(req, "Cannot match recv against null request");
+ xbt_assert(ref, "Cannot match recv against null reference");
+ xbt_assert(req, "Cannot match recv against null request");
return req->comm == ref->comm
&& (ref->src == MPI_ANY_SOURCE || req->src == ref->src)
&& (ref->tag == MPI_ANY_TAG || req->tag == ref->tag);
MPI_Request ref = (MPI_Request)a;
MPI_Request req = (MPI_Request)b;
- xbt_assert0(ref, "Cannot match send against null reference");
- xbt_assert0(req, "Cannot match send against null request");
+ xbt_assert(ref, "Cannot match send against null reference");
+ xbt_assert(req, "Cannot match send against null request");
return req->comm == ref->comm
&& (req->src == MPI_ANY_SOURCE || req->src == ref->src)
&& (req->tag == MPI_ANY_TAG || req->tag == ref->tag);
{
smx_rdv_t mailbox;
- xbt_assert0(!request->action,
+ xbt_assert(!request->action,
"Cannot (re)start a non-finished communication");
if(request->flags & RECV) {
print_request("New recv", request);
char *loc = sample_location(global, file, line);
local_data_t *data;
- xbt_assert0(samples, "You did something very inconsistent, didn't you?");
+ xbt_assert(samples, "You did something very inconsistent, didn't you?");
data = xbt_dict_get_or_null(samples, loc);
if (!data) {
- xbt_assert0(data, "Please, do thing in order");
+ xbt_assert(data, "Please, do thing in order");
}
if (!data->started) {
if ((data->iters > 0 && data->count >= data->iters)
local_data_t *data;
double sample, n;
- xbt_assert0(samples, "You did something very inconsistent, didn't you?");
+ xbt_assert(samples, "You did something very inconsistent, didn't you?");
data = xbt_dict_get_or_null(samples, loc);
smpi_bench_end();
if(data && data->started && data->count < data->iters) {
xbt_dict_t cpu_properties)
{
cpu_Cas01_t cpu = xbt_new0(s_cpu_Cas01_t, 1);
- xbt_assert1(!surf_cpu_resource_by_name(name),
+ xbt_assert(!surf_cpu_resource_by_name(name),
"Host '%s' declared several times in the platform file",
name);
cpu->generic_resource.model = surf_cpu_model;
cpu->generic_resource.name = name;
cpu->generic_resource.properties = cpu_properties;
cpu->power_peak = power_peak;
- xbt_assert0(cpu->power_peak > 0, "Power has to be >0");
+ xbt_assert(cpu->power_peak > 0, "Power has to be >0");
cpu->power_scale = power_scale;
cpu->core = core;
- xbt_assert1(core>0,"Invalid number of cores %d",core);
+ xbt_assert(core>0,"Invalid number of cores %d",core);
if (power_trace)
cpu->power_event =
tmgr_history_add_trace(history, power_trace, 0.0, 0, cpu);
power_trace = tmgr_trace_new(A_surfxml_host_availability_file);
surf_parse_get_int(&core, A_surfxml_host_core);
- xbt_assert0((A_surfxml_host_state == A_surfxml_host_state_ON) ||
+ xbt_assert((A_surfxml_host_state == A_surfxml_host_state_ON) ||
(A_surfxml_host_state == A_surfxml_host_state_OFF),
"Invalid state");
if (A_surfxml_host_state == A_surfxml_host_state_ON)
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
cpu_Cas01_t host = surf_cpu_resource_by_name(elm);
- xbt_assert1(host, "Host %s undefined", elm);
- xbt_assert1(trace, "Trace %s undefined", trace_name);
+ xbt_assert(host, "Host %s undefined", elm);
+ xbt_assert(trace, "Trace %s undefined", trace_name);
host->state_event =
tmgr_history_add_trace(history, trace, 0.0, 0, host);
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
cpu_Cas01_t host = surf_cpu_resource_by_name(elm);
- xbt_assert1(host, "Host %s undefined", elm);
- xbt_assert1(trace, "Trace %s undefined", trace_name);
+ xbt_assert(host, "Host %s undefined", elm);
+ xbt_assert(trace, "Trace %s undefined", trace_name);
host->power_event =
tmgr_history_add_trace(history, trace, 0.0, 0, host);
s_surf_action_cpu_Cas01_im_t action;
cpu = xbt_new0(s_cpu_Cas01_im_t, 1);
- xbt_assert1(!surf_cpu_resource_by_name(name),
+ xbt_assert(!surf_cpu_resource_by_name(name),
"Host '%s' declared several times in the platform file",
name);
cpu->generic_resource.model = surf_cpu_model;
cpu->generic_resource.name = name;
cpu->generic_resource.properties = cpu_properties;
cpu->power_peak = power_peak;
- xbt_assert0(cpu->power_peak > 0, "Power has to be >0");
+ xbt_assert(cpu->power_peak > 0, "Power has to be >0");
cpu->power_scale = power_scale;
if (power_trace)
cpu->power_event =
tmgr_history_add_trace(history, power_trace, 0.0, 0, cpu);
cpu->core = core;
- xbt_assert1(core>0,"Invalid number of cores %d",core);
+ xbt_assert(core>0,"Invalid number of cores %d",core);
cpu->state_current = state_initial;
if (state_trace)
power_trace = tmgr_trace_new(A_surfxml_host_availability_file);
surf_parse_get_int(&core, A_surfxml_host_core);
- xbt_assert0((A_surfxml_host_state == A_surfxml_host_state_ON) ||
+ xbt_assert((A_surfxml_host_state == A_surfxml_host_state_ON) ||
(A_surfxml_host_state == A_surfxml_host_state_OFF),
"Invalid state");
if (A_surfxml_host_state == A_surfxml_host_state_ON)
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
cpu_Cas01_im_t host = surf_cpu_resource_by_name(elm);
- xbt_assert1(host, "Host %s undefined", elm);
- xbt_assert1(trace, "Trace %s undefined", trace_name);
+ xbt_assert(host, "Host %s undefined", elm);
+ xbt_assert(trace, "Trace %s undefined", trace_name);
host->state_event =
tmgr_history_add_trace(history, trace, 0.0, 0, host);
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
cpu_Cas01_im_t host = surf_cpu_resource_by_name(elm);
- xbt_assert1(host, "Host %s undefined", elm);
- xbt_assert1(trace, "Trace %s undefined", trace_name);
+ xbt_assert(host, "Host %s undefined", elm);
+ xbt_assert(trace, "Trace %s undefined", trace_name);
host->power_event =
tmgr_history_add_trace(history, trace, 0.0, 0, host);
s_tmgr_event_t val;
cpu_ti_t cpu = xbt_new0(s_cpu_ti_t, 1);
s_surf_action_cpu_ti_t ti_action;
- xbt_assert1(!surf_cpu_resource_by_name(name),
+ xbt_assert(!surf_cpu_resource_by_name(name),
"Host '%s' declared several times in the platform file",
name);
- xbt_assert0(core==1,"Multi-core not handled with this model yet");
+ xbt_assert(core==1,"Multi-core not handled with this model yet");
cpu->action_set =
xbt_swag_new(xbt_swag_offset(ti_action, cpu_list_hookup));
cpu->generic_resource.model = surf_cpu_model;
cpu->generic_resource.name = name;
cpu->generic_resource.properties = cpu_properties;
cpu->power_peak = power_peak;
- xbt_assert0(cpu->power_peak > 0, "Power has to be >0");
+ xbt_assert(cpu->power_peak > 0, "Power has to be >0");
XBT_DEBUG("power scale %lf", power_scale);
cpu->power_scale = power_scale;
cpu->avail_trace = cpu_ti_parse_trace(power_trace, power_scale);
power_trace = tmgr_trace_new(A_surfxml_host_availability_file);
surf_parse_get_int(&core, A_surfxml_host_core);
- xbt_assert0((A_surfxml_host_state == A_surfxml_host_state_ON) ||
+ xbt_assert((A_surfxml_host_state == A_surfxml_host_state_ON) ||
(A_surfxml_host_state == A_surfxml_host_state_OFF),
"Invalid state");
if (A_surfxml_host_state == A_surfxml_host_state_ON)
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
cpu_ti_t cpu = surf_cpu_resource_by_name(elm);
- xbt_assert1(cpu, "Host %s undefined", elm);
- xbt_assert1(trace, "Trace %s undefined", trace_name);
+ xbt_assert(cpu, "Host %s undefined", elm);
+ xbt_assert(trace, "Trace %s undefined", trace_name);
if (cpu->state_event) {
XBT_DEBUG("Trace already configured for this CPU(%s), ignoring it",
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
cpu_ti_t cpu = surf_cpu_resource_by_name(elm);
- xbt_assert1(cpu, "Host %s undefined", elm);
- xbt_assert1(trace, "Trace %s undefined", trace_name);
+ xbt_assert(cpu, "Host %s undefined", elm);
+ xbt_assert(trace, "Trace %s undefined", trace_name);
XBT_DEBUG("Add power trace: %s to CPU(%s)", trace_name, elm);
if (cpu->avail_trace)
tmgr_trace_t state_trace,
xbt_dict_t cpu_properties)
{
- xbt_assert0(core==1,"Multi-core not handled with this model yet");
+ xbt_assert(core==1,"Multi-core not handled with this model yet");
cpu_ti_new(name, power_peak, power_scale, power_trace, core,
state_initial, state_trace, cpu_properties);
}
// initialize the GTNetS interface and environment
int gtnets_initialize(int wsize){
XBT_DEBUG("Using logging.");
- xbt_assert0(!gtnets_sim, "gtnets already initialized");
+ xbt_assert(!gtnets_sim, "gtnets already initialized");
if(wsize > 0){
XBT_INFO("TCP window maximum size : %d", wsize);
}
int GTSim::add_router(int id){
- xbt_assert1(!(topo_->add_router(id) < 0), "can't add router %d. already exists", id);
+ xbt_assert(!(topo_->add_router(id) < 0), "can't add router %d. already exists", id);
}
//bandwidth: in bytes.
//latency: in seconds.
int GTSim::add_link(int id, double bandwidth, double latency){
double bw = bandwidth * 8; //Bandwidth in bits (used in GTNETS).
- xbt_assert1(!(topo_->add_link(id) < 0),"Can't add link %d. already exists", id);
+ xbt_assert(!(topo_->add_link(id) < 0),"Can't add link %d. already exists", id);
XBT_DEBUG("Creating a new P2P, linkid %d, bandwidth %gl, latency %gl", id, bandwidth, latency);
gtnets_links_[id] = new Linkp2p(bw, latency);
if(jitter_ > 0){
}
int GTSim::add_onehop_route(int src, int dst, int link){
- xbt_assert3(!(topo_->add_onehop_route(src, dst, link) < 0), "Cannot add a route, src: %d, dst: %d, link: %d", src, dst, link);
+ xbt_assert(!(topo_->add_onehop_route(src, dst, link) < 0), "Cannot add a route, src: %d, dst: %d, link: %d", src, dst, link);
return 0;
}
int src_node = topo_->nodeid_from_hostid(src);
int dst_node = topo_->nodeid_from_hostid(dst);
- xbt_assert1(!(gtnets_nodes_.find(src_node) == gtnets_nodes_.end()), "Node %d not found", src_node);
- xbt_assert1(!(gtnets_nodes_.find(dst_node) == gtnets_nodes_.end()), "Node %d not found", dst_node);
+ xbt_assert(!(gtnets_nodes_.find(src_node) == gtnets_nodes_.end()), "Node %d not found", src_node);
+ xbt_assert(!(gtnets_nodes_.find(dst_node) == gtnets_nodes_.end()), "Node %d not found", dst_node);
Node* tmpsrc = gtnets_nodes_[src_node];
Node* tmpdst = gtnets_nodes_[dst_node];
cur_node = src_node;
for (int i = 0; i < nlink; i++){
- xbt_assert1(!(gtnets_nodes_.find(cur_node) == gtnets_nodes_.end()), "Node %d not found", cur_node);
+ xbt_assert(!(gtnets_nodes_.find(cur_node) == gtnets_nodes_.end()), "Node %d not found", cur_node);
next_node = topo_->peer_node_id(links[i], cur_node);
- xbt_assert0(!(next_node < 0), "Peer node not found");
- xbt_assert1(!(gtnets_nodes_.find(next_node) == gtnets_nodes_.end()), "Node %d not found", next_node);
+ xbt_assert(!(next_node < 0), "Peer node not found");
+ xbt_assert(!(gtnets_nodes_.find(next_node) == gtnets_nodes_.end()), "Node %d not found", next_node);
//add route
Node* tmpcur = gtnets_nodes_[cur_node];
cur_node = next_node;
}
- xbt_assert2(!(cur_node != dst_node), "Route inconsistency, last: %d, dst: %d",cur_node, dst_node);
+ xbt_assert(!(cur_node != dst_node), "Route inconsistency, last: %d, dst: %d",cur_node, dst_node);
return 0;
}
}
int src_node = topo_->nodeid_from_hostid(src);
- xbt_assert1(!(src_node < 0), "Src %d not found", src_node);
+ xbt_assert(!(src_node < 0), "Src %d not found", src_node);
int dst_node = topo_->nodeid_from_hostid(dst);
- xbt_assert1(!(dst_node < 0), "Dst %d not found", dst_node);
+ xbt_assert(!(dst_node < 0), "Dst %d not found", dst_node);
gtnets_servers_[nflow_] = (TCPServer*) gtnets_nodes_[dst_node]->
AddApplication(TCPServer(TCPReno()));
}
void GTSim::set_jitter(double d){
- xbt_assert1(((0 <= d)&&(d <= 1)), "The jitter value must be within interval [0.0;1.0), got %f", d);
+ xbt_assert(((0 <= d)&&(d <= 1)), "The jitter value must be within interval [0.0;1.0), got %f", d);
jitter_ = d;
}
// hostid = network_card_id
int GTNETS_Node::add_host(int hostid){
- xbt_assert0(!(is_router_), "Cannot add a host to a router node");
+ xbt_assert(!(is_router_), "Cannot add a host to a router node");
hosts_.insert(hostid);
return 0;
}
// Add a router. If this node already has a router/host,
// return -1.
int GTNETS_Node::add_router(int routerid){
- xbt_assert0(!(hosts_.size() > 1), "Router node should have only one router");
+ xbt_assert(!(hosts_.size() > 1), "Router node should have only one router");
if (hosts_.size() == 1){
- xbt_assert1((hosts_.find(routerid) != hosts_.end()), "Node %d is a different router", routerid);
+ xbt_assert((hosts_.find(routerid) != hosts_.end()), "Node %d is a different router", routerid);
return 0;
}
is_router_ = true;
// return the peer node id
int GTNETS_Link::peer_node(int cur_id){
- xbt_assert0(((cur_id == src_node_->id())||(cur_id == dst_node_->id())), "Node not found");
+ xbt_assert(((cur_id == src_node_->id())||(cur_id == dst_node_->id())), "Node not found");
if (cur_id == src_node_->id()) return dst_node_->id();
else if (cur_id == dst_node_->id()) return src_node_->id();
int GTNETS_Topology::add_link(int id){
map<int,GTNETS_Link*>::iterator iter = links_.find(id);
- xbt_assert1((iter == links_.end()), "Link %d already exists", id);
+ xbt_assert((iter == links_.end()), "Link %d already exists", id);
if(iter == links_.end()) {
GTNETS_Link* link= new GTNETS_Link(id);
//return the node id of the peer of cur_id by linkid.
int GTNETS_Topology::peer_node_id(int linkid, int cur_id){
GTNETS_Link* link = links_[linkid];
- xbt_assert1((link), "Link %d not found", linkid);
- xbt_assert1(!((cur_id < 0) || (cur_id > nodes_.size()-1)), "Node %d not found", cur_id);
+ xbt_assert((link), "Link %d not found", linkid);
+ xbt_assert(!((cur_id < 0) || (cur_id > nodes_.size()-1)), "Node %d not found", cur_id);
int peer = link->peer_node(nodes_[cur_id]->id());
- xbt_assert0(!(peer < 0), "Peer not found");
+ xbt_assert(!(peer < 0), "Peer not found");
return peer;
}
map<int, GTNETS_Link*>::iterator iter = links_.find(linkid);
- xbt_assert1(!(iter == links_.end()), "Link %d not found", linkid);
+ xbt_assert(!(iter == links_.end()), "Link %d not found", linkid);
link = iter->second;
XBT_DEBUG("Add onehop route, src (#%d), dst (#%d), linkid %d:(#%d)",src, dst, linkid, link->id());
link->add_dst(nodes_[d_node_id]);
}else if (!(src_node && dst_node)){
- xbt_assert0((src_node && dst_node), "Either src or dst is null");
+ xbt_assert((src_node && dst_node), "Either src or dst is null");
}
// case 1: link has two routers
int tmpsrc2 = nodeid_from_hostid(src);
int tmpdst1 = dst_node->id();
int tmpdst2 = nodeid_from_hostid(dst);
- xbt_assert0( (((tmpsrc1 == tmpsrc2) && (tmpdst1 == tmpdst2)) ||
+ xbt_assert( (((tmpsrc1 == tmpsrc2) && (tmpdst1 == tmpdst2)) ||
((tmpsrc1 == tmpdst2) && (tmpdst1 == tmpsrc2))), "Different one hop route defined");
}
// case 2: link has one router and one host
else if (src_node->is_router() && !dst_node->is_router()){
int newsrc, newdst;
- xbt_assert0( ((is_router(src))||(is_router(dst))), "One of nodes should be a router");
+ xbt_assert( ((is_router(src))||(is_router(dst))), "One of nodes should be a router");
if (is_router(src)){
newsrc = src;
newdst = src;
}
- xbt_assert0(!(src_node->id() != nodeid_from_hostid(newsrc)), "The router should be identical");
+ xbt_assert(!(src_node->id() != nodeid_from_hostid(newsrc)), "The router should be identical");
//now, to add dst to dst_node, dst should be a host.
- xbt_assert1(!(is_router(newdst)), "Dst %d is not an endpoint. cannot add it to dst_node", newdst);
+ xbt_assert(!(is_router(newdst)), "Dst %d is not an endpoint. cannot add it to dst_node", newdst);
if (!dst_node->include(newdst)){
dst_node->add_host(newdst);
}
else if (!src_node->is_router() && dst_node->is_router()){
int newsrc, newdst;
- xbt_assert0(((is_router(src))||(is_router(dst))), "One of nodes should be a router");
+ xbt_assert(((is_router(src))||(is_router(dst))), "One of nodes should be a router");
if (is_router(src)){
newsrc = dst;
newdst = dst;
}
- xbt_assert0(!(dst_node->id() != hosts_[newdst]), "The router should be identical");
+ xbt_assert(!(dst_node->id() != hosts_[newdst]), "The router should be identical");
//now, to add dst to src_node, dst should be a host.
- xbt_assert1(!(is_router(newsrc)), "Src %d is not an endpoint. cannot add it to src_node", newsrc);
+ xbt_assert(!(is_router(newsrc)), "Src %d is not an endpoint. cannot add it to src_node", newsrc);
if (!src_node->include(newsrc)){
src_node->add_host(newsrc);
// case 3: link has two hosts
else if (!src_node->is_router() && !dst_node->is_router()){
- xbt_assert0(!(is_router(src) || is_router(dst)), "Cannot add a router to host-host link");
+ xbt_assert(!(is_router(src) || is_router(dst)), "Cannot add a router to host-host link");
//if both are hosts, the order doesn't matter.
if (src_node->include(src)){
new_obj = dual_objective(var_list, cnst_list);
XBT_DEBUG("Improvement for Objective (%g -> %g) : %g", obj, new_obj,
obj - new_obj);
- xbt_assert1(obj - new_obj >= -epsilon_min_error,
+ xbt_assert(obj - new_obj >= -epsilon_min_error,
"Our gradient sucks! (%1.20f)", obj - new_obj);
obj = new_obj;
}
new_obj = dual_objective(var_list, cnst_list);
XBT_DEBUG("Improvement for Objective (%g -> %g) : %g", obj, new_obj,
obj - new_obj);
- xbt_assert1(obj - new_obj >= -epsilon_min_error,
+ xbt_assert(obj - new_obj >= -epsilon_min_error,
"Our gradient sucks! (%1.20f)", obj - new_obj);
obj = new_obj;
}
double func_vegas_f(lmm_variable_t var, double x)
{
- xbt_assert1(x > 0.0, "Don't call me with stupid values! (%1.20f)", x);
+ xbt_assert(x > 0.0, "Don't call me with stupid values! (%1.20f)", x);
return VEGAS_SCALING * var->weight * log(x);
}
double func_vegas_fp(lmm_variable_t var, double x)
{
- xbt_assert1(x > 0.0, "Don't call me with stupid values! (%1.20f)", x);
+ xbt_assert(x > 0.0, "Don't call me with stupid values! (%1.20f)", x);
return VEGAS_SCALING * var->weight / x;
}
double func_vegas_fpi(lmm_variable_t var, double x)
{
- xbt_assert1(x > 0.0, "Don't call me with stupid values! (%1.20f)", x);
+ xbt_assert(x > 0.0, "Don't call me with stupid values! (%1.20f)", x);
return var->weight / (x / VEGAS_SCALING);
}
#define RENO_SCALING 1.0
double func_reno_f(lmm_variable_t var, double x)
{
- xbt_assert0(var->weight > 0.0, "Don't call me with stupid values!");
+ xbt_assert(var->weight > 0.0, "Don't call me with stupid values!");
return RENO_SCALING * sqrt(3.0 / 2.0) / var->weight *
atan(sqrt(3.0 / 2.0) * var->weight * x);
{
double res_fpi;
- xbt_assert0(var->weight > 0.0, "Don't call me with stupid values!");
- xbt_assert0(x > 0.0, "Don't call me with stupid values!");
+ xbt_assert(var->weight > 0.0, "Don't call me with stupid values!");
+ xbt_assert(x > 0.0, "Don't call me with stupid values!");
res_fpi =
1.0 / (var->weight * var->weight * (x / RENO_SCALING)) -
2.0 / (3.0 * var->weight * var->weight);
if (res_fpi <= 0.0)
return 0.0;
-/* xbt_assert0(res_fpi>0.0,"Don't call me with stupid values!"); */
+/* xbt_assert(res_fpi>0.0,"Don't call me with stupid values!"); */
return sqrt(res_fpi);
}
#define RENO2_SCALING 1.0
double func_reno2_f(lmm_variable_t var, double x)
{
- xbt_assert0(var->weight > 0.0, "Don't call me with stupid values!");
+ xbt_assert(var->weight > 0.0, "Don't call me with stupid values!");
return RENO2_SCALING * (1.0 / var->weight) * log((x * var->weight) /
(2.0 * x * var->weight +
3.0));
double res_fpi;
double tmp;
- xbt_assert0(x > 0.0, "Don't call me with stupid values!");
+ xbt_assert(x > 0.0, "Don't call me with stupid values!");
tmp = x * var->weight * var->weight;
res_fpi = tmp * (9.0 * x + 24.0);
static XBT_INLINE void lmm_cnst_free(lmm_system_t sys,
lmm_constraint_t cnst)
{
-/* xbt_assert0(xbt_swag_size(&(cnst->element_set)), */
+/* xbt_assert(xbt_swag_size(&(cnst->element_set)), */
/* "This list should be empty!"); */
remove_active_constraint(sys, cnst);
free(cnst);
sys->modified = 1;
- xbt_assert0(var->cnsts_number < var->cnsts_size, "Too much constraints");
+ xbt_assert(var->cnsts_number < var->cnsts_size, "Too much constraints");
elem = &(var->cnsts[var->cnsts_number++]);
// XBT_DEBUG("%s", trace_buf);
fprintf(stderr, "%s\n", trace_buf);
trace_buf[0] = '\000';
- xbt_assert3(!double_positive(sum - cnst->bound),
+ xbt_assert(!double_positive(sum - cnst->bound),
"Incorrect value (%f is not smaller than %f): %g",
sum, cnst->bound, sum - cnst->bound);
}
if (var->bound > 0) {
XBT_DEBUG("'%d'(%f) : %f (<=%f)", var->id_int, var->weight, var->value,
var->bound);
- xbt_assert2(!double_positive(var->value - var->bound),
+ xbt_assert(!double_positive(var->value - var->bound),
"Incorrect value (%f is not smaller than %f",
var->value, var->bound);
} else {
state_initial, state_trace,
bw_initial, bw_trace);
- xbt_assert1(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
+ xbt_assert(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
"Link '%s' declared several times in the platform file.",
name);
surf_parse_get_double(&lat_initial, A_surfxml_link_latency);
lat_trace = tmgr_trace_new(A_surfxml_link_latency_file);
- xbt_assert0((A_surfxml_link_state == A_surfxml_link_state_ON)
+ xbt_assert((A_surfxml_link_state == A_surfxml_link_state_ON)
|| (A_surfxml_link_state ==
A_surfxml_link_state_OFF), "Invalid state");
if (A_surfxml_link_state == A_surfxml_link_state_ON)
link_CM02_t link =
xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
- xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
+ xbt_assert(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
- xbt_assert2(trace,
+ xbt_assert(trace,
"Cannot connect trace %s to link %s: trace undefined",
trace_name, elm);
link_CM02_t link =
xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
- xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
+ xbt_assert(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
- xbt_assert2(trace,
+ xbt_assert(trace,
"Cannot connect trace %s to link %s: trace undefined",
trace_name, elm);
link_CM02_t link =
xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
- xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
+ xbt_assert(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
- xbt_assert2(trace,
+ xbt_assert(trace,
"Cannot connect trace %s to link %s: trace undefined",
trace_name, elm);
/* LARGE PLATFORMS HACK:
assert on total_route_size */
latency = global_routing->get_latency(src_name,dst_name);
- xbt_assert2(xbt_dynar_length(route) || latency,
+ xbt_assert(xbt_dynar_length(route) || latency,
"You're trying to send data from %s to %s but there is no connection at all between these two hosts.",
src_name, dst_name);
if (!xbt_swag_size(running_actions))
return -1.0;
- xbt_assert0(time_to_next_flow_completion,
+ xbt_assert(time_to_next_flow_completion,
"Time to next flow completion not initialized!\n");
XBT_DEBUG("Calling gtnets_get_time_to_next_flow_completion");
src = *((int *) xbt_dict_get_or_null(global_routing->root->to_index,src_name));
dst = *((int *) xbt_dict_get_or_null(global_routing->root->to_index,dst_name));
- xbt_assert0((src >= 0
+ xbt_assert((src >= 0
&& dst >= 0), "Either src or dst have invalid id (id<0)");
XBT_DEBUG("Setting flow src %d \"%s\", dst %d \"%s\"", src, src_name, dst,
state_initial, state_trace,
bw_initial, bw_trace);
- xbt_assert1(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
+ xbt_assert(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
"Link '%s' declared several times in the platform file.",
name);
surf_parse_get_double(&lat_initial, A_surfxml_link_latency);
lat_trace = tmgr_trace_new(A_surfxml_link_latency_file);
- xbt_assert0((A_surfxml_link_state == A_surfxml_link_state_ON)
+ xbt_assert((A_surfxml_link_state == A_surfxml_link_state_ON)
|| (A_surfxml_link_state ==
A_surfxml_link_state_OFF), "Invalid state");
if (A_surfxml_link_state == A_surfxml_link_state_ON)
link_CM02_im_t link =
xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
- xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
+ xbt_assert(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
- xbt_assert2(trace,
+ xbt_assert(trace,
"Cannot connect trace %s to link %s: trace undefined",
trace_name, elm);
link_CM02_im_t link =
xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
- xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
+ xbt_assert(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
- xbt_assert2(trace,
+ xbt_assert(trace,
"Cannot connect trace %s to link %s: trace undefined",
trace_name, elm);
link_CM02_im_t link =
xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
- xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
+ xbt_assert(link, "Cannot connect trace %s to link %s: link undefined",
trace_name, elm);
- xbt_assert2(trace,
+ xbt_assert(trace,
"Cannot connect trace %s to link %s: trace undefined",
trace_name, elm);
XBT_IN("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
/* LARGE PLATFORMS HACK:
assert on total_route_size */
- xbt_assert2(xbt_dynar_length(route),
+ xbt_assert(xbt_dynar_length(route),
"You're trying to send data from %s to %s but there is no connection between these two hosts.",
src_name, dst_name);
double value = -1;
#define VARIABLE(action) (*((lmm_variable_t*)(((char *) (action)) + (offset))))
- xbt_assert0(solve, "Give me a real solver function!");
+ xbt_assert(solve, "Give me a real solver function!");
solve(sys);
xbt_swag_foreach(action, running_actions) {
void *surf_action_new(size_t size, double cost, surf_model_t model,
int failed)
{
- xbt_assert2(size <= action_mallocator_allocated_size,
+ xbt_assert(size <= action_mallocator_allocated_size,
"Cannot create a surf action of size %zu: the mallocator only provides actions of size %d",
size, action_mallocator_allocated_size);
{
char *val;
- xbt_assert0(_surf_init_status < 2,
+ xbt_assert(_surf_init_status < 2,
"Cannot change the model after the initialization");
val = xbt_cfg_get_string(_surf_cfg_set, name);
{
char *val;
- xbt_assert0(_surf_init_status < 2,
+ xbt_assert(_surf_init_status < 2,
"Cannot change the model after the initialization");
val = xbt_cfg_get_string(_surf_cfg_set, name);
{
char *val;
- xbt_assert0(_surf_init_status < 2,
+ xbt_assert(_surf_init_status < 2,
"Cannot change the model after the initialization");
val = xbt_cfg_get_string(_surf_cfg_set, name);
if (!surf_path) {
/* retrieves the current directory of the current process */
const char *initial_path = __surf_get_initial_path();
- xbt_assert0((initial_path),
+ xbt_assert((initial_path),
"__surf_get_initial_path() failed! Can't resolves current Windows directory");
surf_path = xbt_dynar_new(sizeof(char *), NULL);
int network_id = -1;
int cpu_id = -1;
- xbt_assert0(cpu_model_name,
+ xbt_assert(cpu_model_name,
"Set a cpu model to use with the 'compound' workstation model");
- xbt_assert0(network_model_name,
+ xbt_assert(network_model_name,
"Set a network model to use with the 'compound' workstation model");
network_id =
euclidean_dist = sqrt (eculidean_dist_comp(0,src_ctn,dst_ctn)+eculidean_dist_comp(1,src_ctn,dst_ctn))
+fabs(atof(xbt_dynar_get_as(src_ctn, 2, char *)))+fabs(atof(xbt_dynar_get_as(dst_ctn, 2, char *)));
- xbt_assert2(euclidean_dist>=0, "Euclidean Dist is less than 0\"%s\" and \"%.2f\"", src, euclidean_dist);
+ xbt_assert(euclidean_dist>=0, "Euclidean Dist is less than 0\"%s\" and \"%.2f\"", src, euclidean_dist);
return euclidean_dist;
network_element_info_t info = NULL;
if (current_routing->hierarchy == SURF_ROUTING_NULL)
current_routing->hierarchy = SURF_ROUTING_BASE;
- xbt_assert1(!xbt_lib_get_or_null(host_lib, host_id,ROUTING_HOST_LEVEL),
+ xbt_assert(!xbt_lib_get_or_null(host_lib, host_id,ROUTING_HOST_LEVEL),
"Reading a host, processing unit \"%s\" already exists",
host_id);
- xbt_assert1(current_routing->set_processing_unit,
+ xbt_assert(current_routing->set_processing_unit,
"no defined method \"set_processing_unit\" in \"%s\"",
current_routing->name);
(*(current_routing->set_processing_unit)) (current_routing, host_id);
if (current_routing->hierarchy == SURF_ROUTING_NULL)
current_routing->hierarchy = SURF_ROUTING_BASE;
- xbt_assert1(!xbt_lib_get_or_null(as_router_lib,A_surfxml_router_id, ROUTING_ASR_LEVEL),
+ xbt_assert(!xbt_lib_get_or_null(as_router_lib,A_surfxml_router_id, ROUTING_ASR_LEVEL),
"Reading a router, processing unit \"%s\" already exists",
router_id);
- xbt_assert1(current_routing->set_processing_unit,
+ xbt_assert(current_routing->set_processing_unit,
"no defined method \"set_processing_unit\" in \"%s\"",
current_routing->name);
(*(current_routing->set_processing_unit)) (current_routing,
src_id, dst_id);
src = src_id;
dst = dst_id;
- xbt_assert2(strlen(src) > 0 || strlen(dst) > 0,
+ xbt_assert(strlen(src) > 0 || strlen(dst) > 0,
"Some limits are null in the route between \"%s\" and \"%s\"",
src, dst);
link_list = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
dst = A_surfxml_ASroute_dst;
gw_src = A_surfxml_ASroute_gw_src;
gw_dst = A_surfxml_ASroute_gw_dst;
- xbt_assert2(strlen(src) > 0 || strlen(dst) > 0 || strlen(gw_src) > 0
+ xbt_assert(strlen(src) > 0 || strlen(dst) > 0 || strlen(gw_src) > 0
|| strlen(gw_dst) > 0,
"Some limits are null in the route between \"%s\" and \"%s\"",
src, dst);
dst = A_surfxml_bypassRoute_dst;
gw_src = A_surfxml_bypassRoute_gw_src;
gw_dst = A_surfxml_bypassRoute_gw_dst;
- xbt_assert2(strlen(src) > 0 || strlen(dst) > 0 || strlen(gw_src) > 0
+ xbt_assert(strlen(src) > 0 || strlen(dst) > 0 || strlen(gw_src) > 0
|| strlen(gw_dst) > 0,
"Some limits are null in the route between \"%s\" and \"%s\"",
src, dst);
{
name_route_extended_t route = xbt_new0(s_name_route_extended_t, 1);
route->generic_route.link_list = link_list;
- xbt_assert1(current_routing->set_route,
+ xbt_assert(current_routing->set_route,
"no defined method \"set_route\" in \"%s\"",
current_routing->name);
(*(current_routing->set_route)) (current_routing, src, dst, route);
e_route->generic_route.link_list = link_list;
e_route->src_gateway = xbt_strdup(gw_src);
e_route->dst_gateway = xbt_strdup(gw_dst);
- xbt_assert1(current_routing->set_ASroute,
+ xbt_assert(current_routing->set_ASroute,
"no defined method \"set_ASroute\" in \"%s\"",
current_routing->name);
(*(current_routing->set_ASroute)) (current_routing, src, dst, e_route);
e_route->generic_route.link_list = link_list;
e_route->src_gateway = xbt_strdup(gw_src);
e_route->dst_gateway = xbt_strdup(gw_dst);
- xbt_assert1(current_routing->set_bypassroute,
+ xbt_assert(current_routing->set_bypassroute,
"no defined method \"set_bypassroute\" in \"%s\"",
current_routing->name);
(*(current_routing->set_bypassroute)) (current_routing, src, dst,
} else if (current_routing != NULL && global_routing->root != NULL) {
- xbt_assert1(!xbt_dict_get_or_null
+ xbt_assert(!xbt_dict_get_or_null
(current_routing->routing_sons, AS_id),
"The AS \"%s\" already exists", AS_id);
/* it is a part of the tree */
THROWF(arg_error, 0, "Close AS(%s), that never open", AS_id);
} else {
network_element_info_t info = NULL;
- xbt_assert1(!xbt_lib_get_or_null(as_router_lib,current_routing->name, ROUTING_ASR_LEVEL),
+ xbt_assert(!xbt_lib_get_or_null(as_router_lib,current_routing->name, ROUTING_ASR_LEVEL),
"The AS \"%s\" already exists",current_routing->name);
info = xbt_new0(s_network_element_info_t, 1);
info->rc_component = current_routing->routing_father;
static xbt_dynar_t elements_father(const char *src, const char *dst)
{
- xbt_assert0(src && dst, "bad parameters for \"elements_father\" method");
+ xbt_assert(src && dst, "bad parameters for \"elements_father\" method");
xbt_dynar_t result = xbt_dynar_new(sizeof(char *), NULL);
src_as = ((network_element_info_t)src_data)->rc_component;
dst_as = ((network_element_info_t)dst_data)->rc_component;
- xbt_assert2(src_as
+ xbt_assert(src_as
&& dst_as,
"Ask for route \"from\"(%s) or \"to\"(%s) no found", src,
dst);
XBT_DEBUG("Solve route \"%s\" to \"%s\"", src, dst);
- xbt_assert0(src && dst, "bad parameters for \"_get_route\" method");
+ xbt_assert(src && dst, "bad parameters for \"_get_route\" method");
route_extended_t e_route, e_route_cnt, e_route_src = NULL, e_route_dst =
NULL;
if (strcmp(src, dst)) {
e_route_cnt =
(*(common_father->get_route)) (common_father, src, dst);
- xbt_assert2(e_route_cnt, "no route between \"%s\" and \"%s\"", src,
+ xbt_assert(e_route_cnt, "no route between \"%s\" and \"%s\"", src,
dst);
xbt_dynar_foreach(e_route_cnt->generic_route.link_list, cpt, link) {
xbt_dynar_push(e_route->generic_route.link_list, &link);
(*(common_father->get_route)) (common_father, src_father->name,
dst_father->name);
- xbt_assert2(e_route_cnt, "no route between \"%s\" and \"%s\"",
+ xbt_assert(e_route_cnt, "no route between \"%s\" and \"%s\"",
src_father->name, dst_father->name);
- xbt_assert2((e_route_cnt->src_gateway == NULL) ==
+ xbt_assert((e_route_cnt->src_gateway == NULL) ==
(e_route_cnt->dst_gateway == NULL),
"bad gateway for route between \"%s\" and \"%s\"", src,
dst);
if (strcmp(src, e_route_cnt->src_gateway)) {
e_route_src = _get_route(src, e_route_cnt->src_gateway);
- xbt_assert2(e_route_src, "no route between \"%s\" and \"%s\"", src,
+ xbt_assert(e_route_src, "no route between \"%s\" and \"%s\"", src,
e_route_cnt->src_gateway);
xbt_dynar_foreach(e_route_src->generic_route.link_list, cpt, link) {
xbt_dynar_push(e_route->generic_route.link_list, &link);
if (strcmp(e_route_cnt->dst_gateway, dst)) {
e_route_dst = _get_route(e_route_cnt->dst_gateway, dst);
- xbt_assert2(e_route_dst, "no route between \"%s\" and \"%s\"",
+ xbt_assert(e_route_dst, "no route between \"%s\" and \"%s\"",
e_route_cnt->dst_gateway, dst);
xbt_dynar_foreach(e_route_dst->generic_route.link_list, cpt, link) {
xbt_dynar_push(e_route->generic_route.link_list, &link);
double latency, latency_src, latency_dst = 0.0;
XBT_DEBUG("Solve route \"%s\" to \"%s\"", src, dst);
- xbt_assert0(src && dst, "bad parameters for \"_get_route\" method");
+ xbt_assert(src && dst, "bad parameters for \"_get_route\" method");
route_extended_t e_route_cnt;
if (strcmp(src, dst)) {
latency =
(*(common_father->get_latency)) (common_father, src, dst);
- xbt_assert2(latency>=0, "no route between \"%s\" and \"%s\"", src,
+ xbt_assert(latency>=0, "no route between \"%s\" and \"%s\"", src,
dst);
} else latency = 0;
} else { /* SURF_ROUTING_RECURSIVE */
e_route_bypass =
(*(common_father->get_bypass_route)) (common_father, src, dst);
- xbt_assert0(!e_route_bypass,"Bypass cannot work yet with get_latency");
+ xbt_assert(!e_route_bypass,"Bypass cannot work yet with get_latency");
e_route_cnt =
(*(common_father->get_route)) (common_father, src_father->name,
dst_father->name);
- xbt_assert2(e_route_cnt, "no route between \"%s\" and \"%s\"",
+ xbt_assert(e_route_cnt, "no route between \"%s\" and \"%s\"",
src_father->name, dst_father->name);
- xbt_assert2((e_route_cnt->src_gateway == NULL) ==
+ xbt_assert((e_route_cnt->src_gateway == NULL) ==
(e_route_cnt->dst_gateway == NULL),
"bad gateway for route between \"%s\" and \"%s\"", src,
dst);
(*(common_father->get_latency)) (common_father, elements_As_name(src),
elements_As_name(dst));
- xbt_assert2(latency>=0, "no route between \"%s\" and \"%s\"",
+ xbt_assert(latency>=0, "no route between \"%s\" and \"%s\"",
src_father->name, dst_father->name);
if (src != e_route_cnt->src_gateway) {
latency_src = _get_latency(src, e_route_cnt->src_gateway);
- xbt_assert2(latency_src>=0, "no route between \"%s\" and \"%s\"", src,
+ xbt_assert(latency_src>=0, "no route between \"%s\" and \"%s\"", src,
e_route_cnt->src_gateway);
latency += latency_src;
}
if (e_route_cnt->dst_gateway != dst) {
latency_dst = _get_latency(e_route_cnt->dst_gateway, dst);
- xbt_assert2(latency_dst>=0, "no route between \"%s\" and \"%s\"",
+ xbt_assert(latency_dst>=0, "no route between \"%s\" and \"%s\"",
e_route_cnt->dst_gateway, dst);
latency += latency_dst;
}
xbt_dynar_free(&elem_father_list);
}
- xbt_assert2(e_route, "no route between \"%s\" and \"%s\"", src, dst);
+ xbt_assert(e_route, "no route between \"%s\" and \"%s\"", src, dst);
if (global_routing->last_route)
xbt_dynar_free(&(global_routing->last_route));
else
latency = (*(common_father->get_latency)) (common_father, src, dst);
- xbt_assert2(latency>=0.0, "no route between \"%s\" and \"%s\"", src, dst);
+ xbt_assert(latency>=0.0, "no route between \"%s\" and \"%s\"", src, dst);
xbt_dynar_free(&elem_father_list);
return latency;
char *tmp_name = rc->name;
xbt_dict_free(&tmp_sons);
xbt_free(tmp_name);
- xbt_assert1(rc->finalize, "no defined method \"finalize\" in \"%s\"",
+ xbt_assert(rc->finalize, "no defined method \"finalize\" in \"%s\"",
current_routing->name);
(*(rc->finalize)) (rc);
}
xbt_dict_foreach(routing->generic_routing.to_index, c2, k2, d2) {
int *src_id = xbt_dict_get_or_null(routing->generic_routing.to_index, k1);
int *dst_id = xbt_dict_get_or_null(routing->generic_routing.to_index, k2);
- xbt_assert2(src_id
+ xbt_assert(src_id
&& dst_id,
"Ask for route \"from\"(%s) or \"to\"(%s) no found in the local table",
src, dst);
static route_extended_t full_get_route(routing_component_t rc,
const char *src, const char *dst)
{
- xbt_assert1(rc && src
+ xbt_assert(rc && src
&& dst,
"Invalid params for \"get_route\" function at AS \"%s\"",
rc->name);
generic_src_dst_check(rc, src, dst);
int *src_id = xbt_dict_get_or_null(routing->generic_routing.to_index, src);
int *dst_id = xbt_dict_get_or_null(routing->generic_routing.to_index, dst);
- xbt_assert2(src_id
+ xbt_assert(src_id
&& dst_id,
"Ask for route \"from\"(%s) or \"to\"(%s) no found in the local table",
src, dst);
routing_component_full_t routing = ((routing_component_full_t) rc);
size_t table_size = xbt_dict_length(routing->generic_routing.to_index);
- xbt_assert2(src_id
+ xbt_assert(src_id
&& dst_id, "Network elements %s or %s not found", src, dst);
- xbt_assert2(xbt_dynar_length(route->generic_route.link_list) > 0,
+ xbt_assert(xbt_dynar_length(route->generic_route.link_list) > 0,
"Invalid count of links, must be greater than zero (%s,%s)",
src, dst);
xbt_dynar_foreach(route->generic_route.link_list,i,link_name)
{
void *link = xbt_lib_get_or_null(link_lib, link_name, SURF_LINK_LEVEL);
- xbt_assert1(link,"Link : '%s' doesn't exists.",link_name);
+ xbt_assert(link,"Link : '%s' doesn't exists.",link_name);
xbt_dynar_push(link_route_to_test,&link);
}
- xbt_assert2(!xbt_dynar_compare(
+ xbt_assert(!xbt_dynar_compare(
(void*)TO_ROUTE_FULL(*src_id, *dst_id)->generic_route.link_list,
(void*)link_route_to_test,
(int_f_cpvoid_cpvoid_t) surf_pointer_resource_cmp),
{
link_name = xbt_dynar_get_as(route->generic_route.link_list,i-1,void *);
void *link = xbt_lib_get_or_null(link_lib, link_name, SURF_LINK_LEVEL);
- xbt_assert1(link,"Link : '%s' doesn't exists.",link_name);
+ xbt_assert(link,"Link : '%s' doesn't exists.",link_name);
xbt_dynar_push(link_route_to_test,&link);
}
- xbt_assert2(!xbt_dynar_compare(
+ xbt_assert(!xbt_dynar_compare(
(void*)TO_ROUTE_FULL(*dst_id, *src_id)->generic_route.link_list,
(void*)link_route_to_test,
(int_f_cpvoid_cpvoid_t) surf_pointer_resource_cmp),
static route_extended_t floyd_get_route(routing_component_t rc,
const char *src, const char *dst)
{
- xbt_assert1(rc && src
+ xbt_assert(rc && src
&& dst,
"Invalid params for \"get_route\" function at AS \"%s\"",
rc->name);
generic_src_dst_check(rc, src, dst);
int *src_id = xbt_dict_get_or_null(routing->generic_routing.to_index, src);
int *dst_id = xbt_dict_get_or_null(routing->generic_routing.to_index, dst);
- xbt_assert2(src_id
+ xbt_assert(src_id
&& dst_id,
"Ask for route \"from\"(%s) or \"to\"(%s) no found in the local table",
src, dst);
pred = TO_FLOYD_PRED(*src_id, pred);
if (pred == -1) /* if no pred in route -> no route to host */
break;
- xbt_assert2(TO_FLOYD_LINK(pred, prev_pred),
+ xbt_assert(TO_FLOYD_LINK(pred, prev_pred),
"Invalid link for the route between \"%s\" or \"%s\"", src,
dst);
&& strcmp(gw_dst, prev_gw_src)) {
xbt_dynar_t e_route_as_to_as =
(*(global_routing->get_route)) (gw_dst, prev_gw_src);
- xbt_assert2(e_route_as_to_as, "no route between \"%s\" and \"%s\"",
+ xbt_assert(e_route_as_to_as, "no route between \"%s\" and \"%s\"",
gw_dst, prev_gw_src);
links = e_route_as_to_as;
int pos = 0;
first = 0;
} while (pred != *src_id);
- xbt_assert4(pred != -1, "no route from host %d to %d (\"%s\" to \"%s\")",
+ xbt_assert(pred != -1, "no route from host %d to %d (\"%s\" to \"%s\")",
*src_id, *dst_id, src, dst);
if (rc->hierarchy == SURF_ROUTING_RECURSIVE) {
xbt_dynar_foreach(route->generic_route.link_list,cpt,link_name)
{
void *link = xbt_lib_get_or_null(link_lib, link_name, SURF_LINK_LEVEL);
- xbt_assert1(link,"Link : '%s' doesn't exists.",link_name);
+ xbt_assert(link,"Link : '%s' doesn't exists.",link_name);
xbt_dynar_push(link_route_to_test,&link);
}
- xbt_assert2(!xbt_dynar_compare(
+ xbt_assert(!xbt_dynar_compare(
(void*)TO_FLOYD_LINK(*src_id, *dst_id)->generic_route.link_list,
(void*)link_route_to_test,
(int_f_cpvoid_cpvoid_t) surf_pointer_resource_cmp),
{
link_name = xbt_dynar_get_as(route->generic_route.link_list,i-1,void *);
void *link = xbt_lib_get_or_null(link_lib, link_name, SURF_LINK_LEVEL);
- xbt_assert1(link,"Link : '%s' doesn't exists.",link_name);
+ xbt_assert(link,"Link : '%s' doesn't exists.",link_name);
xbt_dynar_push(link_route_to_test,&link);
}
- xbt_assert2(!xbt_dynar_compare(
+ xbt_assert(!xbt_dynar_compare(
(void*)TO_FLOYD_LINK(*dst_id, *src_id)->generic_route.link_list,
(void*)link_route_to_test,
(int_f_cpvoid_cpvoid_t) surf_pointer_resource_cmp),
const char *src,
const char *dst)
{
- xbt_assert1(rc && src
+ xbt_assert(rc && src
&& dst,
"Invalid params for \"get_route\" function at AS \"%s\"",
rc->name);
generic_src_dst_check(rc, src, dst);
int *src_id = xbt_dict_get_or_null(routing->generic_routing.to_index, src);
int *dst_id = xbt_dict_get_or_null(routing->generic_routing.to_index, dst);
- xbt_assert2(src_id
+ xbt_assert(src_id
&& dst_id,
"Ask for route \"from\"(%s) or \"to\"(%s) no found in the local table",
src, dst);
graph_node_map_search(routing, *src_id);
graph_node_map_element_t dst_elm =
graph_node_map_search(routing, *dst_id);
- xbt_assert2(src_elm != NULL
+ xbt_assert(src_elm != NULL
&& dst_elm != NULL, "src %d or dst %d does not exist",
*src_id, *dst_id);
src_node_id = ((graph_node_data_t)
xbt_edge_t edge =
xbt_graph_get_edge(routing->route_graph, node_s_v, node_e_v);
- xbt_assert2(edge != NULL, "no route between host %d and %d", *src_id,
+ xbt_assert(edge != NULL, "no route between host %d and %d", *src_id,
*dst_id);
e_route = (route_extended_t) xbt_graph_edge_get_data(edge);
xbt_edge_t edge =
xbt_graph_get_edge(routing->route_graph, node_pred_v, node_v);
- xbt_assert2(edge != NULL, "no route between host %d and %d", *src_id,
+ xbt_assert(edge != NULL, "no route between host %d and %d", *src_id,
*dst_id);
prev_gw_src = gw_src;
&& strcmp(gw_dst, prev_gw_src)) {
xbt_dynar_t e_route_as_to_as =
(*(global_routing->get_route)) (gw_dst, prev_gw_src);
- xbt_assert2(e_route_as_to_as, "no route between \"%s\" and \"%s\"",
+ xbt_assert(e_route_as_to_as, "no route between \"%s\" and \"%s\"",
gw_dst, prev_gw_src);
links = e_route_as_to_as;
int pos = 0;
const char *error;
int erroffset;
ruleroute->re_src = pcre_compile(src, 0, &error, &erroffset, NULL);
- xbt_assert3(ruleroute->re_src,
+ xbt_assert(ruleroute->re_src,
"PCRE compilation failed at offset %d (\"%s\"): %s\n",
erroffset, src, error);
ruleroute->re_dst = pcre_compile(dst, 0, &error, &erroffset, NULL);
- xbt_assert3(ruleroute->re_src,
+ xbt_assert(ruleroute->re_src,
"PCRE compilation failed at offset %d (\"%s\"): %s\n",
erroffset, dst, error);
ruleroute->re_str_link = route->generic_route.link_list;
int erroffset;
ruleroute_e->generic_rule_route.re_src =
pcre_compile(src, 0, &error, &erroffset, NULL);
- xbt_assert3(ruleroute_e->generic_rule_route.re_src,
+ xbt_assert(ruleroute_e->generic_rule_route.re_src,
"PCRE compilation failed at offset %d (\"%s\"): %s\n",
erroffset, src, error);
ruleroute_e->generic_rule_route.re_dst =
pcre_compile(dst, 0, &error, &erroffset, NULL);
- xbt_assert3(ruleroute_e->generic_rule_route.re_src,
+ xbt_assert(ruleroute_e->generic_rule_route.re_src,
"PCRE compilation failed at offset %d (\"%s\"): %s\n",
erroffset, dst, error);
ruleroute_e->generic_rule_route.re_str_link =
&& value[i + number_length] <= '9') {
number_length++;
}
- xbt_assert2(number_length != 0,
+ xbt_assert(number_length != 0,
"bad string parameter, no number indication, at offset: %d (\"%s\")",
i, value);
// solve number
number = atoi(value + i);
i = i + number_length;
- xbt_assert2(i + 2 < value_length,
+ xbt_assert(i + 2 < value_length,
"bad string parameter, too few chars, at offset: %d (\"%s\")",
i, value);
}
i = i + 3;
- xbt_assert4(param_size >= number,
+ xbt_assert(param_size >= number,
"bad string parameter, not enough length param_size, at offset: %d (\"%s\") %d %d",
i, value, param_size, number);
} while (i < value_length && i_result_buffer < BUFFER_SIZE);
- xbt_assert2(i_result_buffer < BUFFER_SIZE,
+ xbt_assert(i_result_buffer < BUFFER_SIZE,
"solving string \"%s\", small buffer size (%d)", value,
BUFFER_SIZE);
result_result[i_result_buffer] = 0;
const char *src,
const char *dst)
{
- xbt_assert1(rc && src
+ xbt_assert(rc && src
&& dst,
"Invalid params for \"get_route\" function at AS \"%s\"",
rc->name);
ovector_dst, OVECCOUNT);
if (rc_dst >= 0) {
res = pcre_get_substring_list(src, ovector_src, rc_src, &list_src);
- xbt_assert1(!res, "error solving substring list for src \"%s\"", src);
+ xbt_assert(!res, "error solving substring list for src \"%s\"", src);
res = pcre_get_substring_list(dst, ovector_dst, rc_dst, &list_dst);
- xbt_assert1(!res, "error solving substring list for src \"%s\"", dst);
+ xbt_assert(!res, "error solving substring list for src \"%s\"", dst);
char *link_name;
xbt_dynar_foreach(ruleroute->re_str_link, cpt, link_name) {
char *new_link_name =
char *route_name;
route_name = bprintf("%s#%s", src, dst);
- xbt_assert2(xbt_dynar_length(e_route->generic_route.link_list) > 0,
+ xbt_assert(xbt_dynar_length(e_route->generic_route.link_list) > 0,
"Invalid count of links, must be greater than zero (%s,%s)",
src, dst);
- xbt_assert4(!xbt_dict_get_or_null(dict_bypassRoutes, route_name),
+ xbt_assert(!xbt_dict_get_or_null(dict_bypassRoutes, route_name),
"The bypass route between \"%s\"(\"%s\") and \"%s\"(\"%s\") already exists",
src, e_route->src_gateway, dst, e_route->dst_gateway);
new_route->link_list =
xbt_dynar_new(global_routing->size_of_link, NULL);
- xbt_assert0(hierarchy == SURF_ROUTING_BASE,
+ xbt_assert(hierarchy == SURF_ROUTING_BASE,
"the hierarchy type is not SURF_ROUTING_BASE");
links = ((route_t) data)->link_list;
new_e_route->src_gateway = NULL;
new_e_route->dst_gateway = NULL;
- xbt_assert0(hierarchy == SURF_ROUTING_BASE
+ xbt_assert(hierarchy == SURF_ROUTING_BASE
|| hierarchy == SURF_ROUTING_RECURSIVE,
"the hierarchy type is not defined");
} else if (hierarchy == SURF_ROUTING_RECURSIVE) {
e_route = (route_extended_t) data;
- xbt_assert0(e_route->src_gateway
+ xbt_assert(e_route->src_gateway
&& e_route->dst_gateway, "bad gateway, is null");
links = e_route->generic_route.link_list;
radical_ends = xbt_str_split(groups, "-");
switch (xbt_dynar_length(radical_ends)) {
case 1:
- xbt_assert1(!xbt_dict_get_or_null(random_value,random_id),"Custom Random '%s' already exists !",random_id);
+ xbt_assert(!xbt_dict_get_or_null(random_value,random_id),"Custom Random '%s' already exists !",random_id);
res = random_generate(random);
tmpbuf = bprintf("%s%d",random_id,atoi(xbt_dynar_getfirst_as(radical_ends,char *)));
xbt_dict_set(random_value, tmpbuf, bprintf("%f",res), free);
xbt_dynar_get_as(radical_ends, 0, char *));
surf_parse_get_int(&end, xbt_dynar_get_as(radical_ends, 1, char *));
for (i = start; i <= end; i++) {
- xbt_assert1(!xbt_dict_get_or_null(random_value,random_id),"Custom Random '%s' already exists !",bprintf("%s%d",random_id,i));
+ xbt_assert(!xbt_dict_get_or_null(random_value,random_id),"Custom Random '%s' already exists !",bprintf("%s%d",random_id,i));
res = random_generate(random);
tmpbuf = bprintf("%s%d",random_id,i);
xbt_dict_set(random_value, tmpbuf, bprintf("%f",res), free);
sscanf(A_surfxml_platform_version, "%lg", &version);
- xbt_assert0((version >= 1.0), "******* BIG FAT WARNING *********\n "
+ xbt_assert((version >= 1.0), "******* BIG FAT WARNING *********\n "
"You're using an ancient XML file.\n"
"Since SimGrid 3.1, units are Bytes, Flops, and seconds "
"instead of MBytes, MFlops and seconds.\n"
"Last, do not forget to also update your values for "
"the calls to MSG_task_create (if any).");
- xbt_assert0((version >= 3.0), "******* BIG FAT WARNING *********\n "
+ xbt_assert((version >= 3.0), "******* BIG FAT WARNING *********\n "
"You're using an old XML file.\n"
"Use simgrid_update_xml to update your file automatically. "
"This program is installed automatically with SimGrid, or "
return;
}
surf_file_to_parse = surf_fopen(file, "r");
- xbt_assert1((surf_file_to_parse), "Unable to open \"%s\"\n", file);
+ xbt_assert((surf_file_to_parse), "Unable to open \"%s\"\n", file);
surf_input_buffer = surf_parse__create_buffer(surf_file_to_parse, 10);
surf_parse__switch_to_buffer(surf_input_buffer);
surf_parse_lineno = 1;
parse_status = surf_parse();
free_data();
surf_parse_close();
- xbt_assert1(!parse_status, "Parse error in %s", file);
+ xbt_assert(!parse_status, "Parse error in %s", file);
}
/* Prop tag functions */
static void parse_Stag_trace_connect(void)
{
- xbt_assert2(xbt_dict_get_or_null
+ xbt_assert(xbt_dict_get_or_null
(traces_set_list, A_surfxml_trace_connect_trace),
"Cannot connect trace %s to %s: trace unknown",
A_surfxml_trace_connect_trace,
memcpy(generator, p + 6, q - (p + 6));
generator[q - (p + 6)] = '\0';
random = xbt_dict_get_or_null(random_data_list, generator);
- xbt_assert1(random, "Random generator %s undefined", generator);
+ xbt_assert(random, "Random generator %s undefined", generator);
power_scale = random_generate(random);
}
} else {
}
}
- xbt_assert1(periodicity >= 0,
+ xbt_assert(periodicity >= 0,
"Invalid periodicity %lg (must be positive)", periodicity);
trace = xbt_new0(s_tmgr_trace_t, 1);
}
f = surf_fopen(filename, "r");
- xbt_assert2(f != NULL, "Cannot open file '%s' (path=%s)", filename,
+ xbt_assert(f != NULL, "Cannot open file '%s' (path=%s)", filename,
xbt_str_join(surf_path, ":"));
tstr = xbt_str_from_file(f);
trace_event->idx = offset;
trace_event->model = model;
- xbt_assert0((trace_event->idx < xbt_dynar_length(trace->event_list)),
+ xbt_assert((trace_event->idx < xbt_dynar_length(trace->event_list)),
"You're referring to an event that does not exist!");
xbt_heap_push(h->heap, trace_event, start_time);
void surf_workstation_model_init_compound(const char *filename)
{
- xbt_assert0(surf_cpu_model, "No CPU model defined yet!");
- xbt_assert0(surf_network_model, "No network model defined yet!");
+ xbt_assert(surf_cpu_model, "No CPU model defined yet!");
+ xbt_assert(surf_network_model, "No network model defined yet!");
surf_workstation_model_init_internal();
update_model_description(surf_workstation_model_description,
xbt_dict_t cpu_properties)
{
cpu_L07_t cpu = xbt_new0(s_cpu_L07_t, 1);
- xbt_assert1(!surf_workstation_resource_by_name(name),
+ xbt_assert(!surf_workstation_resource_by_name(name),
"Host '%s' declared several times in the platform file.",
name);
cpu->id = ptask_host_count++;
cpu->power_scale = power_scale;
- xbt_assert0(cpu->power_scale > 0, "Power has to be >0");
+ xbt_assert(cpu->power_scale > 0, "Power has to be >0");
cpu->power_current = power_initial;
if (power_trace)
surf_parse_get_double(&power_initial, A_surfxml_host_availability);
power_trace = tmgr_trace_new(A_surfxml_host_availability_file);
- xbt_assert0((A_surfxml_host_state == A_surfxml_host_state_ON) ||
+ xbt_assert((A_surfxml_host_state == A_surfxml_host_state_ON) ||
(A_surfxml_host_state == A_surfxml_host_state_OFF),
"Invalid state");
if (A_surfxml_host_state == A_surfxml_host_state_ON)
policy, xbt_dict_t properties)
{
link_L07_t nw_link = xbt_new0(s_link_L07_t, 1);
- xbt_assert1(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
+ xbt_assert(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
"Link '%s' declared several times in the platform file.",
name);
surf_parse_get_double(&lat_initial, A_surfxml_link_latency);
lat_trace = tmgr_trace_new(A_surfxml_link_latency_file);
- xbt_assert0((A_surfxml_link_state == A_surfxml_link_state_ON)
+ xbt_assert((A_surfxml_link_state == A_surfxml_link_state_ON)
|| (A_surfxml_link_state ==
A_surfxml_link_state_OFF), "Invalid state");
if (A_surfxml_link_state == A_surfxml_link_state_ON)
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
cpu_L07_t host = surf_workstation_resource_by_name(elm);
- xbt_assert1(host, "Host %s undefined", elm);
- xbt_assert1(trace, "Trace %s undefined", trace_name);
+ xbt_assert(host, "Host %s undefined", elm);
+ xbt_assert(trace, "Trace %s undefined", trace_name);
host->state_event =
tmgr_history_add_trace(history, trace, 0.0, 0, host);
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
cpu_L07_t host = surf_workstation_resource_by_name(elm);
- xbt_assert1(host, "Host %s undefined", elm);
- xbt_assert1(trace, "Trace %s undefined", trace_name);
+ xbt_assert(host, "Host %s undefined", elm);
+ xbt_assert(trace, "Trace %s undefined", trace_name);
host->power_event =
tmgr_history_add_trace(history, trace, 0.0, 0, host);
link_L07_t link =
xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
- xbt_assert1(link, "Link %s undefined", elm);
- xbt_assert1(trace, "Trace %s undefined", trace_name);
+ xbt_assert(link, "Link %s undefined", elm);
+ xbt_assert(trace, "Trace %s undefined", trace_name);
link->state_event =
tmgr_history_add_trace(history, trace, 0.0, 0, link);
link_L07_t link =
xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
- xbt_assert1(link, "Link %s undefined", elm);
- xbt_assert1(trace, "Trace %s undefined", trace_name);
+ xbt_assert(link, "Link %s undefined", elm);
+ xbt_assert(trace, "Trace %s undefined", trace_name);
link->bw_event = tmgr_history_add_trace(history, trace, 0.0, 0, link);
}
link_L07_t link =
xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
- xbt_assert1(link, "Link %s undefined", elm);
- xbt_assert1(trace, "Trace %s undefined", trace_name);
+ xbt_assert(link, "Link %s undefined", elm);
+ xbt_assert(trace, "Trace %s undefined", trace_name);
link->lat_event = tmgr_history_add_trace(history, trace, 0.0, 0, link);
}
void surf_workstation_model_init_ptask_L07(const char *filename)
{
XBT_INFO("surf_workstation_model_init_ptask_L07");
- xbt_assert0(!surf_cpu_model, "CPU model type already defined");
- xbt_assert0(!surf_network_model, "network model type already defined");
+ xbt_assert(!surf_cpu_model, "CPU model type already defined");
+ xbt_assert(!surf_network_model, "network model type already defined");
surf_network_model = surf_model_init();
ptask_define_callbacks(filename);
ptask_model_init_internal();
struct stat stat_buf;
char *binary_name = NULL;
- xbt_assert0(e
+ xbt_assert(e
&& e->used,
"Backtrace not setup yet, cannot set it up for display");
int i;
char **backtrace_syms;
- xbt_assert0(e
+ xbt_assert(e
&& e->used,
"Backtrace not setup yet, cannot set it up for display");
XBT_DEBUG("Copy cfg set %p", tocopy);
*whereto = NULL;
- xbt_assert0(tocopy, "cannot copy NULL config");
+ xbt_assert(tocopy, "cannot copy NULL config");
xbt_dict_foreach((xbt_dict_t) tocopy, cursor, name, variable) {
xbt_cfg_register(whereto, name, variable->desc, variable->type, NULL,
if (*cfg == NULL)
*cfg = xbt_cfg_new();
- xbt_assert4(type >= xbt_cfgelm_int && type <= xbt_cfgelm_peer,
+ xbt_assert(type >= xbt_cfgelm_int && type <= xbt_cfgelm_peer,
"type of %s not valid (%d should be between %d and %d)",
name, type, xbt_cfgelm_int, xbt_cfgelm_peer);
res = xbt_dict_get_or_null((xbt_dict_t) * cfg, name);
XBT_DEBUG("Register string '%s'", entry);
tok = strchr(entrycpy, ':');
- xbt_assert2(tok, "Invalid config element descriptor: %s%s",
+ xbt_assert(tok, "Invalid config element descriptor: %s%s",
entry, "; Should be <name>:<min nb>_to_<max nb>_<type>");
*(tok++) = '\0';
min = strtol(tok, &tok, 10);
- xbt_assert1(tok, "Invalid minimum in config element descriptor %s",
+ xbt_assert(tok, "Invalid minimum in config element descriptor %s",
entry);
- xbt_assert2(strcmp(tok, "_to_"),
+ xbt_assert(strcmp(tok, "_to_"),
"Invalid config element descriptor : %s%s",
entry, "; Should be <name>:<min nb>_to_<max nb>_<type>");
tok += strlen("_to_");
max = strtol(tok, &tok, 10);
- xbt_assert1(tok, "Invalid maximum in config element descriptor %s",
+ xbt_assert(tok, "Invalid maximum in config element descriptor %s",
entry);
- xbt_assert2(*tok == '_',
+ xbt_assert(*tok == '_',
"Invalid config element descriptor: %s%s", entry,
"; Should be <name>:<min nb>_to_<max nb>_<type>");
tok++;
for (type = 0;
type < xbt_cfgelm_type_count
&& strcmp(tok, xbt_cfgelm_type_name[type]); type++);
- xbt_assert2(type < xbt_cfgelm_type_count,
+ xbt_assert(type < xbt_cfgelm_type_count,
"Invalid type in config element descriptor: %s%s", entry,
"; Should be one of 'string', 'int', 'peer' or 'double'.");
char *name;
int size;
- xbt_assert0(cfg, "NULL config set.");
+ xbt_assert(cfg, "NULL config set.");
XBT_DEBUG("Check cfg set %p", cfg);
xbt_dict_foreach((xbt_dict_t) cfg, cursor, name, variable) {
"No registered variable '%s' in this config set", name);
}
- xbt_assert3(type == xbt_cfgelm_any || res->type == type,
+ xbt_assert(type == xbt_cfgelm_any || res->type == type,
"You tried to access to the config element %s as an %s, but its type is %s.",
name,
xbt_cfgelm_type_name[type], xbt_cfgelm_type_name[res->type]);
int suite_len = strlen(suite->title);
int i;
- xbt_assert2(suite_len < 68,
+ xbt_assert(suite_len < 68,
"suite title \"%s\" too long (%d should be less than 68",
suite->title, suite_len);
xbt_assert(unit);
xbt_assert(fmt);
- xbt_assert1(xbt_dynar_length(_xbt_test_current_unit->tests),
+ xbt_assert(xbt_dynar_length(_xbt_test_current_unit->tests),
"Test failed even before being declared (broken unit: %s)",
unit->title);
void xbt_test_expect_failure(void)
{
xbt_test_test_t test;
- xbt_assert1(xbt_dynar_length(_xbt_test_current_unit->tests),
+ xbt_assert(xbt_dynar_length(_xbt_test_current_unit->tests),
"Cannot expect the failure of a test before declaring it (broken unit: %s)",
_xbt_test_current_unit->title);
test =
{
xbt_test_test_t test;
- xbt_assert1(xbt_dynar_length(_xbt_test_current_unit->tests),
+ xbt_assert(xbt_dynar_length(_xbt_test_current_unit->tests),
"Test skiped even before being declared (broken unit: %s)",
_xbt_test_current_unit->title);
xbt_assert(unit);
xbt_assert(fmt);
- xbt_assert1(xbt_dynar_length(_xbt_test_current_unit->tests),
+ xbt_assert(xbt_dynar_length(_xbt_test_current_unit->tests),
"Test logged into even before being declared (broken test unit: %s)",
unit->title);
xbt_dict_foreach(dict, cursor, key, data) {
effective++;
key2 = xbt_dict_get_key(dict, data);
- xbt_assert2(!strcmp(key, key2),
+ xbt_assert(!strcmp(key, key2),
"The data was registered under %s instead of %s as expected",
key2, key);
}
*/
static XBT_INLINE void __cursor_not_null(xbt_dict_cursor_t cursor)
{
- xbt_assert0(cursor, "Null cursor");
+ xbt_assert(cursor, "Null cursor");
}
int keys_len = xbt_dynar_length(keys);
xbt_assert(xbt_dynar_length(keys) == xbt_dynar_length(lens));
- xbt_assert0(keys_len, "Can't set a zero-long key set in a multidict");
+ xbt_assert(keys_len, "Can't set a zero-long key set in a multidict");
XBT_DEBUG("xbt_multidict_set(%p,%d)", mdict, keys_len);
int keys_len = xbt_dynar_length(keys);
xbt_assert(xbt_dynar_length(keys) == xbt_dynar_length(lens));
- xbt_assert0(xbt_dynar_length(keys) >= 1,
+ xbt_assert(xbt_dynar_length(keys) >= 1,
"Can't get a zero-long key set in a multidict");
XBT_DEBUG("xbt_multidict_get(%p, %ld)", mdict, xbt_dynar_length(keys));
int keys_len = xbt_dynar_length(keys);
xbt_assert(xbt_dynar_length(keys) == xbt_dynar_length(lens));
- xbt_assert0(xbt_dynar_length(keys),
+ xbt_assert(xbt_dynar_length(keys),
"Can't remove a zero-long key set in a multidict");
for (i = 0, thislevel = mdict; i < keys_len - 1;
static XBT_INLINE void _sanity_check_dynar(xbt_dynar_t dynar)
{
- xbt_assert0(dynar, "dynar is NULL");
+ xbt_assert(dynar, "dynar is NULL");
}
static XBT_INLINE void _sanity_check_idx(int idx)
{
- xbt_assert1(idx >= 0, "dynar idx(=%d) < 0", (int) (idx));
+ xbt_assert(idx >= 0, "dynar idx(=%d) < 0", (int) (idx));
}
static XBT_INLINE void _check_inbound_idx(xbt_dynar_t dynar, int idx)
*/
void xbt_fifo_push_item(xbt_fifo_t l, xbt_fifo_item_t new)
{
- xbt_assert0((new->next == NULL) && (new->prev == NULL), "Invalid item!");
+ xbt_assert((new->next == NULL) && (new->prev == NULL), "Invalid item!");
(l->count)++;
if (l->head == NULL) {
l->head = new;
*/
void xbt_fifo_unshift_item(xbt_fifo_t l, xbt_fifo_item_t new)
{
- xbt_assert0((new->next == NULL) && (new->prev == NULL), "Invalid item!");
+ xbt_assert((new->next == NULL) && (new->prev == NULL), "Invalid item!");
(l->count)++;
if (l->head == NULL) {
l->head = new;
void xbt_fifo_remove_item(xbt_fifo_t l, xbt_fifo_item_t current)
{
if (l->head == l->tail) { /* special case */
- xbt_assert0((current == l->head), "This item is not in the list!");
+ xbt_assert((current == l->head), "This item is not in the list!");
l->head = NULL;
l->tail = NULL;
(l->count)--;
xbt_heap_t heap = xbt_heap_new(10, NULL);
unsigned int cursor;
- xbt_assert0(!(g->directed),
+ xbt_assert(!(g->directed),
"Spanning trees do not make sense on directed graphs");
xbt_dynar_foreach(g->nodes, cursor, node) {
xbt_graph_parse_open(filename);
int res;
res = (*xbt_graph_parse) ();
- xbt_assert1(!res, "Parse error in %s", filename);
+ xbt_assert(!res, "Parse error in %s", filename);
xbt_graph_parse_close();
graph = parsed_graph;
const char *name = NULL;
file = fopen(filename, "w");
- xbt_assert1(file, "Failed to open %s \n", filename);
+ xbt_assert(file, "Failed to open %s \n", filename);
if (g->directed)
fprintf(file, "digraph test {\n");
const char *name = NULL;
file = fopen(filename, "w");
- xbt_assert1(file, "Failed to open %s \n", filename);
+ xbt_assert(file, "Failed to open %s \n", filename);
fprintf(file, "<?xml version='1.0'?>\n");
fprintf(file, "<!DOCTYPE graph SYSTEM \"graphxml.dtd\">\n");
xbt_graph_file_to_parse_stack = xbt_dynar_new(sizeof(FILE *), NULL);
xbt_graph_file_to_parse = fopen(file, "r"); /* FIXME should use something like surf_fopen */
- xbt_assert1((xbt_graph_file_to_parse), "Unable to open \"%s\"\n", file);
+ xbt_assert((xbt_graph_file_to_parse), "Unable to open \"%s\"\n", file);
xbt_graph_input_buffer =
xbt_graph_parse__create_buffer(xbt_graph_file_to_parse, 10);
xbt_graph_parse__switch_to_buffer(xbt_graph_input_buffer);
int ret = 0;
ret = sscanf(string, "%lg", value);
- xbt_assert2((ret == 1), "Parse error line %d : %s not a number",
+ xbt_assert((ret == 1), "Parse error line %d : %s not a number",
xbt_graph_parse_lineno, string);
}
*/
XBT_INLINE double xbt_heap_maxkey(xbt_heap_t H)
{
- xbt_assert0(H->count != 0, "Empty heap");
+ xbt_assert(H->count != 0, "Empty heap");
return KEY(H, 0);
}
*/
void *xbt_heap_maxcontent(xbt_heap_t H)
{
- xbt_assert0(H->count != 0, "Empty heap");
+ xbt_assert(H->count != 0, "Empty heap");
return CONTENT(H, 0);
}
while (1) {
xbt_log_appender_t appender = cat->appender;
if (appender != NULL) {
- xbt_assert1(cat->layout,
+ xbt_assert(cat->layout,
"No valid layout for the appender of category %s",
cat->name);
cat->layout->do_layout(cat->layout, ev, fmt, appender);
if (!xbt_log_settings)
return priority >= category->threshold;
- xbt_assert0(category, "NULL category");
+ xbt_assert(category, "NULL category");
xbt_assert(category->name);
xbt_dynar_foreach(xbt_log_settings, cursor, setting) {
- xbt_assert0(setting, "Damnit, NULL cat in the list");
- xbt_assert1(setting->catname, "NULL setting(=%p)->catname",
+ xbt_assert(setting, "Damnit, NULL cat in the list");
+ xbt_assert(setting->catname, "NULL setting(=%p)->catname",
(void *) setting);
if (!strcmp(setting->catname, category->name)) {
void xbt_log_parent_set(xbt_log_category_t cat, xbt_log_category_t parent)
{
- xbt_assert0(cat, "NULL category to be given a parent");
- xbt_assert1(parent, "The parent category of %s is NULL", cat->name);
+ xbt_assert(cat, "NULL category to be given a parent");
+ xbt_assert(parent, "The parent category of %s is NULL", cat->name);
/*
* if the threshold is initialized
eq = control_string;
control_string += strcspn(control_string, " ");
- xbt_assert1(*dot == '.' && (*eq == '=' || *eq == ':'),
+ xbt_assert(*dot == '.' && (*eq == '=' || *eq == ':'),
"Invalid control string '%s'", control_string);
if (!strncmp(dot + 1, "thresh", (size_t) (eq - dot - 1))) {
xbt_mallocator_t m;
- xbt_assert0(size > 0, "size must be positive");
- xbt_assert0(new_f != NULL && free_f != NULL
+ xbt_assert(size > 0, "size must be positive");
+ xbt_assert(new_f != NULL && free_f != NULL
&& reset_f != NULL, "invalid parameter");
/* Let's force 0 size mallocator! (Dirty hack, blame Martin :) ) */
{
int i;
- xbt_assert0(m != NULL, "Invalid parameter");
+ xbt_assert(m != NULL, "Invalid parameter");
XBT_VERB("Frees mallocator %p (size:%d/%d)", m, m->current_size,
m->max_size);
if (!*cursor) {
XBT_DEBUG("Create the cursor on first use");
*cursor = xbt_new(s_xbt_set_cursor_t, 1);
- xbt_assert0(*cursor,
+ xbt_assert(*cursor,
"Malloc error during the creation of the cursor");
}
(*cursor)->set = set;
xbt_setset_elm_entry_t new_entry = NULL;
xbt_setset_elm_entry_t first_elm = NULL;
xbt_setset_elm_t e = (xbt_setset_elm_t) obj;
- xbt_assert0(e->ID == 0, "Adding element with non NULL ID");
+ xbt_assert(e->ID == 0, "Adding element with non NULL ID");
first_elm =
(xbt_setset_elm_entry_t) xbt_dynar_get_ptr(setset->elm_array, 0);
(swag->count)++;
if (swag->head == NULL) {
- xbt_assert0(!(swag->tail), "Inconsistent swag.");
+ xbt_assert(!(swag->tail), "Inconsistent swag.");
swag->head = obj;
swag->tail = obj;
return;
(swag->count)++;
if (swag->head == NULL) {
- xbt_assert0(!(swag->tail), "Inconsistent swag.");
+ xbt_assert(!(swag->tail), "Inconsistent swag.");
swag->head = obj;
swag->tail = obj;
return;
(swag->count)++;
if (swag->head == NULL) {
- xbt_assert0(!(swag->tail), "Inconsistent swag.");
+ xbt_assert(!(swag->tail), "Inconsistent swag.");
swag->head = obj;
swag->tail = obj;
return;
{
char *p;
const char *procname = NULL;
- xbt_assert0(ev->priority >= 0,
+ xbt_assert(ev->priority >= 0,
"Negative logging priority naturally forbidden");
- xbt_assert1(ev->priority < sizeof(xbt_log_priority_names),
+ xbt_assert(ev->priority < sizeof(xbt_log_priority_names),
"Priority %d is greater than the biggest allowed value",
ev->priority);
{
unsigned int i, j, k;
- xbt_assert2(A->lines == C->lines,
+ xbt_assert(A->lines == C->lines,
"A->lines != C->lines (%d vs %d)", A->lines, C->lines);
xbt_assert(B->rows == C->rows);
xbt_peer_t res = xbt_new(s_xbt_peer_t, 1);
char *name = xbt_strdup(peerport);
char *port_str = strchr(name, ':');
- xbt_assert1(port_str,
+ xbt_assert(port_str,
"argument of xbt_peer_from_string should be of form <peername>:<port>, it's '%s'",
peerport);
*port_str = '\0';
{
xbt_replay_trace_reader_t res = xbt_new0(s_xbt_replay_trace_reader_t,1);
res->fp = fopen(filename, "r");
- xbt_assert2(res->fp != NULL, "Cannot open %s: %s", filename,
+ xbt_assert(res->fp != NULL, "Cannot open %s: %s", filename,
strerror(errno));
res->filename = xbt_strdup(filename);
return res;
void xbt_thread_join(xbt_thread_t thread)
{
xbt_mutex_acquire(thread->mutex);
- xbt_assert1(thread->joinable,
+ xbt_assert(thread->joinable,
"Cannot join on %p: wasn't created joinable", thread);
if (!thread->done) {
xbt_cond_wait(thread->cond, thread->mutex);
XBT_INFO("---- Test on float ----");
write_read("float", &i, &j, sock, direction);
if (direction == READ || direction == COPY)
- xbt_assert2(i == j, "%f != %f", i, j);
+ xbt_assert(i == j, "%f != %f", i, j);
}
static void test_double(gras_socket_t sock, int direction)
XBT_INFO("---- Test on double ----");
write_read("double", &i, &j, sock, direction);
if (direction == READ || direction == COPY)
- xbt_assert2(i == j, "%f != %f", i, j);
+ xbt_assert(i == j, "%f != %f", i, j);
}
#define FIXED_ARRAY_SIZE 5
if (direction == READ || direction == COPY) {
for (cpt = 0; cpt < FIXED_ARRAY_SIZE; cpt++) {
XBT_DEBUG("Test spot %d", cpt);
- xbt_assert4(i[cpt] == j[cpt], "i[%d]=%d != j[%d]=%d",
+ xbt_assert(i[cpt] == j[cpt], "i[%d]=%d != j[%d]=%d",
cpt, i[cpt], cpt, j[cpt]);
}
}
write_read("int*", &i, &j, sock, direction);
if (direction == READ || direction == COPY) {
- xbt_assert2(*i == *j, "*i != *j (%d != %d)", *i, *j);
+ xbt_assert(*i == *j, "*i != *j (%d != %d)", *i, *j);
free(j);
}
free(i);
write_read("string", &i, &j, sock, direction);
if (direction == READ || direction == COPY) {
for (cpt = 0; cpt < strlen(i); cpt++) {
- xbt_assert4(i[cpt] == j[cpt], "i[%d]=%c != j[%d]=%c",
+ xbt_assert(i[cpt] == j[cpt], "i[%d]=%c != j[%d]=%c",
cpt, i[cpt], cpt, j[cpt]);
}
free(j);
write_read("homostruct*", &i, &j, sock, direction);
if (direction == READ || direction == COPY) {
- xbt_assert2(i->a == j->a, "i->a=%d != j->a=%d", i->a, j->a);
+ xbt_assert(i->a == j->a, "i->a=%d != j->a=%d", i->a, j->a);
xbt_assert(i->b == j->b);
xbt_assert(i->c == j->c);
xbt_assert(i->d == j->d);
if (direction == READ || direction == COPY) {
xbt_assert(i->c1 == j->c1);
xbt_assert(i->c2 == j->c2);
- xbt_assert2(i->l1 == j->l1, "i->l1(=%ld) != j->l1(=%ld)", i->l1,
+ xbt_assert(i->l1 == j->l1, "i->l1(=%ld) != j->l1(=%ld)", i->l1,
j->l1);
xbt_assert(i->l2 == j->l2);
free(j);
for (cpt = 0, p = i, q = j; cpt < 10; cpt++, p++, q++) {
xbt_assert(p->c1 == q->c1);
xbt_assert(p->c2 == q->c2);
- xbt_assert3(p->l1 == p->l1,
+ xbt_assert(p->l1 == p->l1,
"for cpt=%d i->l1(=%ld) != j->l1(=%ld)", cpt, p->l1,
q->l1);
xbt_assert(q->l2 == p->l2);
XBT_DEBUG("j->l=%p", j->l);
XBT_DEBUG("j->l->l=%p", j->l->l);
XBT_DEBUG("j->l->l->l=%p", j->l->l->l);
- xbt_assert4(j->l->l->l == j,
+ xbt_assert(j->l->l->l == j,
"Received list is not cyclic. j=%p != j->l->l->l=%p\n"
"j=%p; &j=%p", j, j->l->l->l, j, &j);
j->l->l->l = NULL;
for (cpt = 0; cpt < 64; cpt++) {
sprintf(buf, "%d", cpt);
xbt_dynar_shift(j, &s2);
- xbt_assert2(!strcmp(buf, s2),
+ xbt_assert(!strcmp(buf, s2),
"The retrieved value is not the same than the injected one (%s!=%s)",
buf, s2);
free(s2);
/* Check that the data match */
xbt_assert(i.Cnstatv == j.Cnstatv);
for (cpt = 0; cpt < 12; cpt++)
- xbt_assert4(i.Cstatev[cpt] == j.Cstatev[cpt],
+ xbt_assert(i.Cstatev[cpt] == j.Cstatev[cpt],
"i.Cstatev[%d] (=%f) != j.Cstatev[%d] (=%f)",
cpt, i.Cstatev[cpt], cpt, j.Cstatev[cpt]);
xbt_assert(i.Cnprops == j.Cnprops);
for (cpt = 0; cpt < 106; cpt++) {
xbt_assert(i.Cstress[cpt] == j.Cstress[cpt]);
for (cpt2 = 0; cpt2 < 106; cpt2++)
- xbt_assert4(i.Cddsdde[cpt][cpt2] == j.Cddsdde[cpt][cpt2],
+ xbt_assert(i.Cddsdde[cpt][cpt2] == j.Cddsdde[cpt][cpt2],
"%f=i.Cddsdde[%d][%d] != j.Cddsdde[cpt][cpt2]=%f",
i.Cddsdde[cpt][cpt2], cpt, cpt2, j.Cddsdde[cpt][cpt2]);
}
gras_init(&argc, argv);
- xbt_assert0(argc == 3, "Usage: server <myport> <client>");
+ xbt_assert(argc == 3, "Usage: server <myport> <client>");
myport = atoi(argv[1]);
palstr = argv[2];
RETHROWF("Didn't got the expected timeout: %s");
}
}
- xbt_assert0(got_expected,
+ xbt_assert(got_expected,
"gras_msg_handle(0) do not lead to any timeout exception");
- xbt_assert1(gras_os_time() - now < 0.01,
+ xbt_assert(gras_os_time() - now < 0.01,
"gras_msg_handle(0) do not anwser immediately (%.4fsec)",
gras_os_time() - now);
XBT_INFO("gras_msg_handle(0) works as expected (immediate timeout)");
RETHROWF("Didn't got the expected timeout: %s");
}
}
- xbt_assert0(got_expected,
+ xbt_assert(got_expected,
"gras_msg_handle(1) do not lead to any timeout exception");
- xbt_assert1(gras_os_time() - now < 1.5,
+ xbt_assert(gras_os_time() - now < 1.5,
"gras_msg_handle(1) needs more than 1.5 sec to answer (%.4fsec)",
gras_os_time() - now);
- xbt_assert1(gras_os_time() - now >= 1.0,
+ xbt_assert(gras_os_time() - now >= 1.0,
"gras_msg_handle(1) answers in less than one second (%.4fsec)",
gras_os_time() - now);
XBT_INFO("gras_msg_handle(1) works as expected (delayed timeout)");
gras_init(&argc, argv);
- xbt_assert0(argc == 3, "Usage: client <myport> <server>");
+ xbt_assert(argc == 3, "Usage: client <myport> <server>");
myport = atoi(argv[1]);
palstr = argv[2];
XBT_INFO("Receiving");
m_task_t task = NULL;
MSG_task_get_with_timeout(&task, 0, DBL_MAX);
- xbt_assert0(MSG_task_get_sender(task), "No sender received");
+ xbt_assert(MSG_task_get_sender(task), "No sender received");
XBT_INFO("Got a message sent by '%s'",
MSG_process_get_name(MSG_task_get_sender(task)));
return 0;
SD_init(&argc, argv);
SD_create_environment(argv[1]);
- // xbt_assert0( check max tcp win size, "MAX TCP WIN SIZE is 20000");
+ // xbt_assert( check max tcp win size, "MAX TCP WIN SIZE is 20000");
root = SD_task_create("Root", NULL, 1.0);
SD_task_schedule(root, 1, SD_workstation_get_list(), no_cost, no_cost,
}
}
- xbt_assert1((argc >= 3),
+ xbt_assert((argc >= 3),
"Usage: %s project_name deployment_file [deployment_file...]\n",
argv[0]);
FICOUT = fopen(filename, "w");
- xbt_assert1(FICOUT, "Unable to open %s for writing", filename);
+ xbt_assert(FICOUT, "Unable to open %s for writing", filename);
fprintf(FICOUT, "%s\n", warning);
fprintf(FICOUT, "%s", SIM_PREEMBULE);
sprintf(filename, RL_SOURCENAME, project, key);
FICOUT = fopen(filename, "w");
- xbt_assert1(FICOUT, "Unable to open %s for writing", filename);
+ xbt_assert(FICOUT, "Unable to open %s for writing", filename);
fprintf(FICOUT, "\n%s\n", warning);
fprintf(FICOUT, "/* specific to Borland Compiler */\n"
sprintf(filename, MAKEFILE_FILENAME_AM, project);
FICOUT = fopen(filename, "w");
- xbt_assert1(FICOUT, "Unable to open %s for writing", filename);
+ xbt_assert(FICOUT, "Unable to open %s for writing", filename);
fprintf(FICOUT, "# AUTOMAKE variable definition\n");
fprintf(FICOUT, "INCLUDES= @CFLAGS_SimGrid@\n\n");
sprintf(filename, MAKEFILE_FILENAME_LOCAL, project);
FICOUT = fopen(filename, "w");
- xbt_assert1(FICOUT, "Unable to open %s for writing", filename);
+ xbt_assert(FICOUT, "Unable to open %s for writing", filename);
free(filename);
fprintf(FICOUT,
exit(1);
}
char *eq = strchr(argv[i+1], '=');
- xbt_assert1(eq,"The argument of --setenv must contain a '=' (got %s instead)",argv[i+1]);
+ xbt_assert(eq,"The argument of --setenv must contain a '=' (got %s instead)",argv[i+1]);
char *key = bprintf("%.*s", (int) (eq - argv[i+1]), argv[i+1]);
xbt_dict_set(env, key, xbt_strdup(eq + 1), xbt_free_f);
XBT_INFO("setting environment variable '%s' to '%s'", key, eq+1);