* under the terms of the license (GNU LGPL) which comes with this package. */
#include <stdio.h>
-#include "msg/msg.h" /* Yeah! If you want to use msg, you need to include msg/msg.h */
+#include "simgrid/msg.h" /* Yeah! If you want to use msg, you need to include simgrid/msg.h */
#include "xbt/sysdep.h" /* calloc, printf */
/* Create a log channel to have nice outputs. */
char **argvF;
argvF = xbt_new(char*, 2);
argvF[0] = xbt_strdup("process_daemon");
- msg_host_t jupiter = MSG_get_host_by_name("Jupiter");
+ msg_host_t jupiter = MSG_host_by_name("Jupiter");
test = 1;
// Create a process running a simple task on a host and turn the host off during the execution of the process.
- if (xbt_dynar_member(tests, &test)){
+ if (xbt_dynar_search_or_negative(tests, &test)!=-1){
XBT_INFO("Test 1:");
XBT_INFO(" Create a process on Jupiter");
argvF = xbt_new(char*, 2);
test = 2;
// Create a process that on a host that is turned off (this should not be possible)
- if (xbt_dynar_member(tests, &test)){
+ if (xbt_dynar_search_or_negative(tests, &test)!=-1){
XBT_INFO("Test 2:");
XBT_INFO(" Turn off Jupiter");
// adsein: Jupiter is already, hence nothing should happen
test = 3;
// Create a process running sucessive sleeps on a host and turn the host off during the execution of the process.
- if (xbt_dynar_member(tests, &test)){
+ if (xbt_dynar_search_or_negative(tests, &test)!=-1){
XBT_INFO("Test 3:");
MSG_host_on(jupiter);
argvF = xbt_new(char*, 2);
}
test = 4;
- if (xbt_dynar_member(tests, &test)){
+ if (xbt_dynar_search_or_negative(tests, &test)!=-1){
XBT_INFO("Test 4 (turn off src during a communication) : Create a Process/task to make a communication between Jupiter and Tremblay and turn off Jupiter during the communication");
MSG_host_on(jupiter);
MSG_process_sleep(10);
argvF = xbt_new(char*, 2);
argvF[0] = xbt_strdup("commRX");
- MSG_process_create_with_arguments("commRX", commRX, NULL, MSG_get_host_by_name("Tremblay"), 1, argvF);
+ MSG_process_create_with_arguments("commRX", commRX, NULL, MSG_host_by_name("Tremblay"), 1, argvF);
argvF = xbt_new(char*, 2);
argvF[0] = xbt_strdup("commTX");
MSG_process_create_with_arguments("commTX", commTX, NULL, jupiter, 1, argvF);
}
test = 5;
- if (xbt_dynar_member(tests, &test)){
+ if (xbt_dynar_search_or_negative(tests, &test)!=-1){
XBT_INFO("Test 5 (turn off dest during a communication : Create a Process/task to make a communication between Tremblay and Jupiter and turn off Jupiter during the communication");
MSG_host_on(jupiter);
MSG_process_sleep(10);
MSG_process_create_with_arguments("commRX", commRX, NULL, jupiter, 1, argvF);
argvF = xbt_new(char*, 2);
argvF[0] = xbt_strdup("commTX");
- MSG_process_create_with_arguments("commTX", commTX, NULL, MSG_get_host_by_name("Tremblay"), 1, argvF);
+ MSG_process_create_with_arguments("commTX", commTX, NULL, MSG_host_by_name("Tremblay"), 1, argvF);
XBT_INFO(" number of processes: %d", MSG_process_get_number());
MSG_process_sleep(10);
XBT_INFO(" Turn Jupiter off");
MSG_host_off(jupiter);
- XBT_INFO("Test 4 seems ok, cool !(number of Process : %d, it should be 2", MSG_process_get_number());
+ XBT_INFO("Test 5 seems ok, cool !(number of Process : %d, it should be 2", MSG_process_get_number());
}
test =6;
- if (xbt_dynar_member(tests, &test)){
+ if (xbt_dynar_search_or_negative(tests, &test)!=-1){
XBT_INFO("Test 6: Turn on Jupiter, assign a VM on Jupiter, launch a process inside the VM, and turn off the node");
// Create VM0
}
test = 7;
- if (xbt_dynar_member(tests, &test)){
+ if (xbt_dynar_search_or_negative(tests, &test)!=-1){
}
test = 8;
- if (xbt_dynar_member(tests, &test)){
+ if (xbt_dynar_search_or_negative(tests, &test)!=-1){
}
test = 9;
- if (xbt_dynar_member(tests, &test)){
+ if (xbt_dynar_search_or_negative(tests, &test)!=-1){
}
XBT_INFO(" Test done. See you!");
platform_file = argv[1];
application_file = argv[2];
- /* MSG_config("workstation/model","KCCFLN05"); */
{ /* Simulation setting */
MSG_create_environment(platform_file);
}