您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ xbt_cfg_get_string函数代码示例

51自学网 2021-06-03 10:15:24
  C++
这篇教程C++ xbt_cfg_get_string函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中xbt_cfg_get_string函数的典型用法代码示例。如果您正苦于以下问题:C++ xbt_cfg_get_string函数的具体用法?C++ xbt_cfg_get_string怎么用?C++ xbt_cfg_get_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了xbt_cfg_get_string函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: surf_config_models_setup

void surf_config_models_setup(const char *platform_file){  char *workstation_model_name;  int workstation_id = -1;  char *network_model_name = NULL;  char *cpu_model_name = NULL;  workstation_model_name =      xbt_cfg_get_string(_surf_cfg_set, "workstation/model");  network_model_name = xbt_cfg_get_string(_surf_cfg_set, "network/model");  cpu_model_name = xbt_cfg_get_string(_surf_cfg_set, "cpu/model");  /* Check whether we use a net/cpu model differing from the default ones, in which case   * we should switch to the "compound" workstation model to correctly dispatch stuff to   * the right net/cpu models.   */  if ((strcmp(network_model_name, "LV08")       || strcmp(cpu_model_name, "Cas01"))      && !strcmp(workstation_model_name, "CLM03")) {    const char *val = "compound";    XBT_INFO        ("Switching workstation model to compound since you changed the network and/or cpu model(s)");    xbt_cfg_set_string(_surf_cfg_set, "workstation/model", val);    workstation_model_name = (char *) "compound";  }  XBT_DEBUG("Workstation model: %s", workstation_model_name);  workstation_id =      find_model_description(surf_workstation_model_description,                             workstation_model_name);  if (!strcmp(workstation_model_name, "compound")) {    int network_id = -1;    int cpu_id = -1;    xbt_assert(cpu_model_name,                "Set a cpu model to use with the 'compound' workstation model");    xbt_assert(network_model_name,                "Set a network model to use with the 'compound' workstation model");    network_id =        find_model_description(surf_network_model_description,                               network_model_name);    cpu_id =        find_model_description(surf_cpu_model_description, cpu_model_name);    surf_cpu_model_description[cpu_id].model_init_preparse(platform_file);    surf_network_model_description[network_id].model_init_preparse        (platform_file);  }  XBT_DEBUG("Call workstation_model_init");  surf_workstation_model_description[workstation_id].model_init_preparse      (platform_file);}
开发者ID:rosacris,项目名称:simgrid,代码行数:55,


示例2: _mc_cfg_cb_dot_output

void _mc_cfg_cb_dot_output(const char *name){  if (_sg_cfg_init_status && !_sg_do_model_check)    xbt_die        ("You are specifying a file name for a dot output of graph state after the initialization (through MSG_config?), but model-checking was not activated at config time (through bu the program was not runned under the model-checker (with simgrid-mc)). This won't work, sorry.");  _sg_mc_dot_output_file = xbt_cfg_get_string(name);}
开发者ID:R7R8,项目名称:simgrid,代码行数:8,


示例3: _sg_cfg_cb__storage_mode

