/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "src/surf/surf_interface.hpp"
#include "src/simdag/simdag_private.h"
#include "instr/instr_interface.h"
#include "xbt/sysdep.h"
/* let's see which tasks are done */
xbt_dynar_foreach(all_existing_models, iter, model) {
while ((action = surf_model_extract_done_action_set(model))) {
- task = (SD_task_t)surf_action_get_data(action);
- task->start_time = surf_action_get_start_time(task->surf_action);
+ task = (SD_task_t) action->getData();
+ task->start_time = task->surf_action->getStartTime();
task->finish_time = surf_get_clock();
XBT_VERB("Task '%s' done", SD_task_get_name(task));
/* let's see which tasks have just failed */
while ((action = surf_model_extract_failed_action_set(model))) {
- task = (SD_task_t)surf_action_get_data(action);
+ task = (SD_task_t) action->getData();
task->start_time = surf_action_get_start_time(task->surf_action);
task->finish_time = surf_get_clock();
XBT_VERB("Task '%s' failed", SD_task_get_name(task));
__SD_task_set_state(task, SD_FAILED);
- surf_action_unref(action);
+ action->unref();
task->surf_action = NULL;
xbt_swag_insert(task,sd_global->return_set);
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "src/surf/surf_interface.hpp"
#include "src/simdag/simdag_private.h"
#include "simgrid/simdag.h"
#include "xbt/sysdep.h"
xbt_free(task->name);
if (task->surf_action != NULL)
- surf_action_unref(task->surf_action);
+ task->surf_action->unref();
xbt_free(task->workstation_list);
xbt_free(task->bytes_amount);
break;
case SD_RUNNING:
task->state_set = sd_global->running_task_set;
- task->start_time = surf_action_get_start_time(task->surf_action);
+ task->start_time = task->surf_action->getStartTime();
break;
case SD_DONE:
task->state_set = sd_global->done_task_set;
- task->finish_time = surf_action_get_finish_time(task->surf_action);
+ task->finish_time = task->surf_action->getFinishTime();
task->remains = 0;
#ifdef HAVE_JEDULE
jedule_log_sd_event(task);
}
if (__SD_task_is_running(task)) /* the task should become SD_FAILED */
- surf_action_cancel(task->surf_action);
+ task->surf_action->cancel();
else {
if (task->unsatisfied_dependencies == 0)
__SD_task_set_state(task, SD_SCHEDULABLE);
bytes_amount,
task->rate);
- surf_action_set_data(task->surf_action, task);
+ task->surf_action->setData(task);
XBT_DEBUG("surf_action = %p", task->surf_action);
candidates = xbt_new(SD_task_t, 8);
__SD_task_set_state(task, SD_DONE);
- surf_action_unref(task->surf_action);
+ task->surf_action->unref();
task->surf_action = NULL;
XBT_DEBUG("Looking for candidates");
double SD_task_get_start_time(SD_task_t task)
{
if (task->surf_action)
- return surf_action_get_start_time(task->surf_action);
+ return task->surf_action->getStartTime();
else
return task->start_time;
}
double SD_task_get_finish_time(SD_task_t task)
{
if (task->surf_action) /* should never happen as actions are destroyed right after their completion */
- return surf_action_get_finish_time(task->surf_action);
+ return task->surf_action->getFinishTime();
else
return task->finish_time;
}
# include <sys/ptrace.h>
#endif
+#include "src/surf/surf_interface.hpp"
#include "smx_private.h"
#include "smx_private.hpp"
#include "xbt/heap.h"
XBT_DEBUG("Handling process whose action failed");
while ((action = surf_model_extract_failed_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
- SIMIX_simcall_exit((smx_synchro_t) surf_action_get_data(action));
+ SIMIX_simcall_exit((smx_synchro_t) action->getData());
}
XBT_DEBUG("Handling process whose action terminated normally");
while ((action = surf_model_extract_done_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
- if (surf_action_get_data(action) == NULL)
+ if (action->getData() == NULL)
XBT_DEBUG("probably vcpu's action %p, skip", action);
else
- SIMIX_simcall_exit((smx_synchro_t) surf_action_get_data(action));
+ SIMIX_simcall_exit((smx_synchro_t) action->getData());
}
}
}
XBT_DEBUG("Handling process whose action failed");
while ((action = surf_model_extract_failed_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
- SIMIX_simcall_exit((smx_synchro_t) surf_action_get_data(action));
+ SIMIX_simcall_exit((smx_synchro_t) action->getData());
}
XBT_DEBUG("Handling process whose action terminated normally");
while ((action = surf_model_extract_done_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
- if (surf_action_get_data(action) == NULL)
+ if (action->getData() == NULL)
XBT_DEBUG("probably vcpu's action %p, skip", action);
else
- SIMIX_simcall_exit((smx_synchro_t) surf_action_get_data(action));
+ SIMIX_simcall_exit((smx_synchro_t) action->getData());
}
}
if (!MC_is_active() && !MC_record_replay_is_active()) {
synchro->execution.surf_exec = surf_host_execute(issuer->host, flops_amount);
- surf_action_set_data(synchro->execution.surf_exec, synchro);
- surf_action_set_priority(synchro->execution.surf_exec, priority);
+ synchro->execution.surf_exec->setData(synchro);
+ synchro->execution.surf_exec->setPriority(priority);
if (bound != 0)
- surf_cpu_action_set_bound(synchro->execution.surf_exec, bound);
+ static_cast<simgrid::surf::CpuAction*>(synchro->execution.surf_exec)
+ ->setBound(bound);
if (affinity_mask != 0) {
/* just a double check to confirm that this host is the host where this task is running. */
xbt_assert(synchro->execution.host == issuer->host);
- surf_cpu_action_set_affinity(synchro->execution.surf_exec, issuer->host, affinity_mask);
+ static_cast<simgrid::surf::CpuAction*>(synchro->execution.surf_exec)
+ ->setAffinity(issuer->host->p_cpu, affinity_mask);
}
}
surf_host_model_execute_parallel_task(surf_host_model,
host_nb, host_list_cpy, flops_amount, bytes_amount, rate);
- surf_action_set_data(synchro->execution.surf_exec, synchro);
+ synchro->execution.surf_exec->setData(synchro);
}
XBT_DEBUG("Create parallel execute synchro %p", synchro);
XBT_DEBUG("Destroy synchro %p", synchro);
if (synchro->execution.surf_exec) {
- surf_action_unref(synchro->execution.surf_exec);
+ synchro->execution.surf_exec->unref();
synchro->execution.surf_exec = NULL;
}
xbt_free(synchro->name);
XBT_DEBUG("Cancel synchro %p", synchro);
if (synchro->execution.surf_exec)
- surf_action_cancel(synchro->execution.surf_exec);
+ synchro->execution.surf_exec->cancel();
}
double SIMIX_process_execution_get_remains(smx_synchro_t synchro){
void SIMIX_process_execution_set_priority(smx_synchro_t synchro, double priority){
if(synchro->execution.surf_exec)
- surf_action_set_priority(synchro->execution.surf_exec, priority);
+ synchro->execution.surf_exec->setPriority(priority);
}
void SIMIX_process_execution_set_bound(smx_synchro_t synchro, double bound){
if(synchro->execution.surf_exec)
- surf_cpu_action_set_bound(synchro->execution.surf_exec, bound);
+ static_cast<simgrid::surf::CpuAction*>(synchro->execution.surf_exec)
+ ->setBound(bound);
}
void SIMIX_process_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask){
if (synchro->execution.surf_exec) {
/* just a double check to confirm that this host is the host where this task is running. */
xbt_assert(synchro->execution.host == host);
- surf_cpu_action_set_affinity(synchro->execution.surf_exec, host, mask);
+ static_cast<simgrid::surf::CpuAction*>(synchro->execution.surf_exec)
+ ->setAffinity(host->p_cpu, mask);
}
}
void SIMIX_host_execution_suspend(smx_synchro_t synchro)
{
if(synchro->execution.surf_exec)
- surf_action_suspend(synchro->execution.surf_exec);
+ synchro->execution.surf_exec->suspend();
}
void SIMIX_host_execution_resume(smx_synchro_t synchro)
{
if(synchro->execution.surf_exec)
- surf_action_resume(synchro->execution.surf_exec);
+ synchro->execution.surf_exec->resume();
}
void SIMIX_execution_finish(smx_synchro_t synchro)
/* If the host running the synchro failed, notice it so that the asking
* process can be killed if it runs on that host itself */
synchro->state = SIMIX_FAILED;
- } else if (surf_action_get_state(synchro->execution.surf_exec) == SURF_ACTION_FAILED) {
+ } else if (synchro->execution.surf_exec->getState() == SURF_ACTION_FAILED) {
/* If the host running the synchro didn't fail, then the synchro was
* canceled */
synchro->state = SIMIX_CANCELED;
}
if (synchro->execution.surf_exec) {
- surf_action_unref(synchro->execution.surf_exec);
+ synchro->execution.surf_exec->unref();
synchro->execution.surf_exec = NULL;
}
{
if (synchro->state != SIMIX_RUNNING) return;
if (synchro->type == SIMIX_SYNC_EXECUTE){
- surf_action_set_category(synchro->execution.surf_exec, category);
+ synchro->execution.surf_exec->setCategory(category);
}else if (synchro->type == SIMIX_SYNC_COMMUNICATE){
- surf_action_set_category(synchro->comm.surf_comm, category);
+ synchro->comm.surf_comm->setCategory(category);
}
}
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "src/surf/surf_interface.hpp"
#include "smx_private.h"
#include "xbt/sysdep.h"
#include "xbt/log.h"
synchro->io.host = host;
synchro->io.surf_io = surf_host_read(host, fd->surf_file, size);
- surf_action_set_data(synchro->io.surf_io, synchro);
+ synchro->io.surf_io->setData(synchro);
XBT_DEBUG("Create io synchro %p", synchro);
return synchro;
synchro->io.host = host;
synchro->io.surf_io = surf_host_write(host, fd->surf_file, size);
- surf_action_set_data(synchro->io.surf_io, synchro);
+ synchro->io.surf_io->setData(synchro);
XBT_DEBUG("Create io synchro %p", synchro);
return synchro;
synchro->io.host = host;
synchro->io.surf_io = surf_host_open(host, fullpath);
- surf_action_set_data(synchro->io.surf_io, synchro);
+ synchro->io.surf_io->setData(synchro);
XBT_DEBUG("Create io synchro %p", synchro);
return synchro;
synchro->io.host = host;
synchro->io.surf_io = surf_host_close(host, fd->surf_file);
- surf_action_set_data(synchro->io.surf_io, synchro);
+ synchro->io.surf_io->setData(synchro);
XBT_DEBUG("Create io synchro %p", synchro);
return synchro;
simcall_file_close__set__result(simcall, 0);
break;
case SIMCALL_FILE_WRITE:
- simcall_file_write__set__result(simcall, surf_action_get_cost(synchro->io.surf_io));
+ simcall_file_write__set__result(simcall,
+ synchro->io.surf_io->getCost());
break;
case SIMCALL_FILE_READ:
- simcall_file_read__set__result(simcall, surf_action_get_cost(synchro->io.surf_io));
+ simcall_file_read__set__result(simcall,
+ synchro->io.surf_io->getCost());
break;
default:
}
}
- switch (surf_action_get_state(synchro->io.surf_io)) {
+ switch (synchro->io.surf_io->getState()) {
case SURF_ACTION_FAILED:
synchro->state = SIMIX_FAILED;
{
XBT_DEBUG("Destroy synchro %p", synchro);
if (synchro->io.surf_io)
- surf_action_unref(synchro->io.surf_io);
+ synchro->io.surf_io->unref();
xbt_mallocator_release(simix_global->synchro_mallocator, synchro);
}
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "src/surf/surf_interface.hpp"
#include "smx_private.h"
#include "xbt/log.h"
#include "mc/mc.h"
#ifdef HAVE_LATENCY_BOUND_TRACKING
synchro->latency_limited = SIMIX_comm_is_latency_bounded(synchro);
#endif
- surf_action_unref(synchro->comm.surf_comm);
+ synchro->comm.surf_comm->unref();
synchro->comm.surf_comm = NULL;
}
if (synchro->comm.src_timeout){
- surf_action_unref(synchro->comm.src_timeout);
+ synchro->comm.src_timeout->unref();
synchro->comm.src_timeout = NULL;
}
if (synchro->comm.dst_timeout){
- surf_action_unref(synchro->comm.dst_timeout);
+ synchro->comm.dst_timeout->unref();
synchro->comm.dst_timeout = NULL;
}
}
SIMIX_comm_finish(synchro);
} else { /* if (timeout >= 0) { we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host fails */
sleep = surf_host_sleep(simcall->issuer->host, timeout);
- surf_action_set_data(sleep, synchro);
+ sleep->setData(synchro);
if (simcall->issuer == synchro->comm.src_proc)
synchro->comm.src_timeout = sleep;
sender, receiver,
synchro->comm.task_size, synchro->comm.rate);
- surf_action_set_data(synchro->comm.surf_comm, synchro);
+ synchro->comm.surf_comm->setData(synchro);
synchro->state = SIMIX_RUNNING;
/* If a link is failed, detect it immediately */
- if (surf_action_get_state(synchro->comm.surf_comm) == SURF_ACTION_FAILED) {
+ if (synchro->comm.surf_comm->getState() == SURF_ACTION_FAILED) {
XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure",
SIMIX_host_get_name(sender), SIMIX_host_get_name(receiver));
synchro->state = SIMIX_LINK_FAILURE;
XBT_DEBUG("The communication is suspended on startup because dst (%s:%s) were suspended since it initiated the communication",
SIMIX_host_get_name(synchro->comm.dst_proc->host), synchro->comm.dst_proc->name);
- surf_action_suspend(synchro->comm.surf_comm);
+ synchro->comm.surf_comm->suspend();
}
}
{
/* Update synchro state */
if (synchro->comm.src_timeout &&
- surf_action_get_state(synchro->comm.src_timeout) == SURF_ACTION_DONE)
+ synchro->comm.src_timeout->getState() == SURF_ACTION_DONE)
synchro->state = SIMIX_SRC_TIMEOUT;
else if (synchro->comm.dst_timeout &&
- surf_action_get_state(synchro->comm.dst_timeout) == SURF_ACTION_DONE)
+ synchro->comm.dst_timeout->getState() == SURF_ACTION_DONE)
synchro->state = SIMIX_DST_TIMEOUT;
else if (synchro->comm.src_timeout &&
- surf_action_get_state(synchro->comm.src_timeout) == SURF_ACTION_FAILED)
+ synchro->comm.src_timeout->getState() == SURF_ACTION_FAILED)
synchro->state = SIMIX_SRC_HOST_FAILURE;
else if (synchro->comm.dst_timeout &&
- surf_action_get_state(synchro->comm.dst_timeout) == SURF_ACTION_FAILED)
+ synchro->comm.dst_timeout->getState() == SURF_ACTION_FAILED)
synchro->state = SIMIX_DST_HOST_FAILURE;
else if (synchro->comm.surf_comm &&
- surf_action_get_state(synchro->comm.surf_comm) == SURF_ACTION_FAILED) {
+ synchro->comm.surf_comm->getState() == SURF_ACTION_FAILED) {
XBT_DEBUG("Puta madre. Surf says that the link broke");
synchro->state = SIMIX_LINK_FAILURE;
} else
&& !MC_record_replay_is_active()
&& (synchro->state == SIMIX_READY || synchro->state == SIMIX_RUNNING)) {
- surf_action_cancel(synchro->comm.surf_comm);
+ synchro->comm.surf_comm->cancel();
}
}
{
/*FIXME: shall we suspend also the timeout synchro? */
if (synchro->comm.surf_comm)
- surf_action_suspend(synchro->comm.surf_comm);
+ synchro->comm.surf_comm->suspend();
/* in the other case, the action will be suspended on creation, in SIMIX_comm_start() */
}
{
/*FIXME: check what happen with the timeouts */
if (synchro->comm.surf_comm)
- surf_action_resume(synchro->comm.surf_comm);
+ synchro->comm.surf_comm->resume();
/* in the other case, the synchro were not really suspended yet, see SIMIX_comm_suspend() and SIMIX_comm_start() */
}
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "src/surf/surf_interface.hpp"
#include "smx_private.h"
#include "xbt/sysdep.h"
#include "xbt/log.h"
static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_synchro_t sync){
if (sync->sleep.surf_sleep) {
- surf_action_cancel(sync->sleep.surf_sleep);
+ sync->sleep.surf_sleep->cancel();
smx_simcall_t simcall;
while ((simcall = (smx_simcall_t) xbt_fifo_shift(sync->simcalls))) {
SIMIX_simcall_answer(simcall);
}
}
- surf_action_unref(sync->sleep.surf_sleep);
+ sync->sleep.surf_sleep->unref();
sync->sleep.surf_sleep = NULL;
}
xbt_mallocator_release(simix_global->synchro_mallocator, sync);
synchro->sleep.host = host;
synchro->sleep.surf_sleep = surf_host_sleep(host, duration);
- surf_action_set_data(synchro->sleep.surf_sleep, synchro);
+ synchro->sleep.surf_sleep->setData(synchro);
XBT_DEBUG("Create sleep synchronization %p", synchro);
return synchro;
while ((simcall = (smx_simcall_t) xbt_fifo_shift(synchro->simcalls))) {
- switch(surf_action_get_state(synchro->sleep.surf_sleep)){
+ switch (synchro->sleep.surf_sleep->getState()){
case SURF_ACTION_FAILED:
simcall->issuer->context->iwannadie = 1;
//SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
xbt_assert(synchro->type == SIMIX_SYNC_SLEEP || synchro->type == SIMIX_SYNC_JOIN);
if (synchro->sleep.surf_sleep) {
- surf_action_unref(synchro->sleep.surf_sleep);
+ synchro->sleep.surf_sleep->unref();
synchro->sleep.surf_sleep = NULL;
}
if (synchro->type == SIMIX_SYNC_SLEEP)
void SIMIX_process_sleep_suspend(smx_synchro_t synchro)
{
xbt_assert(synchro->type == SIMIX_SYNC_SLEEP);
- surf_action_suspend(synchro->sleep.surf_sleep);
+ synchro->sleep.surf_sleep->suspend();
}
void SIMIX_process_sleep_resume(smx_synchro_t synchro)
{
XBT_DEBUG("Synchro state is %d on process_sleep_resume.", synchro->state);
xbt_assert(synchro->type == SIMIX_SYNC_SLEEP);
- surf_action_resume(synchro->sleep.surf_sleep);
+ synchro->sleep.surf_sleep->resume();
}
/**
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "src/surf/surf_interface.hpp"
#include "smx_private.h"
#include "xbt/log.h"
sync->name = xbt_strdup("synchro");
sync->synchro.sleep = surf_host_sleep(smx_host, timeout);
- surf_action_set_data(sync->synchro.sleep, sync);
+ sync->synchro.sleep->setData(sync);
XBT_OUT();
return sync;
}
XBT_IN("(%p)",synchro);
XBT_DEBUG("Destroying synchro %p", synchro);
xbt_assert(synchro->type == SIMIX_SYNC_SYNCHRO);
- surf_action_unref(synchro->synchro.sleep);
+ synchro->synchro.sleep->unref();
xbt_free(synchro->name);
xbt_mallocator_release(simix_global->synchro_mallocator, synchro);
XBT_OUT();
{
XBT_IN("(%p)",synchro);
xbt_assert(synchro->type == SIMIX_SYNC_SYNCHRO);
- if (surf_action_get_state(synchro->synchro.sleep) == SURF_ACTION_FAILED)
+ if (synchro->synchro.sleep->getState() == SURF_ACTION_FAILED)
synchro->state = SIMIX_FAILED;
- else if(surf_action_get_state(synchro->synchro.sleep) == SURF_ACTION_DONE)
+ else if(synchro->synchro.sleep->getState() == SURF_ACTION_DONE)
synchro->state = SIMIX_SRC_TIMEOUT;
SIMIX_synchro_finish(synchro);
void SIMIX_vm_start(sg_host_t ind_vm)
{
if (__can_be_started(ind_vm))
- static_cast<simgrid::surf::VirtualMachine*>(surf_host_resource_priv(ind_vm))
- ->setState(SURF_VM_STATE_RUNNING);
+ static_cast<simgrid::surf::VirtualMachine*>(
+ ind_vm->extension<simgrid::surf::Host>()
+ )->setState(SURF_VM_STATE_RUNNING);
else
THROWF(vm_error, 0, "The VM %s cannot be started", SIMIX_host_get_name(ind_vm));
}
e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t ind_vm)
{
- return static_cast<simgrid::surf::VirtualMachine*>(surf_host_resource_priv(ind_vm))->getState();
+ return static_cast<simgrid::surf::VirtualMachine*>(
+ ind_vm->extension<simgrid::surf::Host>()
+ )->getState();
}
/**
}
/* FIXME: we may have to do something at the surf layer, e.g., vcpu action */
- static_cast<simgrid::surf::VirtualMachine*>(surf_host_resource_priv(ind_vm))->setState(SURF_VM_STATE_CREATED);
+ static_cast<simgrid::surf::VirtualMachine*>(
+ ind_vm->extension<simgrid::surf::Host>()
+ )->setState(SURF_VM_STATE_CREATED);
}
void simcall_HANDLER_vm_shutdown(smx_simcall_t simcall, sg_host_t ind_vm)
e_surf_action_state_t old,
e_surf_action_state_t cur) {
const char *name = getActionCpu(action)->getName();
- simgrid::surf::Host *host = surf_host_resource_priv(sg_host_by_name(name));
+ simgrid::surf::Host *host = sg_host_by_name(name)->extension<simgrid::surf::Host>();
simgrid::surf::VirtualMachine *vm = dynamic_cast<simgrid::surf::VirtualMachine*>(host);
if (vm) // If it's a VM, take the corresponding PM
- host = surf_host_resource_priv(vm->getPm());
+ host = vm->getPm()->extension<simgrid::surf::Host>();
HostEnergy *host_energy = (*simgrid::energy::surf_energy)[host];
*********/
static simgrid::surf::Host *get_casted_host(sg_host_t host){
- return static_cast<simgrid::surf::Host*>(surf_host_resource_priv(host));
+ return host->extension<simgrid::surf::Host>();
}
static simgrid::surf::VirtualMachine *get_casted_vm(sg_host_t host){
- return static_cast<simgrid::surf::VirtualMachine*>(surf_host_resource_priv(host));
+ return static_cast<simgrid::surf::VirtualMachine*>(host->extension<simgrid::surf::Host>());
}
extern double NOW;
}
surf_host_t surf_host_resource_priv(sg_host_t host) {
- return host->extension(simgrid::surf::Host::EXTENSION_ID);
+ return host->extension<simgrid::surf::Host>();
}
*/
void VMHL13::migrate(sg_host_t host_dest)
{
- Host *surfHost_dst = surf_host_resource_priv(host_dest);
+ Host *surfHost_dst = host_dest->extension<Host>();
const char *vm_name = getName();
const char *pm_name_src = p_hostPM->getName().c_str();
const char *pm_name_dst = surfHost_dst->getName();
#include "simgrid/sg_config.h"
#include "surf/surf.h"
#include "surf/surfxml_parse.h" // for reset callback
+#include "src/surf/surf_interface.hpp"
#include "xbt/log.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test,
actionC = surf_host_sleep(hostB, 7.32);
/* Use whatever calling style you want... */
- stateActionA = surf_action_get_state(actionA); /* When you know actionA model type */
- stateActionB = surf_action_get_state(actionB); /* If you're unsure about it's model type */
- stateActionC = surf_action_get_state(actionC); /* When you know actionA model type */
+ stateActionA = actionA->getState(); /* When you know actionA model type */
+ stateActionB = actionB->getState(); /* If you're unsure about it's model type */
+ stateActionC = actionC->getState(); /* When you know actionA model type */
/* And just look at the state of these tasks */
XBT_DEBUG("actionA : %p (%s)", actionA, string_action(stateActionA));
while ((action =
surf_model_extract_failed_action_set((surf_model_t)surf_cpu_model_pm))) {
XBT_DEBUG("\t * Failed : %p", action);
- surf_action_unref(action);
+ action->unref();
}
while ((action =
surf_model_extract_done_action_set((surf_model_t)surf_cpu_model_pm))) {
XBT_DEBUG("\t * Done : %p", action);
- surf_action_unref(action);
+ action->unref();
}
XBT_DEBUG("\t Network actions");
while ((action =
surf_model_extract_failed_action_set((surf_model_t)surf_network_model))) {
XBT_DEBUG("\t * Failed : %p", action);
- surf_action_unref(action);
+ action->unref();
}
while ((action =
surf_model_extract_done_action_set((surf_model_t)surf_network_model))) {
XBT_DEBUG("\t * Done : %p", action);
- surf_action_unref(action);
+ action->unref();
}
} while ((surf_model_running_action_set_size((surf_model_t)surf_network_model) ||
#include "simgrid/sg_config.h"
#include "surf/surf.h"
#include "surf/surfxml_parse.h" // for reset callback
+#include "src/surf/surf_interface.hpp"
#include "xbt/log.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test,
XBT_DEBUG("\t Actions");
while ((action = surf_model_extract_failed_action_set((surf_model_t)model))) {
XBT_DEBUG("\t * Failed : %p", action);
- surf_action_unref(action);
+ action->unref();
}
while ((action = surf_model_extract_done_action_set((surf_model_t)model))) {
XBT_DEBUG("\t * Done : %p", action);
- surf_action_unref(action);
+ action->unref();
}
if (surf_model_running_action_set_size((surf_model_t)model)) {
XBT_DEBUG("running that model");