add_executable(centralized centralized_mutex.c)
add_executable(bugged1 bugged1.c)
-add_executable(bugged1_stateful bugged1_stateful.c)
-add_executable(bugged2_stateful bugged2_stateful.c)
add_executable(bugged2 bugged2.c)
add_executable(bugged3 bugged3.c)
add_executable(random_test random_test.c)
target_link_libraries(centralized simgrid m )
target_link_libraries(bugged1 simgrid m )
-target_link_libraries(bugged1_stateful simgrid m)
-target_link_libraries(bugged2_stateful simgrid m)
target_link_libraries(bugged2 simgrid m )
target_link_libraries(bugged3 simgrid m )
target_link_libraries(random_test simgrid m )
${examples_src}
${CMAKE_CURRENT_SOURCE_DIR}/bugged1.c
${CMAKE_CURRENT_SOURCE_DIR}/bugged1_for_liveness.c
- ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_stateful.c
${CMAKE_CURRENT_SOURCE_DIR}/bugged1_while_liveness.c
${CMAKE_CURRENT_SOURCE_DIR}/bugged2.c
${CMAKE_CURRENT_SOURCE_DIR}/bugged2_liveness.c
- ${CMAKE_CURRENT_SOURCE_DIR}/bugged2_stateful.c
${CMAKE_CURRENT_SOURCE_DIR}/bugged3.c
${CMAKE_CURRENT_SOURCE_DIR}/centralized_liveness.c
${CMAKE_CURRENT_SOURCE_DIR}/centralized_liveness_deadlock.c
+++ /dev/null
-/******************** Non-deterministic message ordering *********************/
-/* Server assumes a fixed order in the reception of messages from its clients */
-/* which is incorrect because the message ordering is non-deterministic */
-/******************************************************************************/
-
-#include <msg/msg.h>
-#include <simgrid/modelchecker.h>
-#define N 3
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
-
-int server(int argc, char *argv[]);
-int client(int argc, char *argv[]);
-
-int server(int argc, char *argv[])
-{
- m_task_t task = NULL;
- int count = 0;
- while (count < N) {
- if (task) {
- MSG_task_destroy(task);
- task = NULL;
- }
- MSG_task_receive(&task, "mymailbox");
- count++;
- }
- MC_assert_stateful(atoi(MSG_task_get_name(task)) == 3);
-
- XBT_INFO("OK");
- return 0;
-}
-
-int client(int argc, char *argv[])
-{
-
- m_task_t task =
- MSG_task_create(argv[1], 0 /*comp cost */ , 10000 /*comm size */ ,
- NULL /*arbitrary data */ );
-
- MSG_task_send(task, "mymailbox");
-
- XBT_INFO("Sent!");
- return 0;
-}
-
-int main(int argc, char *argv[])
-{
-
- MSG_global_init(&argc, argv);
-
- MSG_create_environment("platform.xml");
-
- MSG_function_register("server", server);
-
- MSG_function_register("client", client);
-
- MSG_launch_application("deploy_bugged1.xml");
-
- MSG_main_stateful();
-
- MSG_clean();
-
- return 0;
-
-}
+++ /dev/null
-/******************** Non-deterministic message ordering *********************/
-/* Server assumes a fixed order in the reception of messages from its clients */
-/* which is incorrect because the message ordering is non-deterministic */
-/******************************************************************************/
-
-#include <msg/msg.h>
-#include <simgrid/modelchecker.h>
-#define N 3
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
-
-int server(int argc, char *argv[]);
-int client(int argc, char *argv[]);
-
-int server(int argc, char *argv[])
-{
- m_task_t task1, task2;
- long val1, val2;
-
- MSG_task_receive(&task1, "mymailbox");
- val1 = (long) MSG_task_get_data(task1);
- MSG_task_destroy(task1);
- task1 = NULL;
- XBT_INFO("Received %lu", val1);
-
- MSG_task_receive(&task2, "mymailbox");
- val2 = (long) MSG_task_get_data(task2);
- MSG_task_destroy(task2);
- task2 = NULL;
- XBT_INFO("Received %lu", val2);
-
- MC_assert_stateful(min(val1, val2) == 1);
-
- MSG_task_receive(&task1, "mymailbox");
- val1 = (long) MSG_task_get_data(task1);
- MSG_task_destroy(task1);
- XBT_INFO("Received %lu", val1);
-
- MSG_task_receive(&task2, "mymailbox");
- val2 = (long) MSG_task_get_data(task2);
- MSG_task_destroy(task2);
- XBT_INFO("Received %lu", val2);
-
- XBT_INFO("OK");
- return 0;
-}
-
-int client(int argc, char *argv[])
-{
- m_task_t task1 =
- MSG_task_create("task", 0, 10000, (void *) atol(argv[1]));
- m_task_t task2 =
- MSG_task_create("task", 0, 10000, (void *) atol(argv[1]));
-
- XBT_INFO("Send %d!", atoi(argv[1]));
- MSG_task_send(task1, "mymailbox");
-
- XBT_INFO("Send %d!", atoi(argv[1]));
- MSG_task_send(task2, "mymailbox");
-
- return 0;
-}
-
-int main(int argc, char *argv[])
-{
- MSG_global_init(&argc, argv);
-
- MSG_create_environment("platform.xml");
-
- MSG_function_register("server", server);
-
- MSG_function_register("client", client);
-
- MSG_launch_application("deploy_bugged2.xml");
-
- MSG_main_stateful();
-
- return 0;
-}