X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2703e1ee2a79e9fc7c86ebb122caa515ecf24d14..ae68749ec3d90fc5e403e8a4950d30b832a9629f:/examples/msg/mc/electric_fence.c diff --git a/examples/msg/mc/electric_fence.c b/examples/msg/mc/electric_fence.c index cfe23b7d0e..b8b2c5313c 100644 --- a/examples/msg/mc/electric_fence.c +++ b/examples/msg/mc/electric_fence.c @@ -1,10 +1,8 @@ -/* Copyright (c) 2013. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ - /******************** Non-deterministic message ordering *********************/ /* This example implements one process which receives messages from two other */ /* processes. There is no bug on it, it is just provided to test the soundness*/ @@ -12,23 +10,21 @@ /* --cfg=model-check/max_depth:) is reached. */ /******************************************************************************/ -#include +#include #include #define N 2 XBT_LOG_NEW_DEFAULT_CATEGORY(electric_fence, "Example to check the soundness of DPOR"); -int server(int argc, char *argv[]); -int client(int argc, char *argv[]); -int server(int argc, char *argv[]) +static int server(int argc, char *argv[]) { - msg_task_t task1 = NULL, task2 = NULL; - msg_comm_t comm_received1 = NULL, comm_received2 = NULL; + msg_task_t task1 = NULL; + msg_task_t task2 = NULL; - comm_received1 = MSG_task_irecv(&task1, "mymailbox"); - comm_received2 = MSG_task_irecv(&task2, "mymailbox"); + msg_comm_t comm_received1 = MSG_task_irecv(&task1, "mymailbox"); + msg_comm_t comm_received2 = MSG_task_irecv(&task2, "mymailbox"); MSG_comm_wait(comm_received1, -1); MSG_comm_wait(comm_received2, -1); @@ -37,32 +33,26 @@ int server(int argc, char *argv[]) return 0; } -int client(int argc, char *argv[]) +static int client(int argc, char *argv[]) { - msg_task_t task = MSG_task_create(argv[1], 0, 10000, NULL); MSG_task_send(task, "mymailbox"); - + XBT_INFO("Sent!"); return 0; } int main(int argc, char *argv[]) { - MSG_init(&argc, argv); MSG_create_environment("platform.xml"); MSG_function_register("server", server); - MSG_function_register("client", client); - MSG_launch_application("deploy_electric_fence.xml"); MSG_main(); - return 0; - }