SimGrid  3.16
Versatile Simulation of Distributed Systems
surfxml_sax_cb.cpp File Reference
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/sg_config.h"
#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
#include "xbt/file.h"
#include "src/surf/xml/platf_private.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <string>
#include "simgrid_dtd.c"

Classes

struct  unit_scale
 

Functions

 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (surf_parse, surf, "Logging specific to the SURF parsing module")
 
int ETag_surfxml_include_state ()
 When reaching EOF, check whether we are in an include tag, and behave accordingly if yes. More...
 
void surf_parse_assert (bool cond, const char *fmt,...)
 
void surf_parse_error (const char *fmt,...)
 
void surf_parse_assert_netpoint (char *hostname, const char *pre, const char *post)
 
void surf_parse_warn (const char *fmt,...)
 
double surf_parse_get_double (const char *string)
 
int surf_parse_get_int (const char *string)
 
static std::vector< int > * explodesRadical (const char *radicals)
 
static double surf_parse_get_value_with_unit (const char *string, const struct unit_scale *units, const char *entity_kind, const char *name, const char *error_msg, const char *default_unit)
 
double surf_parse_get_time (const char *string, const char *entity_kind, const char *name)
 
double surf_parse_get_size (const char *string, const char *entity_kind, const char *name)
 
double surf_parse_get_bandwidth (const char *string, const char *entity_kind, const char *name)
 
double surf_parse_get_speed (const char *string, const char *entity_kind, const char *name)
 
static std::vector< double > surf_parse_get_all_speeds (char *speeds, const char *entity_kind, const char *id)
 
void STag_surfxml_storage ()
 
void ETag_surfxml_storage ()
 
void STag_surfxml_storage___type ()
 
void ETag_surfxml_storage___type ()
 
void STag_surfxml_mount ()
 
void ETag_surfxml_mount ()
 
void STag_surfxml_include ()
 
void ETag_surfxml_include ()
 
void STag_surfxml_platform ()
 
void ETag_surfxml_platform ()
 
void STag_surfxml_host ()
 
void STag_surfxml_prop ()
 
void ETag_surfxml_host ()
 
void STag_surfxml_host___link ()
 
void STag_surfxml_router ()
 
void ETag_surfxml_cluster ()
 
void STag_surfxml_cluster ()
 
void STag_surfxml_cabinet ()
 
void STag_surfxml_peer ()
 
void STag_surfxml_link ()
 
void ETag_surfxml_link ()
 
void STag_surfxml_link___ctn ()
 
void ETag_surfxml_backbone ()
 
void STag_surfxml_route ()
 
void STag_surfxml_ASroute ()
 
void STag_surfxml_zoneRoute ()
 
void STag_surfxml_bypassRoute ()
 
void STag_surfxml_bypassASroute ()
 
void STag_surfxml_bypassZoneRoute ()
 
void ETag_surfxml_route ()
 
void ETag_surfxml_ASroute ()
 
void ETag_surfxml_zoneRoute ()
 
void ETag_surfxml_bypassRoute ()
 
void ETag_surfxml_bypassASroute ()
 
void ETag_surfxml_bypassZoneRoute ()
 
void ETag_surfxml_trace ()
 
void STag_surfxml_trace___connect ()
 
void STag_surfxml_AS ()
 
void ETag_surfxml_AS ()
 
void STag_surfxml_zone ()
 
void ETag_surfxml_zone ()
 
void STag_surfxml_config ()
 
void ETag_surfxml_config ()
 
void STag_surfxml_process ()
 
void STag_surfxml_actor ()
 
void ETag_surfxml_process ()
 
void ETag_surfxml_actor ()
 
void STag_surfxml_argument ()
 
void STag_surfxml_model___prop ()
 
void ETag_surfxml_prop ()
 
void STag_surfxml_random ()
 
void ETag_surfxml_random ()
 
void ETag_surfxml_trace___connect ()
 
void STag_surfxml_trace ()
 
void ETag_surfxml_router ()
 
void ETag_surfxml_host___link ()
 
void ETag_surfxml_cabinet ()
 
void ETag_surfxml_peer ()
 
void STag_surfxml_backbone ()
 
void ETag_surfxml_link___ctn ()
 
void ETag_surfxml_argument ()
 
void ETag_surfxml_model___prop ()
 
void surf_parse_open (const char *file)
 
void surf_parse_close ()
 
static int _surf_parse ()
 

Variables

char * surf_parsed_filename = nullptr
 
std::vector< simgrid::surf::LinkImpl * > parsed_link_list
 
xbt_dict_t current_property_set = nullptr
 
std::map< std::string, std::string > * current_model_property_set = nullptr
 
int ZONE_TAG = 0
 
xbt_dict_t random_data_list = nullptr
 
YY_BUFFER_STATE surf_input_buffer
 
