207,7 → 207,7 |
|
if ((terror=fsf_initialize_contract(&contract))) |
{ |
printf(" Initialize fail for server A\n"); |
fsf_printf(" Initialize fail for server A\n"); |
ERROR(terror,"fsf_initialize_contract failed"); |
} |
|
216,7 → 216,7 |
&period_max, |
workload))) |
{ |
printf("Set_Basic_Parameters failed for server A\n"); |
fsf_printf("Set_Basic_Parameters failed for server A\n"); |
ERROR(terror,"set_contract_basic_parameters failed"); |
} |
|
228,7 → 228,7 |
deadline_miss_sig_notify, |
deadline_miss_sig_value))) |
{ |
printf("Set_Timing_Requirements failed for server A\n"); |
fsf_printf("Set_Timing_Requirements failed for server A\n"); |
ERROR(terror,"fsf_set_contract_timing_requirements failed"); |
} |
|
240,7 → 240,7 |
quality, |
importance))) |
{ |
printf("Set_Reclamation_Parameters failed for server A\n"); |
fsf_printf("Set_Reclamation_Parameters failed for server A\n"); |
ERROR(terror,"fsf_set_contract_reclamation_parameters failed"); |
} |
|
248,7 → 248,7 |
if ((terror=fsf_set_contract_synchronization_parameters (&contract, |
critical_sections))) |
{ |
printf("Set_Synchronization_Parameters failed for server A\n"); |
fsf_printf("Set_Synchronization_Parameters failed for server A\n"); |
ERROR(terror,"fsf_set_contract_synchronization_parameters failed"); |
} |
|
257,7 → 257,7 |
end = put_time(NULL, " end first server contract negotiation"); |
if (terror) |
{ |
printf("Negotiate_Contract failed for server 0\n"); |
fsf_printf("Negotiate_Contract failed for server 0\n"); |
ERROR(terror,"fsf_negotiate_contract_for_myself failed"); |
} |
|
269,7 → 269,7 |
end = put_time(NULL, " end first server contract renegotiation"); |
if (terror) |
{ |
printf("ReNegotiate_Contract failed for server 0\n"); |
fsf_printf("ReNegotiate_Contract failed for server 0\n"); |
ERROR(terror,"fsf_renegotiate_contract failed"); |
} |
|
281,7 → 281,7 |
end = put_time(NULL, " end first server change quality and importance"); |
if (terror) |
{ |
printf("Change quality and importancet failed for server 0\n"); |
fsf_printf("Change quality and importancet failed for server 0\n"); |
ERROR(terror,"fsf_renegotiate_contract failed"); |
} |
|
301,7 → 301,7 |
terror = fsf_get_budget_and_period (server[0], &budget, &period); |
if (terror) |
{ |
printf("fsf_get_budget_and_period failed for server 0\n"); |
fsf_printf("fsf_get_budget_and_period failed for server 0\n"); |
ERROR(terror,"fsf_get_budget_and_period failed"); |
} |
// put_time(&budget,"the budget gotten is: "); |
329,7 → 329,7 |
if ((terror=fsf_set_contract_synchronization_parameters (&contract, |
critical_sections))) |
{ |
printf("Set_Synchronization_Parameters failed for server %d\n", n_servers); |
fsf_printf("Set_Synchronization_Parameters failed for server %d\n", n_servers); |
ERROR(terror,"fsf_set_contract_synchronization_parameters failed"); |
} |
|
339,12 → 339,12 |
end = put_time(NULL, " end server contract negotiation"); |
if (terror) |
{ |
printf("Negotiate_Contract failed for server %d\n", n_servers); |
fsf_printf("Negotiate_Contract failed for server %d\n", n_servers); |
ERROR(terror,"fsf_negotiate_contract failed"); |
} |
|
if (!server[n_servers]) { |
printf("The negotiation for the server number %d was not succesful!! (n_servers=%d)\n",n_servers+1, n_servers); |
fsf_printf("The negotiation for the server number %d was not succesful!! (n_servers=%d)\n",n_servers+1, n_servers); |
break; |
} |
|
370,7 → 370,7 |
end = put_time(NULL, " end first server change quality and importance"); |
if (terror) |
{ |
printf("Change quality and importancet failed for server %d\n", n_servers); |
fsf_printf("Change quality and importancet failed for server %d\n", n_servers); |
ERROR(terror,"fsf_request_change_quality_and_importance failed"); |
} |
|
390,11 → 390,11 |
terror = fsf_get_budget_and_period (server[0], &budget, &period); |
if (terror) |
{ |
printf("fsf_get_budget_and_period failed for server 0\n"); |
fsf_printf("fsf_get_budget_and_period failed for server 0\n"); |
ERROR(terror,"fsf_get_budget_and_period failed"); |
} |
if (period.tv_sec==0 && period.tv_nsec==0) { |
printf("while processing server %d, the period gotten for server %d is cero!!\n", n_servers, 0); |
fsf_printf("while processing server %d, the period gotten for server %d is cero!!\n", n_servers, 0); |
exit(-1); |
} |
u = t2d(budget) / t2d(period); |
406,11 → 406,11 |
terror = fsf_get_budget_and_period (server[i], &budget, &period); |
if (terror) |
{ |
printf("fsf_get_budget_and_period failed for server %d\n", n_servers); |
fsf_printf("fsf_get_budget_and_period failed for server %d\n", n_servers); |
ERROR(terror,"fsf_get_budget_and_period failed"); |
} |
if (period.tv_sec==0 && period.tv_nsec==0) { |
printf("while processing server %d, the period gotten for server %d is cero!!\n", n_servers, i); |
fsf_printf("while processing server %d, the period gotten for server %d is cero!!\n", n_servers, i); |
exit(-1); |
} |
u = t2d(budget) / t2d(period); |
430,7 → 430,7 |
end = put_time(NULL, " end server contract cancellation"); |
if (terror) |
{ |
printf("Cancel_Contract failed for server %d\n", i); |
fsf_printf("Cancel_Contract failed for server %d\n", i); |
ERROR(terror,"fsf_cancel_contract failed"); |
} |
|
438,45 → 438,45 |
server_res[i].cancellation = end; |
} |
|
printf("\n"); |
printf("The number of accepted servers was: %d \n", n_servers); |
printf("==================================\n\n"); |
fsf_printf("\n"); |
fsf_printf("The number of accepted servers was: %d \n", n_servers); |
fsf_printf("==================================\n\n"); |
|
printf("server negotiation renegotiation qualityChange cancellation max_utilizati min_utilizati total_utilization\n\n"); |
fsf_printf("server negotiation renegotiation qualityChange cancellation max_utilizati min_utilizati total_utilization\n\n"); |
|
for (i=0;i<n_servers;i++){ |
printf(" %2d ", i+1); |
printf(" %13.9f ", t2d(server_res[i].negotiation)); |
printf(" %13.9f ", t2d(server_res[i].renegotiation)); |
printf(" %13.9f ", t2d(server_res[i].change_q_and_i)); |
printf(" %13.9f ", t2d(server_res[i].cancellation)); |
printf(" %13.9f ", server_res[i].max_u); |
printf(" %13.9f ", server_res[i].min_u); |
printf(" %13.9f ", server_res[i].tot_u); |
printf("\n"); |
fsf_printf(" %2d ", i+1); |
fsf_printf(" %13.9f ", t2d(server_res[i].negotiation)); |
fsf_printf(" %13.9f ", t2d(server_res[i].renegotiation)); |
fsf_printf(" %13.9f ", t2d(server_res[i].change_q_and_i)); |
fsf_printf(" %13.9f ", t2d(server_res[i].cancellation)); |
fsf_printf(" %13.9f ", server_res[i].max_u); |
fsf_printf(" %13.9f ", server_res[i].min_u); |
fsf_printf(" %13.9f ", server_res[i].tot_u); |
fsf_printf("\n"); |
} |
|
STANDARD_CONSOLE_INIT; //marte1.26i+ |
|
printf("\n"); |
printf("The number of accepted servers was: %d \n", n_servers); |
printf("==================================\n\n"); |
fsf_printf("\n"); |
fsf_printf("The number of accepted servers was: %d \n", n_servers); |
fsf_printf("==================================\n\n"); |
|
printf("server negotiation renegotiation qualityChange cancellation max_utilizati min_utilizati total_utilization\n\n"); |
fsf_printf("server negotiation renegotiation qualityChange cancellation max_utilizati min_utilizati total_utilization\n\n"); |
|
for (i=0;i<n_servers;i++){ |
printf(" %2d ", i+1); |
printf(" %13.9f ", t2d(server_res[i].negotiation)); |
printf(" %13.9f ", t2d(server_res[i].renegotiation)); |
printf(" %13.9f ", t2d(server_res[i].change_q_and_i)); |
printf(" %13.9f ", t2d(server_res[i].cancellation)); |
printf(" %13.9f ", server_res[i].max_u); |
printf(" %13.9f ", server_res[i].min_u); |
printf(" %13.9f ", server_res[i].tot_u); |
printf("\n"); |
fsf_printf(" %2d ", i+1); |
fsf_printf(" %13.9f ", t2d(server_res[i].negotiation)); |
fsf_printf(" %13.9f ", t2d(server_res[i].renegotiation)); |
fsf_printf(" %13.9f ", t2d(server_res[i].change_q_and_i)); |
fsf_printf(" %13.9f ", t2d(server_res[i].cancellation)); |
fsf_printf(" %13.9f ", server_res[i].max_u); |
fsf_printf(" %13.9f ", server_res[i].min_u); |
fsf_printf(" %13.9f ", server_res[i].tot_u); |
fsf_printf("\n"); |
} |
|
printf("\nThe end.\n"); |
fsf_printf("\nThe end.\n"); |
|
//.... |
exit(-1); |