コード例 #1
0
ファイル: simcore_mra-struct3.c プロジェクト: MRSG-MRA/MRA
/**
 * @param  platform_file   The path/name of the platform file.
 * @param  deploy_file     The path/name of the deploy file.
 * @param  mra_config_file  The path/name of the configuration file.
 * @param  vc_file_name   The volunteer computing configuration file.
 */
static msg_error_t run_mra_simulation (const char* platform_file, const char* deploy_file, const char* mra_config_file, const char* vc_file_name)
{
    msg_error_t  res_mra = MSG_OK;

    read_mra_config_file (mra_config_file);

    MSG_create_environment (platform_file);

    read_bandwidth (platform_file);

    init_mra_vc (vc_file_name);

    // for tracing purposes..
    TRACE_category_with_color ("MRA_MAP", "1 0 0");
    TRACE_category_with_color ("MRA_REDUCE", "0 0 1");

    MSG_function_register ("master_mra", master_mra);
    MSG_function_register ("worker_mra", worker_mra);
    MSG_launch_application (deploy_file);

    init_mr_mra_config (mra_config_file);

    res_mra = MSG_main ();

    free_mra_global_mem ();

    return res_mra;
}
コード例 #2
0
ファイル: categories.c プロジェクト: rosacris/simgrid
/** Test function */
MSG_error_t test_all(const char *platform_file,
                     const char *application_file)
{
  MSG_error_t res = MSG_OK;

  {                             /*  Simulation setting */
    MSG_set_channel_number(0);
    MSG_create_environment(platform_file);
  }
  {
    //declaring user categories with RGB colors
    TRACE_category_with_color ("compute", "1 0 0"); //red
    TRACE_category_with_color ("request", "0 1 0"); //green
    TRACE_category_with_color ("data", "0 0 1");    //blue
    TRACE_category_with_color ("finalize", "0 0 0");//black
  }
  {                             /*   Application deployment */
    MSG_function_register("master", master);
    MSG_function_register("slave", slave);
    MSG_launch_application(application_file);
  }
  res = MSG_main();

  XBT_INFO("Simulation time %g", MSG_get_clock());
  return res;
}
コード例 #3
0
ファイル: chainsend.c プロジェクト: R7R8/simgrid
int main(int argc, char *argv[])
{
  msg_error_t res = MSG_OK;

  MSG_init(&argc, argv);

  MSG_create_environment(argv[1]);

  /* Trace categories */
  TRACE_category_with_color("host0", "0 0 1");
  TRACE_category_with_color("host1", "0 1 0");
  TRACE_category_with_color("host2", "0 1 1");
  TRACE_category_with_color("host3", "1 0 0");
  TRACE_category_with_color("host4", "1 0 1");
  TRACE_category_with_color("host5", "0 0 0");
  TRACE_category_with_color("host6", "1 1 0");
  TRACE_category_with_color("host7", "1 1 1");
  TRACE_category_with_color("host8", "0 1 0");

  /*   Application deployment */
  MSG_function_register("broadcaster", broadcaster);
  MSG_function_register("peer", peer);

  MSG_launch_application(argv[2]);

  res = MSG_main();

  XBT_INFO("Total simulation time: %e", MSG_get_clock());

  return res != MSG_OK;
}
コード例 #4
0
int main(int argc, char *argv[])
{
  MSG_init(&argc, argv);
  xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
             "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);

  MSG_create_environment(argv[1]);

  //declaring user variables
  TRACE_host_variable_declare("is_worker");
  TRACE_host_variable_declare("is_master");
  TRACE_host_variable_declare("task_creation");
  TRACE_host_variable_declare("task_computation");

  //declaring user markers and values
  TRACE_declare_mark("msmark");
  TRACE_declare_mark_value ("msmark", "start_send_tasks");
  TRACE_declare_mark_value ("msmark", "finish_send_tasks");

  //declaring user categories with RGB colors (values from 0 to 1)
  TRACE_category_with_color ("compute", "1 0 0");  //compute is red
  TRACE_category_with_color ("finalize", "0 1 0"); //finalize is green
  //categories without user-defined colors receive random colors generated by the tracing system
  TRACE_category ("request");
  TRACE_category_with_color ("report", NULL);

  MSG_function_register("master", master);
  MSG_function_register("worker", worker);
  MSG_launch_application(argv[2]);

  MSG_main();

  unsigned int cursor;
  xbt_dynar_t categories = TRACE_get_categories ();
  if (categories){
    XBT_INFO ("Declared tracing categories:");
    char *category;
    xbt_dynar_foreach (categories, cursor, category){
      XBT_INFO ("%s", category);
    }
    xbt_dynar_free (&categories);
  }
コード例 #5
0
ファイル: trace-categories.c プロジェクト: mpoquet/simgrid
int main(int argc, char *argv[])
{
  MSG_init(&argc, argv);
  xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
             "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);

  MSG_create_environment(argv[1]);

  /* declaring user categories with RGB colors */
  TRACE_category_with_color ("compute", "1 0 0"); //red
  TRACE_category_with_color ("request", "0 1 0"); //green
  TRACE_category_with_color ("data", "0 0 1");    //blue
  TRACE_category_with_color ("finalize", "0 0 0");//black

  MSG_function_register("master", master);
  MSG_function_register("worker", worker);
  MSG_launch_application(argv[2]);

  MSG_main();
  return 0;
}
コード例 #6
0
ファイル: ms.c プロジェクト: rosacris/simgrid
/** Test function */
MSG_error_t test_all(const char *platform_file,
                     const char *application_file)
{
  MSG_error_t res = MSG_OK;

  {                             /*  Simulation setting */
    MSG_set_channel_number(0);
    MSG_create_environment(platform_file);
  }
  {
    /* declaring tracing categories */

    //declaring user variables
    TRACE_host_variable_declare("is_slave");
    TRACE_host_variable_declare("is_master");
    TRACE_host_variable_declare("task_creation");
    TRACE_host_variable_declare("task_computation");

    //declaring user markers
    TRACE_declare_mark("msmark");

    //declaring user categories with RGB colors (values from 0 to 1)
    TRACE_category_with_color ("compute", "1 0 0");  //compute is red
    TRACE_category_with_color ("finalize", "0 1 0"); //finalize is green
    //categories without user-defined colors receive
    //random colors generated by the tracing system
    TRACE_category ("request");
    TRACE_category_with_color ("report", NULL);
  }
  {                             /*   Application deployment */
    MSG_function_register("master", master);
    MSG_function_register("slave", slave);
    MSG_launch_application(application_file);
  }
  res = MSG_main();

  XBT_INFO("Simulation time %g", MSG_get_clock());
  return res;
}
コード例 #7
0
ファイル: simcore.c プロジェクト: terminiter/MRSG
/**
 * @param  platform_file   The path/name of the platform file.
 * @param  deploy_file     The path/name of the deploy file.
 * @param  mr_config_file  The path/name of the configuration file.
 */
static msg_error_t run_simulation (const char* platform_file, const char* deploy_file, const char* mr_config_file)
{
    msg_error_t  res = MSG_OK;

    read_mr_config_file (mr_config_file);

    MSG_create_environment (platform_file);

    // for tracing purposes..
    TRACE_category_with_color ("MAP", "1 0 0");
    TRACE_category_with_color ("REDUCE", "0 0 1");

    MSG_function_register ("master", master);
    MSG_function_register ("worker", worker);
    MSG_launch_application (deploy_file);

    init_mr_config ();

    res = MSG_main ();

    free_global_mem ();

    return res;
}