FILE * surf_file_to_parse = nullptr
 
static std::vector< YY_BUFFER_STATEsurf_input_buffer_stack
 
static std::vector< FILE * > surf_file_to_parse_stack
 
static std::vector< char * > surf_parsed_filename_stack
 
static int argc
 
static char ** argv
 
int_f_void_t surf_parse = &_surf_parse
 

Function Documentation

◆ XBT_LOG_NEW_DEFAULT_SUBCATEGORY()

XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( surf_parse  ,
surf  ,
"Logging specific to the SURF parsing module"   
)

◆ ETag_surfxml_include_state()

int ETag_surfxml_include_state ( )

When reaching EOF, check whether we are in an include tag, and behave accordingly if yes.

This function is called automatically by sedding the parser in tools/cmake/MaintainerMode.cmake Every FAIL on "Premature EOF" is preceded by a call to this function, which role is to restore the previous buffer if we reached the EOF /of an include file/. Its return code is used to avoid the error message in that case.

Yeah, that's terribly hackish, but it works. A better solution should be dealed with in flexml directly: a command line flag could instruct it to do the correct thing when the include directive is encountered on a line. One day maybe, if the maya allow it.

◆ surf_parse_assert()

void surf_parse_assert ( bool  cond,
const char *  fmt,
  ... 
)

◆ surf_parse_error()

void surf_parse_error ( const char *  fmt,
  ... 
)

◆ surf_parse_assert_netpoint()

void surf_parse_assert_netpoint ( char *  hostname,
const char *  pre,
const char *  post 
)

◆ surf_parse_warn()

void surf_parse_warn ( const char *  fmt,
  ... 
)

◆ surf_parse_get_double()

double surf_parse_get_double ( const char *  string)

◆ surf_parse_get_int()

int surf_parse_get_int ( const char *  string)

◆ explodesRadical()

static std::vector<int>* explodesRadical ( const char *  radicals)
static

◆ surf_parse_get_value_with_unit()

static double surf_parse_get_value_with_unit ( const char *  string,
const struct unit_scale units,
const char *  entity_kind,
const char *  name,
const char *  error_msg,
const char *  default_unit 
)
static

◆ surf_parse_get_time()

double surf_parse_get_time ( const char *  string,
const char *  entity_kind,
const char *  name 
)

◆ surf_parse_get_size()

double surf_parse_get_size ( const char *  string,
const char *  entity_kind,
const char *  name 
)

◆ surf_parse_get_bandwidth()

double surf_parse_get_bandwidth ( const char *  string,
const char *  entity_kind,
const char *  name 
)

◆ surf_parse_get_speed()

double surf_parse_get_speed ( const char *  string,
const char *  entity_kind,
const char *  name 
)

◆ surf_parse_get_all_speeds()

static std::vector<double> surf_parse_get_all_speeds ( char *  speeds,
const char *  entity_kind,
const char *  id 
)
static

◆ STag_surfxml_storage()

void STag_surfxml_storage ( void  )

◆ ETag_surfxml_storage()

void ETag_surfxml_storage ( void  )

◆ STag_surfxml_storage___type()

void STag_surfxml_storage___type ( void  )

◆ ETag_surfxml_storage___type()

void ETag_surfxml_storage___type ( void  )

◆ STag_surfxml_mount()

void STag_surfxml_mount ( void  )

◆ ETag_surfxml_mount()

void ETag_surfxml_mount ( void  )

◆ STag_surfxml_include()

void STag_surfxml_include ( void  )

◆ ETag_surfxml_include()

void ETag_surfxml_include ( void  )

◆ STag_surfxml_platform()

void STag_surfxml_platform ( void  )

◆ ETag_surfxml_platform()

void ETag_surfxml_platform ( void  )

◆ STag_surfxml_host()

void STag_surfxml_host ( void  )

◆ STag_surfxml_prop()

void STag_surfxml_prop ( void  )

◆ ETag_surfxml_host()

void ETag_surfxml_host ( void  )

◆ STag_surfxml_host___link()

void STag_surfxml_host___link ( void  )

◆ STag_surfxml_router()

void STag_surfxml_router ( void  )

◆ ETag_surfxml_cluster()

void ETag_surfxml_cluster ( void  )

◆ STag_surfxml_cluster()

void STag_surfxml_cluster ( void  )

◆ STag_surfxml_cabinet()

void STag_surfxml_cabinet ( void  )

◆ STag_surfxml_peer()

void STag_surfxml_peer ( void  )

◆ STag_surfxml_link()

void STag_surfxml_link ( void  )

◆ ETag_surfxml_link()

void ETag_surfxml_link ( void  )

◆ STag_surfxml_link___ctn()

void STag_surfxml_link___ctn ( void  )

◆ ETag_surfxml_backbone()

void ETag_surfxml_backbone ( void  )

