void *gras_libdata_by_name(const char *name) {
gras_procdata_t *pd=gras_procdata_get();
+ return gras_libdata_by_name_from_procdata(name,pd);
+}
+
+/* this function is splitted from previous to allow SG to get libdata from remote hosts */
+void *gras_libdata_by_name_from_procdata(const char*name, gras_procdata_t* pd) {
void *res=NULL;
xbt_ex_t e;
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(gras_virtu_process);
+
+
void
gras_process_init() {
gras_hostdata_t *hd=(gras_hostdata_t *)MSG_host_get_data(MSG_host_self());
return pd;
}
+void *
+gras_libdata_by_name_from_remote(const char *name, m_process_t p) {
+ gras_procdata_t *pd=
+ (gras_procdata_t *)MSG_process_get_data(p);
+ 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);
+}
+
const char* xbt_procname(void) {
const char *res = NULL;
m_process_t process = MSG_process_self();
} gras_procdata_t;
gras_procdata_t *gras_procdata_get(void);
-
+void *gras_libdata_by_name_from_procdata(const char *name, gras_procdata_t* pd);
+
+
#endif /* GRAS_VIRTU_PRIVATE_H */
} gras_trp_sg_sock_data_t;
+void *gras_libdata_by_name_from_remote(const char *name, m_process_t p);
+/* The same function by id would be really dangerous.
+ *
+ * Indeed, it would rely on the fact that all process register libdatas in
+ * the same order, which is wrong if they init amok modules in different
+ * order.
+ */
+
+
#endif /* VIRTU_SG_H */