Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Distinguish access to sender-side and receiver-side user data in smx_action_t.
[simgrid.git] / src / simix / private.h
index c62284d..fda2af9 100644 (file)
@@ -15,7 +15,7 @@
 #include "xbt/config.h"
 #include "xbt/function_types.h"
 #include "xbt/ex_interface.h"
-#include "instr/private.h"
+#include "instr/instr_private.h"
 #include "process_private.h"
 #include "host_private.h"
 #include "network_private.h"
@@ -109,7 +109,8 @@ typedef struct s_smx_action {
       size_t *dst_buff_size;
       char copied;
 
-      void *data;                     /* User data associated to communication */
+      void* src_data;                     /* User data associated to communication */
+      void* dst_data;
     } comm;    
 
     struct {
@@ -124,7 +125,6 @@ typedef struct s_smx_action {
   };
 
 #ifdef HAVE_TRACING
-  long long int counter;              /* simix action unique identifier for instrumentation */
   char *category;                     /* simix action category for instrumentation */
 #endif
 } s_smx_action_t;
@@ -238,11 +238,11 @@ static XBT_INLINE void SIMIX_context_runall(xbt_swag_t processes)
  */
 static XBT_INLINE smx_context_t SIMIX_context_self(void)
 {
-  if (simix_global->context_factory == NULL) {
-    return NULL;
+  if (simix_global && simix_global->context_factory != NULL) {
+    return (*(simix_global->context_factory->self))();
   }
 
-  return (*(simix_global->context_factory->self))();
+  return NULL;
 }
 
 /**