}
}
-static int worker_fun(int argc, char *argv[])
+static int worker_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
const char *pr_name = MSG_process_get_name(MSG_process_self());
char mbox[MAXMBOXLEN];
return 0;
}
-static int master_fun(int argc, char *argv[])
+static int master_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_vm_t vm;
unsigned int i;
XBT_LOG_NEW_DEFAULT_CATEGORY(energy_vm, "Messages of this example");
-static int worker_func(int argc, char *argv[]) {
+static int worker_func(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
+{
msg_task_t task1 = MSG_task_create("t1", 300E6, 0, NULL);
MSG_task_execute (task1);
MSG_task_destroy(task1);
return 0;
}
-static int dvfs(int argc, char *argv[])
+static int dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_host_t host1 = MSG_host_by_name("MyHost1");
msg_host_t host2 = MSG_host_by_name("MyHost2");
XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
-static int server(int argc, char *argv[])
+static int server(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_task_t task = NULL;
int count = 0;
static int client(int argc, char *argv[])
{
+ xbt_assert(argc == 2);
msg_task_t task = MSG_task_create(argv[1], 0 /*comp cost */ , 10000 /*comm size */ , NULL /*arbitrary data */ );
MSG_task_send(task, "mymailbox");
}
#endif
-static int coordinator(int argc, char *argv[])
+static int coordinator(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
int CS_used = 0;
msg_task_t task = NULL;
static int client(int argc, char *argv[])
{
+ xbt_assert(argc == 2);
int my_pid = MSG_process_get_PID(MSG_process_self());
char *my_mailbox = xbt_strdup(argv[1]);
XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
-static int server(int argc, char *argv[])
+static int server(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_task_t task1 = NULL;
msg_task_t task2 = NULL;
static int client(int argc, char *argv[])
{
+ xbt_assert(argc == 2);
msg_task_t task1 = MSG_task_create(argv[1], 0, 10000, NULL);
msg_task_t task2 = MSG_task_create(argv[1], 0, 10000, NULL);
int cs = 0;
-static int coordinator(int argc, char *argv[])
+static int coordinator(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
int CS_used = 0; // initially the CS is idle
static int client(int argc, char *argv[])
{
+ xbt_assert(argc == 2);
int my_pid = MSG_process_get_PID(MSG_process_self());
char *my_mailbox = xbt_strdup(argv[1]);
XBT_LOG_NEW_DEFAULT_CATEGORY(bugged3, "this example");
-
-static int server(int argc, char *argv[])
+static int server(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_task_t task1 = NULL;
msg_task_t task2 = NULL;
static int client(int argc, char *argv[])
{
+ xbt_assert(argc == 2);
msg_task_t task1 = MSG_task_create(argv[1], 0, 10000, NULL);
char *mbox = bprintf("mymailbox%s", argv[1]);
#define CS_PER_PROCESS 2
XBT_LOG_NEW_DEFAULT_CATEGORY(centralized, "my log messages");
-static int coordinator(int argc, char *argv[])
+static int coordinator(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
xbt_dynar_t requests = xbt_dynar_new(sizeof(char *), NULL); // dynamic vector storing requests (which are char*)
int CS_used = 0; // initially the CS is idle
return 0;
}
-static int client(int argc, char *argv[])
+static int client(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
int my_pid = MSG_process_get_PID(MSG_process_self());
// use my pid as name of mailbox to contact me
XBT_LOG_NEW_DEFAULT_CATEGORY(electric_fence, "Example to check the soundness of DPOR");
-
-static int server(int argc, char *argv[])
+static int server(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_task_t task1 = NULL;
msg_task_t task2 = NULL;
static int client(int argc, char *argv[])
{
+ xbt_assert(argc == 2);
msg_task_t task = MSG_task_create(argv[1], 0, 10000, NULL);
MSG_task_send(task, "mymailbox");
static int master(int argc, char *argv[])
{
+ xbt_assert(argc == 5);
long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
double task_comm_size = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
static int worker(int argc, char *argv[])
{
+ xbt_assert(argc == 2);
char mailbox[80];
long id= xbt_str_parse_int(argv[1], "Invalid argument %s");
#include "simgrid/msg.h"
/* Main function of the process I want to start manually */
-static int process_function(int argc, char *argv[])
+static int process_function(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_task_t task = MSG_task_create("task", 100, 0, NULL);
MSG_task_execute (task);
static int master(int argc, char *argv[])
{
+ xbt_assert(argc == 5);
long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
long workers_count = xbt_str_parse_int(argv[4], "Invalid amount of workers: %s");
return 0;
}
-static int worker(int argc, char *argv[])
+static int worker(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_task_t task = NULL;
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-static int trace_fun(int argc, char *argv[])
+static int trace_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
const char *hostname = MSG_host_get_name(MSG_host_self());
MSG_task_destroy (task);
}
-static int trace_fun(int argc, char *argv[])
+static int trace_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
//set initial values for the link user variables this example only shows for links identified by "6" and "3" in the
//platform file
static int master(int argc, char *argv[])
{
+ xbt_assert(argc == 5);
long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
double task_comm_size = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
return 0;
}
-static int worker(int argc, char *argv[])
+static int worker(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_task_t task = NULL;
#include "simgrid/msg.h"
/* The guy we will move from host to host. It move alone and then is moved by policeman back */
-static int emigrant(int argc, char *argv[])
+static int emigrant(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_task_t task = NULL;
char *destination = NULL;
return 0;
}
-static int policeman(int argc, char *argv[])
+static int policeman(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
// I am the master of emigrant process,
// I tell it where it must emigrate to.
MSG_task_destroy (task);
}
-static int trace_fun(int argc, char *argv[])
+static int trace_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
//Set initial values for the link user variables
//This example uses source and destination where source and destination are the name of hosts inthe platform file.
static int master(int argc, char *argv[])
{
+ xbt_assert(argc == 5);
long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
double task_comm_size = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
static int slave(int argc, char *argv[])
{
+ xbt_assert(argc == 2);
msg_task_t task = NULL;
XBT_ATTRIB_UNUSED int res;
int id = -1;
}
}
-int main(int argc, char** argv) {
+int main()
+{
process = new simgrid::mc::RemoteClient(getpid(), -1);
process->init();
static xbt_mutex_t mutex = NULL;
#endif
-static int receiver(int argc, char *argv[])
+static int receiver(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_task_t task = NULL;
static int sender(int argc, char *argv[])
{
+ xbt_assert(argc == 2);
char* message_name = argv[1];
#ifndef DISABLE_THE_MUTEX
xbt_mutex_acquire(mutex);
XBT_LOG_NEW_DEFAULT_CATEGORY(random_bug, "Application");
/** An (fake) application with a bug occuring for some random values */
-static int app(int argc, char *argv[])
+static int app(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
int x = MC_random(0, 5);
int y = MC_random(0, 5);
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_app_token_ring, "Messages specific for this msg example");
/* Main function of all processes used in this example */
-static int relay_runner(int argc, char* argv[])
+static int relay_runner(int argc, XBT_ATTRIB_UNUSED char* argv[])
{
xbt_assert(argc == 0, "The relay_runner function does not accept any parameter from the XML deployment file");
int rank = xbt_str_parse_int(MSG_process_get_name(MSG_process_self()),
static int worker_main(int argc, char* argv[])
{
+ xbt_assert(argc == 4);
double computation_amount = xbt_str_parse_double(argv[1], "Invalid computation amount: %s");
int use_bound = xbt_str_parse_int(argv[2], "Second parameter (use_bound) should be 0 or 1 but is: %s");
double bound = xbt_str_parse_double(argv[3], "Invalid bound: %s");
MSG_process_create_with_arguments(pr_name, worker_main, NULL, host, 4, argv);
}
-static int worker_busy_loop_main(int argc, char* argv[])
+static int worker_busy_loop_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_task_t* task = MSG_process_get_data(MSG_process_self());
MSG_task_execute(*task);
MSG_process_sleep(1000);
}
-static int master_main(int argc, char* argv[])
+static int master_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_host_t pm0 = MSG_host_by_name("Fafard");
msg_host_t pm1 = MSG_host_by_name("Fafard");
MSG_process_create_with_arguments(pr_name, migration_worker_main, NULL, host, 3, argv);
}
-static int master_main(int argc, char* argv[])
+static int master_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_host_t pm0 = MSG_host_by_name("Fafard");
msg_host_t pm1 = MSG_host_by_name("Tremblay");
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-static int computation_fun(int argc, char* argv[])
+static int computation_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
const char* pr_name = MSG_process_get_name(MSG_process_self());
const char* host_name = MSG_host_get_name(MSG_host_self());
xbt_free(mbox);
}
-static int master_main(int argc, char* argv[])
+static int master_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_host_t pm0 = MSG_host_by_name("Fafard");
msg_host_t pm1 = MSG_host_by_name("Tremblay");
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-static int dvfs(int argc, char* argv[])
+static int dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_host_t host = MSG_host_by_name("MyHost1");
XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Pstate properties test");
-static int dvfs(int argc, char* argv[])
+static int dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
double workload = 100E6;
msg_host_t host = MSG_host_self();
#include <float.h>
XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Messages specific to this example");
-static int sender_fun(int argc, char *argv[])
+static int sender_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
XBT_INFO("Sending");
MSG_task_send(MSG_task_create("Blah", 0.0, 0.0, NULL), MSG_host_get_name(MSG_host_self()));
return 0;
}
-static int receiver_fun(int argc, char *argv[])
+static int receiver_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
XBT_INFO("Receiving");
msg_task_t task = NULL;
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-static int slave(int argc, char *argv[])
+static int slave(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_task_t task = NULL;
XBT_ATTRIB_UNUSED int res;
return 0;
}
-static int master(int argc, char *argv[])
+static int master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
double task_comp_size = 5E7;
double task_comm_size = 1E6;
static const char* mailbox = "comm";
-static int master(int argc, char *argv[])
+static int master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_host_t jupiter = MSG_host_by_name("Jupiter");
return 0;
}
-static int slave(int argc, char *argv[])
+static int slave(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
XBT_INFO("Slave receiving");
msg_task_t task = NULL;
XBT_LOG_NEW_DEFAULT_CATEGORY(io_file, "Messages specific for this io example");
-static int host(int argc, char* argv[])
+static int host(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_file_t file = NULL;
sg_size_t read;
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-static int execute_load_test(int argc, char* argv[])
+static int execute_load_test(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_host_t host = MSG_host_by_name("MyHost1");
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_daemon, "Messages specific for this msg example");
/* The worker process, working for a while before leaving */
-static int worker_process(int argc, char* argv[])
+static int worker_process(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
XBT_INFO("Let's do some work (for 10 sec on Boivin).");
msg_task_t task = MSG_task_create("easy work", 980.95e6, 0, NULL);
}
/* The daemon, displaying a message every 3 seconds until all other processes stop */
-static int daemon_process(int argc, char* argv[])
+static int daemon_process(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
MSG_process_daemonize(MSG_process_self());
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-static int slave(int argc, char* argv[])
+static int slave(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
XBT_INFO("Slave started");
MSG_process_sleep(3);
return 0;
}
-static int master(int argc, char* argv[])
+static int master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_process_t process;
/* Just sleep until termination */
static int sleeper(int argc, char* argv[])
{
+ xbt_assert(argc == 2);
XBT_INFO("Hello! I go to sleep.");
MSG_process_on_exit(my_onexit, NULL);
static msg_process_t controlled_process = NULL;
/* The Emigrant process will be moved from host to host. */
-static int emigrant(int argc, char* argv[])
+static int emigrant(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
XBT_INFO("I'll look for a new job on another machine ('Boivin') where the grass is greener.");
MSG_process_migrate(MSG_process_self(), MSG_host_by_name("Boivin")); /* - First, move to another host by myself */
}
/* The policeman check for emigrants and move them back to 'Jacquelin' */
-static int policeman(int argc, char* argv[])
+static int policeman(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
XBT_INFO("Wait at the checkpoint."); /* - block on the mutex+condition */
MSG_barrier_wait(barrier);
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_suspend, "Messages specific for this msg example");
/* The Lazy guy only wants to sleep, but can be awaken by the dream_master process. */
-static int lazy_guy(int argc, char* argv[])
+static int lazy_guy(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
XBT_INFO("Nobody's watching me ? Let's go to sleep.");
MSG_process_suspend(MSG_process_self()); /* - Start by suspending itself */
}
/* The Dream master: */
-static int dream_master(int argc, char* argv[])
+static int dream_master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
XBT_INFO("Let's create a lazy guy."); /* - Create a lazy_guy process */
msg_process_t lazy = MSG_process_create("Lazy", lazy_guy, NULL, MSG_host_self());
static int test(int argc, char* argv[])
{
+ xbt_assert(argc == 3);
double computation_amount = xbt_str_parse_double(argv[1], "Invalid argument: %s");
double priority = xbt_str_parse_double(argv[2], "Invalid argument: %s");
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-static int tester(int argc, char* argv[])
+static int tester(int, char**)
{
msg_task_t task = MSG_task_create("name", 0, 10, NULL);
msg_comm_t comm = MSG_task_isend(task, "mailbox");