if (TRACE_start_functions != NULL) {
void (*func) ();
- unsigned int iter = xbt_dynar_length(TRACE_start_functions);
+ unsigned int iter;
xbt_dynar_foreach(TRACE_start_functions, iter, func) {
func();
}
}
bool acyclic_graph_detail(xbt_dynar_t dag){
- unsigned int count=0, count_current=0;
+ unsigned int count, count_current=0;
bool all_marked = true;
SD_task_t task = NULL, parent_task = NULL, child_task = NULL;
SD_dependency_t depbefore = NULL, depafter = NULL;
xbt_dynar_push(current, &task);
}
}
- task = NULL;
- count = 0;
//test if something has to be done for the next iteration
while(!xbt_dynar_is_empty(current)){
next = xbt_dynar_new(sizeof(SD_task_t),NULL);
//test if the current iteration is done
- count_current=0;
xbt_dynar_foreach(current,count_current,task){
if (task == NULL) continue;
- count = 0;
//push task in next
task->marked = 1;
- count = 0;
xbt_dynar_foreach(task->tasks_before,count,depbefore){
parent_task = depbefore->src;
if(parent_task->kind == SD_TASK_COMM_E2E){
}
parent_task = NULL;
}
- task = NULL;
- count = 0;
}
xbt_dynar_free(¤t);
current = next;
next = NULL;
}
xbt_dynar_free(¤t);
- current = NULL;
all_marked = true;
xbt_dynar_foreach(dag,count,task){
if(task->kind == SD_TASK_COMM_E2E) continue;
break;
}
}
- task = NULL;
if(!all_marked){
XBT_VERB("there is at least one cycle in your task graph");
}
}
- count = 0;
- task = NULL;
xbt_dynar_foreach(dag,count,task){
if(task->kind == SD_TASK_COMM_E2E) continue;
if(xbt_dynar_is_empty(task->tasks_before)){
xbt_dynar_push(current, &task);
}
}
- task = NULL;
- count = 0;
//test if something has to be done for the next iteration
while(!xbt_dynar_is_empty(current)){
next = xbt_dynar_new(sizeof(SD_task_t),NULL);
//test if the current iteration is done
- count_current=0;
xbt_dynar_foreach(current,count_current,task){
if (task == NULL) continue;
- count = 0;
//push task in next
task->marked = 1;
- count = 0;
xbt_dynar_foreach(task->tasks_after,count,depafter){
child_task = depbefore->dst;
if(child_task->kind == SD_TASK_COMM_E2E){
}
child_task = NULL;
}
- task = NULL;
- count = 0;
}
xbt_dynar_free(¤t);
current = next;
next = NULL;
}
xbt_dynar_free(¤t);
- current = NULL;
all_marked = true;
xbt_dynar_foreach(dag,count,task){
if(task->kind == SD_TASK_COMM_E2E) continue;
xbt_dynar_free(&radical_elements2);
}
xbt_dynar_free(&radical_elements);
- iter=0;
xbt_dynar_sort(smpi_factor, &factor_cmp);
xbt_dynar_foreach(smpi_factor, iter, fact) {
XBT_DEBUG("smpi_factor:\t%ld : %d values, first: %f", fact.factor, fact.nb_values ,fact.values[0]);
xbt_dynar_free(&radical_elements2);
}
xbt_dynar_free(&radical_elements);
- iter=0;
xbt_dynar_sort(smpi_factor, &factor_cmp);
xbt_dynar_foreach(smpi_factor, iter, fact) {
XBT_DEBUG("ordered smpi_factor:\t%ld : %f", fact.factor, fact.value);
}
void xbt_automaton_display(xbt_automaton_t a){
- unsigned int cursor = 0;
+ unsigned int cursor;
xbt_automaton_state_t state = NULL;
- printf("\n\nEtat courant : %s\n", a->current_state->id);
+ printf("\n\nCurrent state: %s\n", a->current_state->id);
- printf("\nListe des états : %lu\n\n", xbt_dynar_length(a->states));
+ printf("\nStates' List: %lu\n\n", xbt_dynar_length(a->states));
- xbt_dynar_foreach(a->states, cursor, state){
- printf("ID : %s, type : %d\n", state->id, state->type);
- }
+ xbt_dynar_foreach(a->states, cursor, state)
+ printf("ID: %s, type: %d\n", state->id, state->type);
- cursor=0;
- xbt_automaton_transition_t transition = NULL;
- printf("\nListe des transitions : %lu\n\n", xbt_dynar_length(a->transitions));
+ xbt_automaton_transition_t transition;
+ printf("\nTransitions: %lu\n\n", xbt_dynar_length(a->transitions));
xbt_dynar_foreach(a->transitions, cursor, transition){
- printf("label :");
+ printf("label:");
xbt_automaton_exp_label_display(transition->label);
printf(", %s -> %s\n", transition->src->id, transition->dst->id);
}
}
xbt_dynar_foreach(g->nodes, cursor, node) {
- in_cursor = 0;
D(cursor, cursor) = 0;
xbt_dynar_foreach(node->out, in_cursor, edge) {
dot = control_string;
control_string += strcspn(control_string, ":= ");
eq = control_string;
- control_string += strcspn(control_string, " ");
if(*dot != '.' && (*eq == '=' || *eq == ':'))
xbt_die ("Invalid control string '%s'", orig_control_string);