#include "gras/Msg/msg_interface.h" /* For some checks at simulation end */
#include "gras/Transport/transport_interface.h" /* For some checks at simulation end */
#include "gras/Msg/msg_interface.h" /* For some checks at simulation end */
#include "gras/Transport/transport_interface.h" /* For some checks at simulation end */
gras_trp_procdata_t trp_pd;
gras_sg_portrec_t prmeas,pr;
int i;
gras_trp_procdata_t trp_pd;
gras_sg_portrec_t prmeas,pr;
int i;
if (!hd) {
/* First process on this host */
hd=xbt_new(gras_hostdata_t,1);
if (!hd) {
/* First process on this host */
hd=xbt_new(gras_hostdata_t,1);
hd->ports = xbt_dynar_new(sizeof(gras_sg_portrec_t),NULL);
memset(hd->proc, 0, sizeof(hd->proc[0]) * XBT_MAX_CHANNEL);
if (MSG_host_set_data(MSG_host_self(),(void*)hd) != MSG_OK)
THROW0(system_error,0,"Error in MSG_host_set_data()");
hd->ports = xbt_dynar_new(sizeof(gras_sg_portrec_t),NULL);
memset(hd->proc, 0, sizeof(hd->proc[0]) * XBT_MAX_CHANNEL);
if (MSG_host_set_data(MSG_host_self(),(void*)hd) != MSG_OK)
THROW0(system_error,0,"Error in MSG_host_set_data()");
- gras_msg_procdata_t msg_pd=(gras_msg_procdata_t)gras_libdata_get("gras_msg");
- gras_trp_procdata_t trp_pd=(gras_trp_procdata_t)gras_libdata_get("gras_trp");
+ gras_procdata_t *pd=(gras_procdata_t*)MSG_process_get_data(MSG_process_self());
+
+ gras_msg_procdata_t msg_pd=(gras_msg_procdata_t)gras_libdata_by_name("gras_msg");
+ gras_trp_procdata_t trp_pd=(gras_trp_procdata_t)gras_libdata_by_name("gras_trp");
+ xbt_assert2(pd,"process '%s' on '%s' didn't run gras_process_init! (ie, gras_init)",
+ MSG_process_get_name(p),MSG_host_get_name(MSG_process_get_host(p)));
+
+ return gras_libdata_by_name_from_procdata(name, pd);
+}
+