Ejemplo n.º 1
0
int test_launcher(int argc, char *argv[])
{
  int test = 0;
  char **argvF;
  argvF = xbt_new(char*, 2);
  argvF[0] = xbt_strdup("process_daemon");
  msg_host_t jupiter = MSG_get_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_search_or_negative(tests, &test)!=-1){
    XBT_INFO("Test 1:");
    XBT_INFO("  Create a process on Jupiter");
    argvF = xbt_new(char*, 2);
    argvF[0] = xbt_strdup("process_daemon");
    MSG_process_create_with_arguments("process_daemon", process_daemon, NULL, jupiter, 1, argvF);
    MSG_process_sleep(3);
    XBT_INFO("  Turn off Jupiter");
    MSG_host_off(jupiter);
    MSG_process_sleep(10);
    XBT_INFO("Test 1 seems ok, cool !(number of Process : %d, it should be 1 (i.e. the Test one))", MSG_process_get_number());
  }
Ejemplo n.º 2
0
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls) {
  return (jint) MSG_process_get_number();
}