◆ STag_surfxml_route()

void STag_surfxml_route ( void  )

◆ STag_surfxml_ASroute()

void STag_surfxml_ASroute ( void  )

◆ STag_surfxml_zoneRoute()

void STag_surfxml_zoneRoute ( void  )

◆ STag_surfxml_bypassRoute()

void STag_surfxml_bypassRoute ( void  )

◆ STag_surfxml_bypassASroute()

void STag_surfxml_bypassASroute ( void  )

◆ STag_surfxml_bypassZoneRoute()

void STag_surfxml_bypassZoneRoute ( void  )

◆ ETag_surfxml_route()

void ETag_surfxml_route ( void  )

◆ ETag_surfxml_ASroute()

void ETag_surfxml_ASroute ( void  )

◆ ETag_surfxml_zoneRoute()

void ETag_surfxml_zoneRoute ( void  )

◆ ETag_surfxml_bypassRoute()

void ETag_surfxml_bypassRoute ( void  )

◆ ETag_surfxml_bypassASroute()

void ETag_surfxml_bypassASroute ( void  )

◆ ETag_surfxml_bypassZoneRoute()

void ETag_surfxml_bypassZoneRoute ( void  )

◆ ETag_surfxml_trace()

void ETag_surfxml_trace ( void  )

◆ STag_surfxml_trace___connect()

void STag_surfxml_trace___connect ( void  )

◆ STag_surfxml_AS()

void STag_surfxml_AS ( void  )

◆ ETag_surfxml_AS()

void ETag_surfxml_AS ( void  )

◆ STag_surfxml_zone()

void STag_surfxml_zone ( void  )

◆ ETag_surfxml_zone()

void ETag_surfxml_zone ( void  )

◆ STag_surfxml_config()

void STag_surfxml_config ( void  )

◆ ETag_surfxml_config()

void ETag_surfxml_config ( void  )

◆ STag_surfxml_process()

void STag_surfxml_process ( void  )

◆ STag_surfxml_actor()

void STag_surfxml_actor ( void  )

◆ ETag_surfxml_process()

void ETag_surfxml_process ( void  )

◆ ETag_surfxml_actor()

void ETag_surfxml_actor ( void  )

◆ STag_surfxml_argument()

void STag_surfxml_argument ( void  )

◆ STag_surfxml_model___prop()

void STag_surfxml_model___prop ( void  )

◆ ETag_surfxml_prop()

void ETag_surfxml_prop ( void  )

◆ STag_surfxml_random()

void STag_surfxml_random ( void  )

◆ ETag_surfxml_random()

void ETag_surfxml_random ( void  )

◆ ETag_surfxml_trace___connect()

void ETag_surfxml_trace___connect ( void  )

◆ STag_surfxml_trace()

void STag_surfxml_trace ( void  )

◆ ETag_surfxml_router()

void ETag_surfxml_router ( void  )

◆ ETag_surfxml_host___link()

void ETag_surfxml_host___link ( void  )

◆ ETag_surfxml_cabinet()

void ETag_surfxml_cabinet ( void  )

◆ ETag_surfxml_peer()

void ETag_surfxml_peer ( void  )

◆ STag_surfxml_backbone()

void STag_surfxml_backbone ( void  )

◆ ETag_surfxml_link___ctn()

void ETag_surfxml_link___ctn ( void  )

◆ ETag_surfxml_argument()

void ETag_surfxml_argument ( void  )

◆ ETag_surfxml_model___prop()

void ETag_surfxml_model___prop ( void  )

◆ surf_parse_open()

void surf_parse_open ( const char *  file)

◆ surf_parse_close()

void surf_parse_close ( )

◆ _surf_parse()

static int _surf_parse ( )
static

Variable Documentation

◆ surf_parsed_filename

char* surf_parsed_filename = nullptr

◆ parsed_link_list

std::vector<simgrid::surf::LinkImpl*> parsed_link_list

◆ current_property_set

xbt_dict_t current_property_set = nullptr

◆ current_model_property_set

std::map<std::string, std::string>* current_model_property_set = nullptr

◆ ZONE_TAG

int ZONE_TAG = 0

◆ random_data_list

xbt_dict_t random_data_list = nullptr

◆ surf_input_buffer

YY_BUFFER_STATE surf_input_buffer

◆ surf_file_to_parse

FILE* surf_file_to_parse = nullptr

◆ surf_input_buffer_stack

std::vector<YY_BUFFER_STATE> surf_input_buffer_stack
static

◆ surf_file_to_parse_stack

std::vector<FILE*> surf_file_to_parse_stack
static

◆ surf_parsed_filename_stack

std::vector<char*> surf_parsed_filename_stack
static

◆ argc

int argc
static

◆ argv

char** argv
static

◆ surf_parse

int_f_void_t surf_parse = &_surf_parse