} s_sg_platf_host_cbarg_t, *sg_platf_host_cbarg_t;
#define SG_PLATF_HOST_INITIALIZER { \
- .id = NULL,\
- .power_peak = 0,\
- .core_amount = 1.,\
- .power_scale = 1,\
- .initial_state = SURF_RESOURCE_ON,\
- .power_trace = NULL,\
- .state_trace = NULL,\
- .coord = NULL,\
- .properties = NULL\
- }
+ NULL, 0, 1, 1, 1., NULL, SURF_RESOURCE_ON, NULL, \
+ NULL, NULL \
+}
typedef struct {
const char* id;
} s_sg_platf_link_cbarg_t, *sg_platf_link_cbarg_t;
#define SG_PLATF_LINK_INITIALIZER {\
- .id = NULL,\
- .bandwidth = 0.,\
- .bandwidth_trace = NULL,\
- .latency = 0.,\
- .latency_trace = NULL,\
- .state = SURF_RESOURCE_ON,\
- .state_trace = NULL,\
- .policy = SURF_LINK_SHARED,\
- .properties = NULL\
+ NULL, 0., NULL, 0., NULL, SURF_RESOURCE_ON, \
+ NULL, SURF_LINK_SHARED, NULL \
}
typedef struct s_sg_platf_peer_cbarg *sg_platf_peer_cbarg_t;
tmgr_trace_t state_trace;
} s_sg_platf_peer_cbarg_t;
-#define SG_PLATF_PEER_INITIALIZER {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}
+#define SG_PLATF_PEER_INITIALIZER {NULL,0.0,0.0,0.0,0.0,NULL,NULL,NULL}
typedef struct s_sg_platf_route_cbarg *sg_platf_route_cbarg_t;
typedef struct s_sg_platf_route_cbarg {
xbt_dynar_t link_list;
} s_sg_platf_route_cbarg_t;
-#define SG_PLATF_ROUTE_INITIALIZER {TRUE,NULL,NULL,NULL,NULL,NULL}
+#define SG_PLATF_ROUTE_INITIALIZER {1,NULL,NULL,NULL,NULL,NULL}
typedef struct s_sg_platf_cluster_cbarg *sg_platf_cluster_cbarg_t;
typedef struct s_sg_platf_cluster_cbarg {
const char* state_trace;
} s_sg_platf_cluster_cbarg_t;
-#define SG_PLATF_CLUSTER_INITIALIZER {NULL,NULL,NULL,NULL,NULL,NULL \
- ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}
+#define SG_PLATF_CLUSTER_INITIALIZER {NULL,NULL,NULL,NULL,0.0,1 \
+ ,1.,1.,0.,0.,0.,0.,0. \
+ ,SURF_CLUSTER_FLAT,NULL,NULL,NULL, \
+ SURF_LINK_SHARED,SURF_LINK_SHARED,NULL \
+ ,NULL}
typedef struct s_sg_platf_cabinet_cbarg *sg_platf_cabinet_cbarg_t;
typedef struct s_sg_platf_cabinet_cbarg {
double lat;
} s_sg_platf_cabinet_cbarg_t;
-#define SG_PLATF_CABINET_INITIALIZER {NULL,NULL,NULL,NULL,NULL,NULL,NULL}
+#define SG_PLATF_CABINET_INITIALIZER {NULL,NULL,NULL,NULL,0.0,0.0,0.0}
typedef struct {
const char* id;
const char* attach;
} s_sg_platf_storage_cbarg_t, *sg_platf_storage_cbarg_t;
-#define SG_PLATF_STORAGE_INITIALIZER {NULL,NULL,NULL,NULL}
+#define SG_PLATF_STORAGE_INITIALIZER {NULL,NULL,NULL,NULL,NULL,NULL}
typedef struct {
const char* id;
sg_size_t size;
} s_sg_platf_storage_type_cbarg_t, *sg_platf_storage_type_cbarg_t;
-#define SG_PLATF_STORAGE_TYPE_INITIALIZER {NULL,NULL,NULL,NULL,NULL}
+#define SG_PLATF_STORAGE_TYPE_INITIALIZER {NULL,NULL,NULL,NULL,NULL,NULL}
typedef struct {
const char* type_id;
const char *pc_data;
} s_sg_platf_trace_cbarg_t;
-#define SG_PLATF_TRACE_INITIALIZER {NULL,NULL,NULL,NULL}
+#define SG_PLATF_TRACE_INITIALIZER {NULL,NULL,0.0,NULL}
typedef struct s_sg_platf_trace_connect_cbarg *sg_platf_trace_connect_cbarg_t;
typedef struct s_sg_platf_trace_connect_cbarg {
const char *element;
} s_sg_platf_trace_connect_cbarg_t;
-#define SG_PLATF_TRACE_CONNECT_INITIALIZER {NULL,NULL,NULL}
+#define SG_PLATF_TRACE_CONNECT_INITIALIZER {SURF_TRACE_CONNECT_KIND_LATENCY,NULL,NULL}
typedef struct s_sg_platf_process_cbarg *sg_platf_process_cbarg_t;
typedef struct s_sg_platf_process_cbarg {
sg_platf_host_cbarg_t host_parameters;
sg_platf_cluster_cbarg_t cluster_parameters;
sg_platf_link_cbarg_t link_parameters;
- s_sg_platf_router_cbarg_t router_parameters; /* This one is not a pointer! */
- s_sg_platf_route_cbarg_t route_parameters; /* neither this one! */
+ s_sg_platf_router_cbarg_t router_parameters = SG_PLATF_ROUTER_INITIALIZER; /* This one is not a pointer! */
+ s_sg_platf_route_cbarg_t route_parameters = SG_PLATF_ROUTE_INITIALIZER; /* neither this one! */
router_parameters.coord = NULL;
route_parameters.symmetrical = FALSE;
static void _get_route_and_latency(RoutingEdgePtr src, RoutingEdgePtr dst,
xbt_dynar_t * links, double *latency)
{
- s_sg_platf_route_cbarg_t route;
+ s_sg_platf_route_cbarg_t route = SG_PLATF_ROUTE_INITIALIZER;
memset(&route,0,sizeof(route));
xbt_assert(src && dst, "bad parameters for \"_get_route_latency\" method");
surf_parse_error("Malformed radical");
break;
}
- s_sg_platf_host_cbarg_t host;
+ s_sg_platf_host_cbarg_t host = SG_PLATF_HOST_INITIALIZER;
memset(&host, 0, sizeof(host));
host.initial_state = SURF_RESOURCE_ON;
host.pstate = 0;
host.power_scale = 1.0;
host.core_amount = 1;
- s_sg_platf_link_cbarg_t link;
+ s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
memset(&link, 0, sizeof(link));
link.state = SURF_RESOURCE_ON;
link.policy = SURF_LINK_FULLDUPLEX;
link.latency = cabinet->lat;
link.bandwidth = cabinet->bw;
- s_sg_platf_host_link_cbarg_t host_link;
+ s_sg_platf_host_link_cbarg_t host_link = SG_PLATF_HOST_LINK_INITIALIZER;
memset(&host_link, 0, sizeof(host_link));
for (i = start; i <= end; i++) {
xbt_dict_t patterns = NULL;
int rankId=0;
- s_sg_platf_host_cbarg_t host;
- s_sg_platf_link_cbarg_t link;
+ s_sg_platf_host_cbarg_t host = SG_PLATF_HOST_INITIALIZER;
+ s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
unsigned int iter;
int start, end, i;
XBT_DEBUG(" ");
XBT_DEBUG("<router id=\"%s\"/>", cluster->router_id);
char *newid = NULL;
- s_sg_platf_router_cbarg_t router;
+ s_sg_platf_router_cbarg_t router = SG_PLATF_ROUTER_INITIALIZER;
memset(&router, 0, sizeof(router));
router.id = cluster->router_id;
router.coord = "";
current_routing->p_linkUpDownList = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);
XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\"/>", host_id, peer->power);
- s_sg_platf_host_cbarg_t host;
+ s_sg_platf_host_cbarg_t host = SG_PLATF_HOST_INITIALIZER;
memset(&host, 0, sizeof(host));
host.initial_state = SURF_RESOURCE_ON;
host.id = host_id;
host.core_amount = 1;
sg_platf_new_host(&host);
- s_sg_platf_link_cbarg_t link;
+ s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
memset(&link, 0, sizeof(link));
link.state = SURF_RESOURCE_ON;
link.policy = SURF_LINK_SHARED;
sg_platf_new_link(&link);
XBT_DEBUG("<host_link\tid=\"%s\"\tup=\"%s\"\tdown=\"%s\" />", host_id,link_up,link_down);
- s_sg_platf_host_link_cbarg_t host_link;
+ s_sg_platf_host_link_cbarg_t host_link = SG_PLATF_HOST_LINK_INITIALIZER;
memset(&host_link, 0, sizeof(host_link));
host_link.id = host_id;
host_link.link_up = link_up;
sg_platf_new_host_link(&host_link);
XBT_DEBUG("<router id=\"%s\"/>", router_id);
- s_sg_platf_router_cbarg_t router;
+ s_sg_platf_router_cbarg_t router = SG_PLATF_ROUTER_INITIALIZER;
memset(&router, 0, sizeof(router));
router.id = router_id;
router.coord = peer->coord;
}
void AsCluster::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int , int position){
- s_sg_platf_link_cbarg_t link;
+ s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
s_surf_parsing_link_up_down_t info;
char* link_id = bprintf("%s_link_%d", cluster->id, id);
FatTreeNode::FatTreeNode(sg_platf_cluster_cbarg_t cluster, int id, int level,
int position) : id(id), level(level),
position(position) {
- s_sg_platf_link_cbarg_t linkTemplate;
+ s_sg_platf_link_cbarg_t linkTemplate = SG_PLATF_LINK_INITIALIZER;
if(cluster->limiter_link) {
memset(&linkTemplate, 0, sizeof(linkTemplate));
linkTemplate.bandwidth = cluster->limiter_link;
FatTreeNode *upNode) : upNode(upNode),
downNode(downNode) {
static int uniqueId = 0;
- s_sg_platf_link_cbarg_t linkTemplate;
+ s_sg_platf_link_cbarg_t linkTemplate = SG_PLATF_LINK_INITIALIZER;
memset(&linkTemplate, 0, sizeof(linkTemplate));
linkTemplate.bandwidth = cluster->bw;
linkTemplate.latency = cluster->lat;
void AsClusterTorus::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position){
- s_sg_platf_link_cbarg_t link;
+ s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
char* link_id;
unsigned int j = 0;
/**
}
void ETag_surfxml_storage(void)
{
- s_sg_platf_storage_cbarg_t storage;
+ s_sg_platf_storage_cbarg_t storage = SG_PLATF_STORAGE_INITIALIZER;
memset(&storage,0,sizeof(storage));
storage.id = A_surfxml_storage_id;
}
void ETag_surfxml_storage___type(void)
{
- s_sg_platf_storage_type_cbarg_t storage_type;
+ s_sg_platf_storage_type_cbarg_t storage_type = SG_PLATF_STORAGE_TYPE_INITIALIZER;
memset(&storage_type,0,sizeof(storage_type));
storage_type.content = A_surfxml_storage___type_content;
}
void ETag_surfxml_mstorage(void)
{
- s_sg_platf_mstorage_cbarg_t mstorage;
+ s_sg_platf_mstorage_cbarg_t mstorage = SG_PLATF_MSTORAGE_INITIALIZER;
memset(&mstorage,0,sizeof(mstorage));
mstorage.name = A_surfxml_mstorage_name;
}
void ETag_surfxml_mount(void)
{
- s_sg_platf_mount_cbarg_t mount;
+ s_sg_platf_mount_cbarg_t mount = SG_PLATF_MOUNT_INITIALIZER;
memset(&mount,0,sizeof(mount));
mount.name = A_surfxml_mount_name;
}
void ETag_surfxml_host(void) {
- s_sg_platf_host_cbarg_t host;
+ s_sg_platf_host_cbarg_t host = SG_PLATF_HOST_INITIALIZER;
char* buf;
memset(&host,0,sizeof(host));
void STag_surfxml_host___link(void){
XBT_DEBUG("Create a Host_link for %s",A_surfxml_host___link_id);
- s_sg_platf_host_link_cbarg_t host_link;
+ s_sg_platf_host_link_cbarg_t host_link = SG_PLATF_HOST_LINK_INITIALIZER;
memset(&host_link,0,sizeof(host_link));
host_link.id = A_surfxml_host___link_id;
}
void STag_surfxml_router(void){
- s_sg_platf_router_cbarg_t router;
+ s_sg_platf_router_cbarg_t router = SG_PLATF_ROUTER_INITIALIZER;
memset(&router, 0, sizeof(router));
router.id = A_surfxml_router_id;
}
void ETag_surfxml_cluster(void){
- s_sg_platf_cluster_cbarg_t cluster;
+ s_sg_platf_cluster_cbarg_t cluster = SG_PLATF_CLUSTER_INITIALIZER;
memset(&cluster,0,sizeof(cluster));
cluster.properties = as_current_property_set;
void STag_surfxml_cabinet(void){
parse_after_config();
- s_sg_platf_cabinet_cbarg_t cabinet;
+ s_sg_platf_cabinet_cbarg_t cabinet = SG_PLATF_CABINET_INITIALIZER;
memset(&cabinet,0,sizeof(cabinet));
cabinet.id = A_surfxml_cabinet_id;
cabinet.prefix = A_surfxml_cabinet_prefix;
void STag_surfxml_peer(void){
parse_after_config();
- s_sg_platf_peer_cbarg_t peer;
+ s_sg_platf_peer_cbarg_t peer = SG_PLATF_PEER_INITIALIZER;
memset(&peer,0,sizeof(peer));
peer.id = A_surfxml_peer_id;
peer.power = surf_parse_get_power(A_surfxml_peer_power);
}
void ETag_surfxml_link(void){
- s_sg_platf_link_cbarg_t link;
+ s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
memset(&link,0,sizeof(link));
link.properties = current_property_set;
}
void ETag_surfxml_backbone(void){
- s_sg_platf_link_cbarg_t link;
+ s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
memset(&link,0,sizeof(link));
link.properties = NULL;
}
void ETag_surfxml_route(void){
- s_sg_platf_route_cbarg_t route;
+ s_sg_platf_route_cbarg_t route = SG_PLATF_ROUTE_INITIALIZER;
memset(&route,0,sizeof(route));
route.src = A_surfxml_route_src;
}
void ETag_surfxml_ASroute(void){
- s_sg_platf_route_cbarg_t ASroute;
+ s_sg_platf_route_cbarg_t ASroute = SG_PLATF_ROUTE_INITIALIZER;
memset(&ASroute,0,sizeof(ASroute));
ASroute.src = A_surfxml_ASroute_src;
}
void ETag_surfxml_bypassRoute(void){
- s_sg_platf_route_cbarg_t route;
+ s_sg_platf_route_cbarg_t route = SG_PLATF_ROUTE_INITIALIZER;
memset(&route,0,sizeof(route));
route.src = A_surfxml_bypassRoute_src;
}
void ETag_surfxml_bypassASroute(void){
- s_sg_platf_route_cbarg_t ASroute;
+ s_sg_platf_route_cbarg_t ASroute = SG_PLATF_ROUTE_INITIALIZER;
memset(&ASroute,0,sizeof(ASroute));
ASroute.src = A_surfxml_bypassASroute_src;
}
void ETag_surfxml_trace(void){
- s_sg_platf_trace_cbarg_t trace;
+ s_sg_platf_trace_cbarg_t trace = SG_PLATF_TRACE_INITIALIZER;
memset(&trace,0,sizeof(trace));
trace.id = A_surfxml_trace_id;
void STag_surfxml_trace___connect(void){
parse_after_config();
- s_sg_platf_trace_connect_cbarg_t trace_connect;
+ s_sg_platf_trace_connect_cbarg_t trace_connect = SG_PLATF_TRACE_CONNECT_INITIALIZER;
memset(&trace_connect,0,sizeof(trace_connect));
trace_connect.element = A_surfxml_trace___connect_element;
}
void ETag_surfxml_process(void){
- s_sg_platf_process_cbarg_t process;
+ s_sg_platf_process_cbarg_t process = SG_PLATF_PROCESS_INITIALIZER;
memset(&process,0,sizeof(process));
process.argc = argc;
}
void ETag_surfxml_gpu(void)
{
- s_sg_platf_gpu_cbarg_t gpu;
+ s_sg_platf_gpu_cbarg_t gpu = SG_PLATF_GPU_INITIALIZER;
memset(&gpu,0,sizeof(gpu));
gpu.name = A_surfxml_gpu_name;