e_surf_action_state_t surf_action_get_state(surf_action_t action)
{
surf_action_state_t action_state =
- &(action->model_type->common_public->states);
+ &(action->model_type->common_public.states);
if (action->state_set == action_state->ready_action_set)
return SURF_ACTION_READY;
void surf_action_free(surf_action_t * action)
{
- (*action)->model_type->common_public->action_cancel(*action);
+ (*action)->model_type->common_public.action_cancel(*action);
free(*action);
*action = NULL;
}
e_surf_action_state_t state)
{
surf_action_state_t action_state =
- &(action->model_type->common_public->states);
+ &(action->model_type->common_public.states);
XBT_IN2("(%p,%s)", action, surf_action_state_names[state]);
xbt_swag_remove(action, action->state_set);
void surf_init(int *argc, char **argv)
{
- int i, j;
- char *opt;
-
- const char *initial_path;
-
/* Connect our log channels: that must be done manually under windows */
XBT_LOG_CONNECT(surf_cpu, surf);
XBT_LOG_CONNECT(surf_kernel, surf);
#endif
xbt_init(argc, argv);
- if (!surf_path) {
-
- /* retrieves the current directory of the current process */
- initial_path = __surf_get_initial_path();
-
- xbt_assert0((initial_path),
- "__surf_get_initial_path() failed! Can't resolves current Windows directory");
-
- surf_path = xbt_dynar_new(sizeof(char *), NULL);
- xbt_dynar_push(surf_path, &initial_path);
-
- for (i = 1; i < *argc; i++) {
- if (!strncmp(argv[i], "--surf-path=", strlen("--surf-path="))) {
- opt = strchr(argv[i], '=');
- opt++;
- xbt_dynar_push(surf_path, &opt);
- /*remove this from argv */
- for (j = i + 1; j < *argc; j++) {
- argv[j - 1] = argv[j];
- }
- argv[j - 1] = NULL;
- (*argc)--;
- i--; /* compensate effect of next loop incrementation */
- }
- }
- }
if (!model_list)
model_list = xbt_dynar_new(sizeof(surf_model_private_t), NULL);
if (!history)
DEBUG0("Looking for next action end");
xbt_dynar_foreach(model_list, iter, model) {
- DEBUG1("Running for Resource [%s]", model->common_public->name);
+ DEBUG1("Running for Resource [%s]", model->common_public.name);
model_next_action_end = model->common_private->share_resources(NOW);
DEBUG2("Resource [%s] : next action end = %f",
- model->common_public->name, model_next_action_end);
+ model->common_public.name, model_next_action_end);
if (((min < 0.0) || (model_next_action_end < min))
&& (model_next_action_end >= 0.0))
min = model_next_action_end;