Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow to retrieve the libdata of a remote host in SG
[simgrid.git] / src / gras / Virtu / sg_process.c
index 2ad07e2..ea01367 100644 (file)
 #include "gras/Msg/msg_interface.h" /* For some checks at simulation end */
 #include "gras/Transport/transport_interface.h" /* For some checks at simulation end */
 
-XBT_LOG_EXTERNAL_CATEGORY(process);
-XBT_LOG_DEFAULT_CATEGORY(process);
+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());
-  gras_procdata_t *pd=xbt_new(gras_procdata_t,1);
+  gras_procdata_t *pd=xbt_new0(gras_procdata_t,1);
   gras_trp_procdata_t trp_pd;
   gras_sg_portrec_t prmeas,pr;
   int i;
@@ -132,7 +133,17 @@ gras_procdata_t *gras_procdata_get(void) {
 
   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();