#define SIMGRID_HOST_H_
#include <xbt/dict.h>
-
SG_BEGIN_DECL()
typedef xbt_dictelm_t sg_host_t;
-
+XBT_PUBLIC(sg_host_t) sg_host_by_name(const char *name);
+static XBT_INLINE char *sg_host_get_name(sg_host_t host){
+ return host->key;
+}
+
+#ifdef __cplusplus
+#define DEFINE_EXTERNAL_CLASS(klass) class klass;
+class Cpu;
+#else
+#define DEFINE_EXTERNAL_CLASS(klass) typedef struct klass klass;
+#endif
// ========== MSG Layer ==============
typedef struct s_msg_host_priv *msg_host_priv_t;
XBT_PUBLIC(void) sg_host_simix_set(sg_host_t host, smx_host_priv_t priv);
XBT_PUBLIC(void) sg_host_simix_destroy(sg_host_t host);
-// Module initializer. Won't survive the conversion to C++
+// ========== SURF CPU ============
+DEFINE_EXTERNAL_CLASS(Cpu);
+typedef Cpu *surf_cpu_t;
+typedef Cpu *CpuPtr;
+XBT_PUBLIC(surf_cpu_t) sg_host_surfcpu(sg_host_t host);
+XBT_PUBLIC(void) sg_host_surfcpu_set(sg_host_t host, surf_cpu_t cpu);
+XBT_PUBLIC(void) sg_host_surfcpu_destroy(sg_host_t host);
+
+
+// Module initializer. Won't survive the conversion to C++. Hopefully.
XBT_PUBLIC(void) sg_host_init(void);
SG_END_DECL()
double process_kill_time);
/*********************************** Host *************************************/
-//XBT_PUBLIC(xbt_dict_t) SIMIX_host_get_dict(u_smx_scalar_t *args);
-XBT_PUBLIC(sg_host_t) SIMIX_host_get_by_name(const char *name);
XBT_PUBLIC(sg_host_t) SIMIX_host_self(void);
XBT_PUBLIC(const char*) SIMIX_host_self_get_name(void);
#define SIMIX_host_get_name(h) sg_host_name(h) /* DEPRECATED: SIMIX_host_get_name */
XBT_PUBLIC_DATA(xbt_lib_t) host_lib;
XBT_PUBLIC_DATA(int) ROUTING_HOST_LEVEL; //Routing level
-XBT_PUBLIC_DATA(int) SURF_CPU_LEVEL; //Surf cpu level
XBT_PUBLIC_DATA(int) SURF_HOST_LEVEL; //Surf workstation level
XBT_PUBLIC_DATA(int) SIMIX_STORAGE_LEVEL; //Simix storage level
XBT_PUBLIC_DATA(int) SD_HOST_LEVEL; //Simdag host level
}
void setCpu(char *name, Cpu *cpu) {
- xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, cpu);
+ sg_host_surfcpu_set(sg_host_by_name(name), cpu);
}
NetworkLinkDynar getRoute(char *srcName, char *dstName) {
RoutingEdge *src = (RoutingEdge*)xbt_lib_get_or_null(host_lib, srcName, ROUTING_HOST_LEVEL);
RoutingEdge *dst = (RoutingEdge*)xbt_lib_get_or_null(host_lib, dstName, ROUTING_HOST_LEVEL);
- if (src==NULL)
- xbt_die("TOTO");
- if (dst==NULL)
- xbt_die("TOTO");
+ xbt_assert(src,"Cannot get the route from a NULL source");
+ xbt_assert(dst,"Cannot get the route to a NULL destination");
xbt_dynar_t route = xbt_dynar_new(sizeof(RoutingEdgePtr), NULL);
routing_platf->getRouteAndLatency(src, dst, &route, NULL);
return route;
class Host;
class HostCLM03;
class NetworkCm02Link;
-class Cpu;
class Action;
class ActionLmm;
class StorageActionLmm;
typedef struct HostCLM03 HostCLM03;
typedef struct Host Host;
typedef struct NetworkCm02Link NetworkCm02Link;
-typedef struct Cpu Cpu;
typedef struct Action Action;
typedef struct ActionLmm ActionLmm;
typedef struct StorageActionLmm StorageActionLmm;
typedef Host *surf_host_t;
typedef HostCLM03 *surf_host_CLM03_t;
typedef NetworkCm02Link *surf_network_link_t;
-typedef Cpu *surf_cpu_t;
/** @ingroup SURF_c_bindings
* \brief Action structure
XBT_PUBLIC_DATA(routing_platf_t) routing_platf;
-static inline surf_cpu_t surf_cpu_resource_priv(const void *host) {
- return (surf_cpu_t)xbt_lib_get_level((xbt_dictelm_t)host, SURF_CPU_LEVEL);
-}
static inline surf_host_t surf_host_resource_priv(const void *host){
return (surf_host_t) xbt_lib_get_level((xbt_dictelm_t)host, SURF_HOST_LEVEL);
}
return (void*)xbt_lib_get_level((xbt_dictelm_t)storage, SURF_STORAGE_LEVEL);
}
-static inline void *surf_cpu_resource_by_name(const char *name) {
- return xbt_lib_get_elm_or_null(host_lib, name);
-}
-static inline void *surf_host_resource_by_name(const char *name){
- return xbt_lib_get_elm_or_null(host_lib, name);
-}
static inline void *surf_storage_resource_by_name(const char *name){
return xbt_lib_get_elm_or_null(storage_lib, name);
}
#include "simgrid/host.h"
#include "surf/surf_routing.h" // SIMIX_HOST_LEVEL and friends FIXME: make private here
+sg_host_t sg_host_by_name(const char *name){
+ return xbt_lib_get_elm_or_null(host_lib, name);
+}
+
+// ========= Layering madness ==============
+
int SIMIX_HOST_LEVEL;
int MSG_HOST_LEVEL;
+int SURF_CPU_LEVEL;
#include "simix/smx_host_private.h" // SIMIX_host_destroy. FIXME: killme
#include "msg/msg_private.h" // MSG_host_priv_free. FIXME: killme
+#include "surf/cpu_interface.hpp"
+
+static XBT_INLINE void surf_cpu_free(void *r) {
+ delete static_cast<CpuPtr>(r);
+}
+
+
void sg_host_init() {
SIMIX_HOST_LEVEL = xbt_lib_add_level(host_lib,SIMIX_host_destroy);
MSG_HOST_LEVEL = xbt_lib_add_level(host_lib, (void_f_pvoid_t) __MSG_host_priv_free);
+ SURF_CPU_LEVEL = xbt_lib_add_level(host_lib,surf_cpu_free);
}
return (smx_host_priv_t) xbt_lib_get_level(host, SIMIX_HOST_LEVEL);
}
void sg_host_simix_set(sg_host_t host, smx_host_priv_t smx_host) {
- xbt_lib_set(host_lib,host->key,SIMIX_HOST_LEVEL,smx_host);
+ xbt_lib_set(host_lib,host->key,SIMIX_HOST_LEVEL,smx_host);
}
void sg_host_simix_destroy(sg_host_t host) {
- xbt_lib_unset(host_lib,host->key,SIMIX_HOST_LEVEL,1);
+ xbt_lib_unset(host_lib,host->key,SIMIX_HOST_LEVEL,1);
+}
+
+// ========== SURF CPU ============
+surf_cpu_t sg_host_surfcpu(sg_host_t host) {
+ return (surf_cpu_t) xbt_lib_get_level(host, SURF_CPU_LEVEL);
}
+void sg_host_surfcpu_set(sg_host_t host, surf_cpu_t cpu) {
+ xbt_lib_set(host_lib, host->key, SURF_CPU_LEVEL, cpu);
+}
+void sg_host_surfcpu_destroy(sg_host_t host) {
+ xbt_lib_unset(host_lib,host->key,SURF_CPU_LEVEL,1);
+}
+
/*
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_host_get_by_name(name);
+ if (0) sg_host_by_name(name);
/* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
self->simcall.call = SIMCALL_HOST_GET_BY_NAME;
return;
switch (simcall->call) {
case SIMCALL_HOST_GET_BY_NAME:
- simcall->result.dp = SIMIX_host_get_by_name( simcall->args[0].cc);
+ simcall->result.dp = sg_host_by_name( simcall->args[0].cc);
SIMIX_simcall_answer(simcall);
break;
static void parse_process(sg_platf_process_cbarg_t process)
{
- sg_host_t host = SIMIX_host_get_by_name(process->host);
+ sg_host_t host = sg_host_by_name(process->host);
if (!host)
THROWF(arg_error, 0, "Host '%s' unknown", process->host);
parse_code = SIMIX_get_registered_function(process->function);
{
s_sg_platf_process_cbarg_t process = SG_PLATF_PROCESS_INITIALIZER;
- sg_host_t host = SIMIX_host_get_by_name(process_host);
+ sg_host_t host = sg_host_by_name(process_host);
if (!host)
THROWF(arg_error, 0, "Host '%s' unknown", process_host);
process.host = sg_host_name(host);
simix_timers = xbt_heap_new(8, &free);
}
- sg_host_init();
SIMIX_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, SIMIX_storage_destroy);
if (sg_cfg_get_boolean("clean_atexit"))
char *hostname = NULL;
xbt_dynar_foreach(host_that_restart,iter,hostname) {
XBT_INFO("Restart processes on host: %s",hostname);
- SIMIX_host_autorestart(SIMIX_host_get_by_name(hostname));
+ SIMIX_host_autorestart(sg_host_by_name(hostname));
}
xbt_dynar_reset(host_that_restart);
}
return;
}
-sg_host_t SIMIX_host_get_by_name(const char *name){
- return xbt_lib_get_elm_or_null(host_lib, name);
-}
-
sg_host_t SIMIX_host_self(void)
{
smx_process_t process = SIMIX_process_self();
smx_process_t parent_process)
{
*process = NULL;
- sg_host_t host = SIMIX_host_get_by_name(hostname);
+ sg_host_t host = sg_host_by_name(hostname);
XBT_DEBUG("Start process %s on host '%s'", name, hostname);
/* We will be able to register the VM to its physical host, so that we can promptly
* retrieve the list VMs on the physical host. */
- return SIMIX_host_get_by_name(name);
+ return sg_host_by_name(name);
}
xbt_dict_t cpu_properties)
{
CpuPtr cpu = NULL;
- xbt_assert(!surf_cpu_resource_priv(surf_cpu_resource_by_name(name)),
+ sg_host_t host = sg_host_by_name(name);
+ xbt_assert(!sg_host_surfcpu(host),
"Host '%s' declared several times in the platform file",
name);
xbt_assert(xbt_dynar_getfirst_as(power_peak, double) > 0.0,
xbt_assert(core > 0, "Invalid number of cores %d. Must be larger than 0", core);
cpu = new CpuCas01(this, name, power_peak, pstate, power_scale, power_trace, core, state_initial, state_trace, cpu_properties);
- xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, cpu);
+ sg_host_surfcpu_set(host, cpu);
return cpu;
}
/* connect all traces relative to hosts */
xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
- CpuCas01Ptr host = static_cast<CpuCas01Ptr>(surf_cpu_resource_priv(surf_cpu_resource_by_name(elm)));
+ CpuCas01Ptr host = static_cast<CpuCas01Ptr>(sg_host_surfcpu(sg_host_by_name(elm)));
xbt_assert(host, "Host %s undefined", elm);
xbt_assert(trace, "Trace %s undefined", trace_name);
xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
- CpuCas01Ptr host = static_cast<CpuCas01Ptr>(surf_cpu_resource_priv(surf_cpu_resource_by_name(elm)));
+ CpuCas01Ptr host = static_cast<CpuCas01Ptr>(sg_host_surfcpu(sg_host_by_name(elm)));
xbt_assert(host, "Host %s undefined", elm);
xbt_assert(trace, "Trace %s undefined", trace_name);
typedef CpuModel *CpuModelPtr;
class Cpu;
-typedef Cpu *CpuPtr;
class CpuAction;
typedef CpuAction *CpuActionPtr;
xbt_dict_t cpuProperties)
{
xbt_assert(core==1,"Multi-core not handled with this model yet");
- xbt_assert(!surf_cpu_resource_priv(surf_cpu_resource_by_name(name)),
+ sg_host_t host = sg_host_by_name(name);
+ xbt_assert(!sg_host_surfcpu(host),
"Host '%s' declared several times in the platform file",
name);
xbt_assert(xbt_dynar_getfirst_as(powerPeak, double) > 0.0,
"Power has to be >0.0. Did you forget to specify the mandatory power attribute?");
CpuTiPtr cpu = new CpuTi(this, name, powerPeak, pstate, powerScale, powerTrace,
core, stateInitial, stateTrace, cpuProperties);
- xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, static_cast<ResourcePtr>(cpu));
+ sg_host_surfcpu_set(host, cpu);
return cpu;
}
/* connect all traces relative to hosts */
xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
- CpuTiPtr cpu = static_cast<CpuTiPtr>(surf_cpu_resource_priv(surf_cpu_resource_by_name(elm)));
+ CpuTiPtr cpu = static_cast<CpuTiPtr>(sg_host_surfcpu(sg_host_by_name(elm)));
xbt_assert(cpu, "Host %s undefined", elm);
xbt_assert(trace, "Trace %s undefined", trace_name);
xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
- CpuTiPtr cpu = static_cast<CpuTiPtr>(surf_cpu_resource_priv(surf_cpu_resource_by_name(elm)));
+ CpuTiPtr cpu = static_cast<CpuTiPtr>(sg_host_surfcpu(sg_host_by_name(elm)));
xbt_assert(cpu, "Host %s undefined", elm);
xbt_assert(trace, "Trace %s undefined", trace_name);
{}
HostPtr HostCLM03Model::createHost(const char *name){
+ sg_host_t sg_host = sg_host_by_name(name);
HostPtr host = new HostCLM03(surf_host_model, name, NULL,
(xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL),
(RoutingEdgePtr)xbt_lib_get_or_null(host_lib, name, ROUTING_HOST_LEVEL),
- static_cast<CpuPtr>(xbt_lib_get_or_null(host_lib, name, SURF_CPU_LEVEL)));
+ sg_host_surfcpu(sg_host));
XBT_DEBUG("Create host %s with %ld mounted disks", name, xbt_dynar_length(host->p_storage));
xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, host);
return host;
HostPtr HostL07Model::createHost(const char *name)
{
HostL07Ptr wk = NULL;
- xbt_assert(!surf_host_resource_priv(surf_host_resource_by_name(name)),
+ sg_host_t sg_host = sg_host_by_name(name);
+
+ xbt_assert(!surf_host_resource_priv(sg_host),
"Host '%s' declared several times in the platform file.",
name);
wk = new HostL07(this, name, NULL,
static_cast<RoutingEdgePtr>(xbt_lib_get_or_null(host_lib, name, ROUTING_HOST_LEVEL)),
- static_cast<CpuPtr>(xbt_lib_get_or_null(host_lib, name, SURF_CPU_LEVEL)));
+ sg_host_surfcpu(sg_host));
xbt_lib_set(host_lib, name, SURF_HOST_LEVEL, wk);
{
double power_initial = xbt_dynar_get_as(powerPeak, pstate, double);
xbt_dynar_free(&powerPeak); // kill memory leak
+ sg_host_t sg_host = sg_host_by_name(name);
- xbt_assert(!surf_host_resource_priv(surf_host_resource_by_name(name)),
+ xbt_assert(!surf_host_resource_priv(sg_host),
"Host '%s' declared several times in the platform file.",
name);
power_initial, power_scale, power_trace,
core, state_initial, state_trace);
- xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, cpu);
+ sg_host_surfcpu_set(sg_host, cpu);
return cpu;
}
/* Connect traces relative to cpu */
xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
- CpuL07Ptr host = static_cast<CpuL07Ptr>(surf_cpu_resource_priv(surf_cpu_resource_by_name(elm)));
+ CpuL07Ptr host = static_cast<CpuL07Ptr>(sg_host_surfcpu(sg_host_by_name(elm)));
xbt_assert(host, "Host %s undefined", elm);
xbt_assert(trace, "Trace %s undefined", trace_name);
xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
- CpuL07Ptr host = static_cast<CpuL07Ptr>(surf_cpu_resource_priv(surf_cpu_resource_by_name(elm)));
+ CpuL07Ptr host = static_cast<CpuL07Ptr>(sg_host_surfcpu(sg_host_by_name(elm)));
xbt_assert(host, "Host %s undefined", elm);
xbt_assert(trace, "Trace %s undefined", trace_name);
* TOOLS *
*********/
-static CpuPtr get_casted_cpu(surf_resource_t resource){
- return static_cast<CpuPtr>(surf_cpu_resource_priv(resource));
-}
-
static HostPtr get_casted_host(surf_resource_t resource){
return static_cast<HostPtr>(surf_host_resource_priv(resource));
}
void surf_vm_destroy(surf_resource_t resource){
/* Before clearing the entries in host_lib, we have to pick up resources. */
- CpuPtr cpu = get_casted_cpu(resource);
VMPtr vm = get_casted_vm(resource);
RoutingEdgePtr routing = get_casted_routing(resource);
char* name = xbt_dict_get_elm_key(resource);
* Do not call xbt_lib_remove() here. It deletes all levels of the key,
* including MSG_HOST_LEVEL and others. We should unregister only what we know.
*/
- xbt_lib_unset(host_lib, name, SURF_CPU_LEVEL, 0);
+ sg_host_surfcpu_destroy((sg_host_t)resource);
xbt_lib_unset(host_lib, name, ROUTING_HOST_LEVEL, 0);
xbt_lib_unset(host_lib, name, SURF_HOST_LEVEL, 0);
/* TODO: comment out when VM storage is implemented. */
// xbt_lib_unset(host_lib, name, SURF_STORAGE_LEVEL, 0);
- delete cpu;
delete vm;
delete routing;
}
}
void surf_vm_set_affinity(surf_resource_t vm, surf_resource_t cpu, unsigned long mask){
- return get_casted_vm(vm)->setAffinity(get_casted_cpu(cpu), mask);
+ return get_casted_vm(vm)->setAffinity(sg_host_surfcpu(cpu), mask);
}
int surf_network_link_is_shared(surf_cpp_resource_t link){
}
surf_action_t surf_cpu_execute(surf_resource_t cpu, double size){
- return get_casted_cpu(cpu)->execute(size);
+ return sg_host_surfcpu(cpu)->execute(size);
}
surf_action_t surf_cpu_sleep(surf_resource_t cpu, double duration){
- return get_casted_cpu(cpu)->sleep(duration);
+ return sg_host_surfcpu(cpu)->sleep(duration);
}
double surf_action_get_start_time(surf_action_t action){
}
void surf_cpu_action_set_affinity(surf_action_t action, surf_resource_t cpu, unsigned long mask) {
- static_cast<CpuActionPtr>(action)->setAffinity(get_casted_cpu(cpu), mask);
+ static_cast<CpuActionPtr>(action)->setAffinity(sg_host_surfcpu(cpu), mask);
}
void surf_cpu_action_set_bound(surf_action_t action, double bound) {
xbt_dict_free(&elm);
}
-static XBT_INLINE void surf_cpu_free(void *r)
-{
- delete static_cast<CpuPtr>(r);
-}
-
static XBT_INLINE void surf_link_free(void *r)
{
delete static_cast<NetworkLinkPtr>(r);
file_lib = xbt_lib_new();
watched_hosts_lib = xbt_dict_new_homogeneous(NULL);
+ sg_host_init();
+
XBT_DEBUG("Add routing levels");
ROUTING_HOST_LEVEL = xbt_lib_add_level(host_lib,routing_asr_host_free);
ROUTING_ASR_LEVEL = xbt_lib_add_level(as_router_lib,routing_asr_host_free);
ROUTING_PROP_ASR_LEVEL = xbt_lib_add_level(as_router_lib,routing_asr_prop_free);
XBT_DEBUG("Add SURF levels");
- SURF_CPU_LEVEL = xbt_lib_add_level(host_lib,surf_cpu_free);
SURF_HOST_LEVEL = xbt_lib_add_level(host_lib,surf_host_free);
SURF_LINK_LEVEL = xbt_lib_add_level(link_lib,surf_link_free);
SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,surf_storage_free);
}
extern double sg_sender_gap;
-XBT_PUBLIC_DATA(int) SURF_CPU_LEVEL; //Surf cpu level
extern surf_callback(void, void) surfExitCallbacks;
xbt_lib_t host_lib;
int ROUTING_HOST_LEVEL; //Routing level
-int SURF_CPU_LEVEL; //Surf cpu level
int SURF_HOST_LEVEL; //Surf host level
int SIMIX_STORAGE_LEVEL; //Simix storage level
int MSG_STORAGE_LEVEL; //Msg storage level
// //// CPU RELATED STUFF ////
// Roughly, create a vcpu resource by using the values of the sub_cpu one.
- CpuCas01Ptr sub_cpu = static_cast<CpuCas01Ptr>(surf_cpu_resource_priv(host_PM));
-
- /* We can assume one core and cas01 cpu for the first step.
- * Do xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, cpu) if you get the resource. */
+ CpuCas01Ptr sub_cpu = static_cast<CpuCas01Ptr>(sg_host_surfcpu(host_PM));
p_cpu = surf_cpu_model_vm->createCpu(name, // name
sub_cpu->getPowerPeakList(), // host->power_peak,
/* create a cpu action bound to the pm model at the destination. */
CpuActionPtr new_cpu_action = static_cast<CpuActionPtr>(
- static_cast<CpuPtr>(surf_cpu_resource_priv(ind_dst_pm))->execute(0));
+ static_cast<CpuPtr>(sg_host_surfcpu(ind_dst_pm))->execute(0));
e_surf_action_state_t state = p_action->getState();
if (state != SURF_ACTION_DONE)
/*********************** CPU ***********************************/
XBT_DEBUG("%p", surf_cpu_model_pm);
- cpuA = surf_cpu_resource_by_name("Cpu A");
- cpuB = surf_cpu_resource_by_name("Cpu B");
+ cpuA = sg_host_by_name("Cpu A");
+ cpuB = sg_host_by_name("Cpu B");
/* Let's check that those two processors exist */
- XBT_DEBUG("%s : %p", surf_cpu_name(surf_cpu_resource_priv(cpuA)), cpuA);
- XBT_DEBUG("%s : %p", surf_cpu_name(surf_cpu_resource_priv(cpuB)), cpuB);
+ XBT_DEBUG("%s : %p", surf_cpu_name(sg_host_surfcpu(cpuA)), cpuA);
+ XBT_DEBUG("%s : %p", surf_cpu_name(sg_host_surfcpu(cpuB)), cpuB);
/* Let's do something on it */
actionA = surf_cpu_execute(cpuA, 1000.0);
void test(char *platform);
void test(char *platform)
{
- void *hostA = NULL;
- void *hostB = NULL;
+ sg_host_t hostA = NULL;
+ sg_host_t hostB = NULL;
double now = -1.0;
int running;
parse_platform_file(platform);
/*********************** HOST ***********************************/
- hostA = surf_host_resource_by_name("Cpu A");
- hostB = surf_host_resource_by_name("Cpu B");
+ hostA = sg_host_by_name("Cpu A");
+ hostB = sg_host_by_name("Cpu B");
/* Let's check that those two processors exist */
- XBT_DEBUG("%s : %p", surf_resource_name(hostA), hostA);
- XBT_DEBUG("%s : %p", surf_resource_name(hostB), hostB);
+ XBT_DEBUG("%s : %p", sg_host_get_name(hostA), hostA);
+ XBT_DEBUG("%s : %p", sg_host_get_name(hostB), hostB);
/* Let's do something on it */
surf_host_execute(hostA, 1000.0);