Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / src / simix / smx_user.c
index 3a7bd17..9344984 100644 (file)
@@ -85,6 +85,26 @@ xbt_dict_t simcall_host_get_properties(smx_host_t host)
   return simcall->host_get_properties.result;
 }
 
+/**
+ * \ingroup simix_host_management
+ * \brief Returns a dict of the properties assigned to a router or AS.
+ *
+ * \param asr name of the router or AS
+ * \return The properties
+ */
+xbt_dict_t simcall_asr_get_properties(const char *name)
+{
+  smx_simcall_t simcall = SIMIX_simcall_mine();
+
+  simcall->call = SIMCALL_ASR_GET_PROPERTIES;
+  simcall->asr_get_properties.name = name;
+  if(MC_IS_ENABLED) /* Initialize result to NULL for snapshot comparison done during simcall */
+    simcall->asr_get_properties.result = NULL;
+  SIMIX_simcall_push(simcall->issuer);
+  return simcall->asr_get_properties.result;
+}
+
+
 /**
  * \ingroup simix_host_management
  * \brief Returns the speed of the processor.
@@ -1001,6 +1021,30 @@ smx_action_t simcall_comm_irecv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff
   SIMIX_simcall_push(simcall->issuer);
   return simcall->comm_irecv.result;
 }
+
+
+/**
+ * \ingroup simix_comm_management
+ */
+smx_action_t simcall_comm_iprobe(smx_rdv_t rdv, int src, int tag,
+                                int (*match_fun)(void *, void *, smx_action_t), void *data)
+{
+  xbt_assert(rdv, "No rendez-vous point defined for iprobe");
+
+  smx_simcall_t simcall = SIMIX_simcall_mine();
+
+  simcall->call = SIMCALL_COMM_IPROBE;
+  simcall->comm_iprobe.rdv = rdv;
+  simcall->comm_iprobe.src = src;
+  simcall->comm_iprobe.match_fun = match_fun;
+  simcall->comm_iprobe.data = data;
+  if(MC_IS_ENABLED) /* Initialize result to NULL for snapshot comparison done during simcall */
+    simcall->comm_iprobe.result = NULL;
+  SIMIX_simcall_push(simcall->issuer);
+  return simcall->comm_iprobe.result;
+}
+
+
 void simcall_comm_destroy(smx_action_t comm)
 {
   xbt_assert(comm, "Invalid parameter");
@@ -1234,7 +1278,7 @@ smx_mutex_t simcall_mutex_init(void)
 {
   if(!simix_global) {
     fprintf(stderr,"You must run MSG_init or gras_init before using MSG or GRAS\n"); // I would have loved using xbt_die but I can't since it is not initialized yet... :)
-    abort();
+    xbt_abort();
   }
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
@@ -1598,6 +1642,24 @@ int simcall_file_unlink(smx_file_t fd)
   return simcall->file_unlink.result;
 }
 
+/**
+ * \ingroup simix_file_management
+ *
+ */
+xbt_dict_t simcall_file_ls(const char* mount, const char* path)
+{
+  smx_simcall_t simcall = SIMIX_simcall_mine();
+  simcall->call = SIMCALL_FILE_LS;
+  simcall->file_ls.mount = mount;
+  simcall->file_ls.path = path;
+  if(MC_IS_ENABLED) /* Initialize result to a default value for snapshot comparison done during simcall */
+    simcall->file_ls.result = NULL;
+
+  SIMIX_simcall_push(simcall->issuer);
+
+  return simcall->file_ls.result;
+}
+
 /* ************************************************************************** */
 
 /** @brief returns a printable string representing a simcall */