/* callback of the cpu/model variable */static void _sg_cfg_cb__storage_mode(const char *name){  xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");  char *val = xbt_cfg_get_string(name);  if (!strcmp(val, "help")) {    model_help("storage", surf_storage_model_description);    sg_cfg_exit_early();  }  find_model_description(surf_storage_model_description, val);}
开发者ID:krytarowski,项目名称:simgrid,代码行数:13,


示例4: surf_config_models_create_elms

void surf_config_models_create_elms(void){  char *workstation_model_name =      xbt_cfg_get_string(_surf_cfg_set, "workstation/model");  int workstation_id =      find_model_description(surf_workstation_model_description,                             workstation_model_name);  if (surf_workstation_model_description      [workstation_id].model_init_postparse != NULL)    surf_workstation_model_description[workstation_id].model_init_postparse        ();}
开发者ID:rosacris,项目名称:simgrid,代码行数:12,


示例5: _sg_cfg_cb__network_model

/* callback of the network_model variable */static void _sg_cfg_cb__network_model(const char *name){  xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");  char *val = xbt_cfg_get_string(name);  if (!strcmp(val, "help")) {    model_help("network", surf_network_model_description);    sg_cfg_exit_early();  }  /* New Module missing */  find_model_description(surf_network_model_description, val);}
开发者ID:krytarowski,项目名称:simgrid,代码行数:14,


示例6: _sg_cfg_cb__vm_model

/* callback of the vm/model variable */static void _sg_cfg_cb__vm_model(const char *name){  xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");  char *val = xbt_cfg_get_string(name);  if (!strcmp(val, "help")) {    model_help("vm", surf_vm_model_description);    sg_cfg_exit_early();  }  /* Make sure that the model exists */  find_model_description(surf_vm_model_description, val);}
开发者ID:krytarowski,项目名称:simgrid,代码行数:14,


示例7: _check_coll

/* callback of the mpi collectives: simply check that this is a valid name. It will be picked up in smpi_global.cpp */static void _check_coll(const char *category,                             s_mpi_coll_description_t * table,                             const char *name){  xbt_assert(_sg_cfg_init_status < 2, "Cannot change the collective algorithm after the initialization");  char *val = xbt_cfg_get_string(name);  if (val && !strcmp(val, "help")) {    coll_help(category, table);    sg_cfg_exit_early();  }  find_coll_description(table, val, category);}
开发者ID:krytarowski,项目名称:simgrid,代码行数:15,


示例8: TRACE_start

int TRACE_start(){  if (TRACE_is_configured())    TRACE_getopts();  // tracing system must be:  //    - enabled (with --cfg=tracing:yes)  //    - already configured (TRACE_global_init already called)  if (TRACE_is_enabled()) {    XBT_DEBUG("Tracing starts");    /* init the tracing module to generate the right output */    /* open internal buffer */    TRACE_init();    /* open the trace file(s) */    const char* format = xbt_cfg_get_string(OPT_TRACING_FORMAT);    XBT_DEBUG("Tracing format %s/n", format);    if(!strcmp(format, "Paje")){      TRACE_paje_init();      TRACE_paje_start();    }else if (!strcmp(format, "TI")){      TRACE_TI_init();      TRACE_TI_start();    }else{      xbt_die("Unknown trace format :%s ", format);    }    /* activate trace */    if (trace_active == 1) {      THROWF(tracing_error, 0, "Tracing is already active");    }    trace_active = 1;    XBT_DEBUG("Tracing is on");    /* other trace initialization */    created_categories = xbt_dict_new_homogeneous(xbt_free_f);    declared_marks = xbt_dict_new_homogeneous(xbt_free_f);    user_host_variables = xbt_dict_new_homogeneous(xbt_free_f);    user_vm_variables = xbt_dict_new_homogeneous(xbt_free_f);    user_link_variables = xbt_dict_new_homogeneous(xbt_free_f);    if (TRACE_start_functions != NULL) {      void (*func) ();      unsigned int iter;      xbt_dynar_foreach(TRACE_start_functions, iter, func) {        func();      }    }  }
开发者ID:R7R8,项目名称:simgrid,代码行数:50,


示例9: _mc_cfg_cb_reduce

void _mc_cfg_cb_reduce(const char *name){  if (_sg_cfg_init_status && !_sg_do_model_check)    xbt_die        ("You are specifying a reduction strategy after the initialization (through MSG_config?), but model-checking was not activated at config time (through bu the program was not runned under the model-checker (with simgrid-mc)). This won't work, sorry.");  char *val = xbt_cfg_get_string(name);  if (!strcasecmp(val, "none"))    simgrid::mc::reduction_mode = simgrid::mc::ReductionMode::none;  else if (!strcasecmp(val, "dpor"))    simgrid::mc::reduction_mode = simgrid::mc::ReductionMode::dpor;  else    xbt_die("configuration option %s can only take 'none' or 'dpor' as a value",            name);}
开发者ID:R7R8,项目名称:simgrid,代码行数:15,


示例10: _sg_cfg_cb__plugin

/* callback of the plugin variable */static void _sg_cfg_cb__plugin(const char *name){  xbt_assert(_sg_cfg_init_status < 2, "Cannot load a plugin after the initialization");  char *val = xbt_cfg_get_string(name);  if (val==nullptr || val[0] == '/0')    return;  if (!strcmp(val, "help")) {    model_help("plugin", surf_plugin_description);    sg_cfg_exit_early();  }  int plugin_id = find_model_description(surf_plugin_description, val);  surf_plugin_description[plugin_id].model_init_preparse();}
开发者ID:krytarowski,项目名称:simgrid,代码行数:17,


示例11: _surf_cfg_cb__surf_network_coordinates

static void _surf_cfg_cb__surf_network_coordinates(const char *name,        int pos){    char *val = xbt_cfg_get_string(_surf_cfg_set, name);    if (!strcmp(val, "yes")) {        if (!COORD_HOST_LEVEL) {            COORD_HOST_LEVEL = xbt_lib_add_level(host_lib,xbt_dynar_free_voidp);            COORD_ASR_LEVEL  = xbt_lib_add_level(as_router_lib,xbt_dynar_free_voidp);        }    } else if (!strcmp(val, "no")) {        if (COORD_HOST_LEVEL)            xbt_die("Setting of whether to use coordinate cannot be disabled once set.");    } else {        xbt_die("Command line setting of whether to use coordinates must be either /"yes/" or /"no/"");    }}
开发者ID:Shurakai,项目名称:SimGrid,代码行数:16,


示例12: parse_factor

double NetworkSmpiModel::latencyFactor(double size){    if (smpi_lat_factor.empty())        smpi_lat_factor = parse_factor(xbt_cfg_get_string("smpi/lat-factor"));    double current=1.0;    for (auto fact: smpi_lat_factor) {        if (size <= fact.factor) {            XBT_DEBUG("%f <= %zu return %f", size, fact.factor, current);            return current;        } else            current=fact.values.front();    }    XBT_DEBUG("%f > %zu return %f", size, smpi_lat_factor.back().factor, current);    return current;}
开发者ID:simgrid,项目名称:simgrid,代码行数:17,


示例13: _sg_cfg_cb__workstation_model

/* callback of the workstation/model variable */static void _sg_cfg_cb__workstation_model(const char *name, int pos){  char *val;  xbt_assert(_sg_init_status == 1,              "Cannot change the model after the initialization");  val = xbt_cfg_get_string(_sg_cfg_set, name);  if (!strcmp(val, "help")) {    model_help("workstation", surf_workstation_model_description);    exit(0);  }  /* Make sure that the model exists */  find_model_description(surf_workstation_model_description, val);}
开发者ID:dhascome,项目名称:simgrid,代码行数:18,


示例14: _sg_cfg_cb__network_model

/* callback of the workstation_model variable */static void _sg_cfg_cb__network_model(const char *name, int pos){  char *val;  xbt_assert(_sg_init_status == 1,              "Cannot change the model after the initialization");  val = xbt_cfg_get_string(_sg_cfg_set, name);  if (!strcmp(val, "help")) {    model_help("network", surf_network_model_description);    exit(0);  }  /* New Module missing */  find_model_description(surf_network_model_description, val);}
开发者ID:dhascome,项目名称:simgrid,代码行数:18,


示例15: _sg_cfg_cb__storage_mode

/* callback of the cpu/model variable */static void _sg_cfg_cb__storage_mode(const char *name, int pos){  char *val;  xbt_assert(_sg_cfg_init_status < 2,              "Cannot change the model after the initialization");  val = xbt_cfg_get_string(_sg_cfg_set, name);  if (!strcmp(val, "help")) {    model_help("storage", surf_storage_model_description);    sg_cfg_exit_early();  }  /* New Module missing */  find_model_description(surf_storage_model_description, val);}
开发者ID:congfairy,项目名称:simgrid,代码行数:18,


示例16: _sg_cfg_cb_contexts_parallel_mode

static void _sg_cfg_cb_contexts_parallel_mode(const char *name, int pos){  const char* mode_name = xbt_cfg_get_string(_sg_cfg_set, name);  if (!strcmp(mode_name, "posix")) {    SIMIX_context_set_parallel_mode(XBT_PARMAP_POSIX);  }  else if (!strcmp(mode_name, "futex")) {    SIMIX_context_set_parallel_mode(XBT_PARMAP_FUTEX);  }  else if (!strcmp(mode_name, "busy_wait")) {    SIMIX_context_set_parallel_mode(XBT_PARMAP_BUSY_WAIT);  }  else {    xbt_die("Command line setting of the parallel synchronization mode should "            "be one of /"posix/", /"futex/" or /"busy_wait/"");  }}
开发者ID:congfairy,项目名称:simgrid,代码行数:17,


示例17: _sg_cfg_cb__coll

/* callback of the mpi collectives */static void _sg_cfg_cb__coll(const char *category,                             s_mpi_coll_description_t * table,                             const char *name, int pos){  char *val;  xbt_assert(_sg_cfg_init_status < 2,              "Cannot change the model after the initialization");  val = xbt_cfg_get_string(_sg_cfg_set, name);  if (!strcmp(val, "help")) {    coll_help(category, table);    sg_cfg_exit_early();  }  /* New Module missing */  find_coll_description(table, val, category);}
开发者ID:congfairy,项目名称:simgrid,代码行数:20,


示例18: CpuModel

CpuCas01Model::CpuCas01Model() : CpuModel("cpu"){  char *optim = xbt_cfg_get_string(_sg_cfg_set, "cpu/optim");  int select = xbt_cfg_get_boolean(_sg_cfg_set, "cpu/maxmin_selective_update");  if (!strcmp(optim, "Full")) {    p_updateMechanism = UM_FULL;    m_selectiveUpdate = select;  } else if (!strcmp(optim, "Lazy")) {    p_updateMechanism = UM_LAZY;    m_selectiveUpdate = 1;    xbt_assert((select == 1)               ||               (xbt_cfg_is_default_value                (_sg_cfg_set, "cpu/maxmin_selective_update")),               "Disabling selective update while using the lazy update mechanism is dumb!");  } else {    xbt_die("Unsupported optimization (%s) for this model", optim);  }  p_cpuRunningActionSetThatDoesNotNeedBeingChecked = new ActionList();  if (getUpdateMechanism() == UM_LAZY) {	shareResources = &CpuCas01Model::shareResourcesLazy;	updateActionsState = &CpuCas01Model::updateActionsStateLazy;  } else if (getUpdateMechanism() == UM_FULL) {	shareResources = &CpuCas01Model::shareResourcesFull;	updateActionsState = &CpuCas01Model::updateActionsStateFull;  } else    xbt_die("Invalid cpu update mechanism!");  if (!p_maxminSystem) {    p_maxminSystem = lmm_system_new(m_selectiveUpdate);  }  if (getUpdateMechanism() == UM_LAZY) {    p_actionHeap = xbt_heap_new(8, NULL);    xbt_heap_set_update_callback(p_actionHeap,  surf_action_lmm_update_index_heap);    p_modifiedSet = new ActionLmmList();    p_maxminSystem->keep_track = p_modifiedSet;  }}
开发者ID:FlorianPO,项目名称:simgrid,代码行数:43,


示例19: _sg_cfg_cb__plugin

/* callback of the plugin variable */static void _sg_cfg_cb__plugin(const char *name, int pos){  char *val;  XBT_VERB("PLUGIN");  xbt_assert(_sg_cfg_init_status < 2,              "Cannot load a plugin after the initialization");  val = xbt_cfg_get_string(_sg_cfg_set, name);  if (!strcmp(val, "help")) {    model_help("plugin", surf_plugin_description);    sg_cfg_exit_early();  }  /* New Module missing */  int plugin_id = find_model_description(surf_plugin_description, val);  surf_plugin_description[plugin_id].model_init_preparse();}
开发者ID:congfairy,项目名称:simgrid,代码行数:20,


示例20: surf_cpu_model_init_Cas01

/********* * Model * *********/void surf_cpu_model_init_Cas01(){  char *optim = xbt_cfg_get_string(_sg_cfg_set, "cpu/optim");  xbt_assert(!surf_cpu_model_pm);  xbt_assert(!surf_cpu_model_vm);  if (!strcmp(optim, "TI")) {    surf_cpu_model_init_ti();    return;  }  surf_cpu_model_pm = new CpuCas01Model();  surf_cpu_model_vm  = new CpuCas01Model();  cpu_define_callbacks();  ModelPtr model_pm = surf_cpu_model_pm;  ModelPtr model_vm = surf_cpu_model_vm;  xbt_dynar_push(model_list, &model_pm);  xbt_dynar_push(model_list, &model_vm);}
开发者ID:FlorianPO,项目名称:simgrid,代码行数:24,


示例21: xbt_cfg_get_string

void NetworkCm02Model::initialize(){  char *optim = xbt_cfg_get_string(_sg_cfg_set, "network/optim");  int select =      xbt_cfg_get_boolean(_sg_cfg_set, "network/maxmin_selective_update");  if (!strcmp(optim, "Full")) {    p_updateMechanism = UM_FULL;    m_selectiveUpdate = select;  } else if (!strcmp(optim, "Lazy")) {    p_updateMechanism = UM_LAZY;    m_selectiveUpdate = 1;    xbt_assert((select == 1)               ||               (xbt_cfg_is_default_value                (_sg_cfg_set, "network/maxmin_selective_update")),               "Disabling selective update while using the lazy update mechanism is dumb!");  } else {    xbt_die("Unsupported optimization (%s) for this model", optim);  }  if (!p_maxminSystem)	p_maxminSystem = lmm_system_new(m_selectiveUpdate);  const char* lb_name = "__loopback__";  routing_model_create(createNetworkLink(lb_name,	                                           498000000, NULL, 0.000015, NULL,	                                           SURF_RESOURCE_ON, NULL,	                                           SURF_LINK_FATPIPE, NULL));  if (p_updateMechanism == UM_LAZY) {	p_actionHeap = xbt_heap_new(8, NULL);	xbt_heap_set_update_callback(p_actionHeap, surf_action_lmm_update_index_heap);	p_modifiedSet = new ActionLmmList();	p_maxminSystem->keep_track = p_modifiedSet;  }  m_haveGap = false;}
开发者ID:frs69wq,项目名称:simgrid,代码行数:39,


示例22: xbt_cfg_get_string

char *TRACE_get_viva_cat_conf (void){  return xbt_cfg_get_string(_surf_cfg_set, OPT_VIVA_CAT_CONF);}
开发者ID:Shurakai,项目名称:SimGrid,代码行数:4,


示例23: _sg_cfg_cb_context_factory

static void _sg_cfg_cb_context_factory(const char *name, int pos){  smx_context_factory_name = xbt_cfg_get_string(_sg_cfg_set, name);}
开发者ID:congfairy,项目名称:simgrid,代码行数:4,


示例24: _sg_cfg_cb_model_check_replay

static void _sg_cfg_cb_model_check_replay(const char *name, int pos){  MC_record_path = xbt_cfg_get_string(_sg_cfg_set, name);}
开发者ID:congfairy,项目名称:simgrid,代码行数:4,


示例25: sg_cfg_get_string

char* sg_cfg_get_string(const char* name){  return xbt_cfg_get_string(_sg_cfg_set, name);}
开发者ID:congfairy,项目名称:simgrid,代码行数:4,


示例26: surf_config_models_setup

/* Pick the right models for CPU, net and host, and call their model_init_preparse */void surf_config_models_setup(){  const char *host_model_name;  const char *vm_model_name;  int host_id = -1;  int vm_id = -1;  char *network_model_name = NULL;  char *cpu_model_name = NULL;  int storage_id = -1;  char *storage_model_name = NULL;  host_model_name = xbt_cfg_get_string(_sg_cfg_set, "host/model");  vm_model_name = xbt_cfg_get_string(_sg_cfg_set, "vm/model");  network_model_name = xbt_cfg_get_string(_sg_cfg_set, "network/model");  cpu_model_name = xbt_cfg_get_string(_sg_cfg_set, "cpu/model");  storage_model_name = xbt_cfg_get_string(_sg_cfg_set, "storage/model");  /* Check whether we use a net/cpu model differing from the default ones, in which case   * we should switch to the "compound" host model to correctly dispatch stuff to   * the right net/cpu models.   */  if ((!xbt_cfg_is_default_value(_sg_cfg_set, "network/model") ||       !xbt_cfg_is_default_value(_sg_cfg_set, "cpu/model")) &&      xbt_cfg_is_default_value(_sg_cfg_set, "host/model")) {    host_model_name = "compound";    xbt_cfg_set_string(_sg_cfg_set, "host/model", host_model_name);  }  XBT_DEBUG("host model: %s", host_model_name);  host_id = find_model_description(surf_host_model_description, host_model_name);  if (!strcmp(host_model_name, "compound")) {    int network_id = -1;    int cpu_id = -1;    xbt_assert(cpu_model_name,                "Set a cpu model to use with the 'compound' host model");    xbt_assert(network_model_name,                "Set a network model to use with the 'compound' host model");    if(surf_cpu_model_init_preparse){      surf_cpu_model_init_preparse();    } else {      cpu_id =          find_model_description(surf_cpu_model_description, cpu_model_name);      surf_cpu_model_description[cpu_id].model_init_preparse();    }    network_id =        find_model_description(surf_network_model_description,                               network_model_name);    surf_network_model_description[network_id].model_init_preparse();  }  XBT_DEBUG("Call host_model_init");  surf_host_model_description[host_id].model_init_preparse();  XBT_DEBUG("Call vm_model_init");  vm_id = find_model_description(surf_vm_model_description, vm_model_name);  surf_vm_model_description[vm_id].model_init_preparse();  XBT_DEBUG("Call storage_model_init");  storage_id = find_model_description(surf_storage_model_description, storage_model_name);  surf_storage_model_description[storage_id].model_init_preparse();}
开发者ID:congfairy,项目名称:simgrid,代码行数:68,



注:本文中的xbt_cfg_get_string函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ xbt_die函数代码示例
C++ xbt_assert函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。