Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case s4u::Mutex
[simgrid.git] / include / simgrid / msg.h
index 796e26b..c22f433 100644 (file)
@@ -7,6 +7,7 @@
 #define SIMGRID_MSG_H
 
 #include <simgrid/actor.h>
+#include <simgrid/engine.h>
 #include <simgrid/forward.h>
 #include <simgrid/host.h>
 #include <simgrid/instr.h>
 #include <simgrid/storage.h>
 #include <simgrid/vm.h>
 #include <simgrid/zone.h>
-#include <xbt/base.h>
-#include <xbt/dict.h>
-#include <xbt/dynar.h>
+#include <xbt.h>
+
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef MAX
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
 
 #ifdef __cplusplus
 #include <map>
@@ -122,6 +128,7 @@ typedef sg_actor_t msg_process_t;
 
 XBT_PUBLIC int MSG_process_get_PID(msg_process_t process);
 XBT_PUBLIC int MSG_process_get_PPID(msg_process_t process);
+XBT_PUBLIC sg_actor_t MSG_process_from_PID(int pid);
 XBT_PUBLIC const char* MSG_process_get_name(msg_process_t process);
 XBT_PUBLIC sg_host_t MSG_process_get_host(msg_process_t process);
 
@@ -133,15 +140,15 @@ XBT_PUBLIC void MSG_process_suspend(msg_process_t process);
 XBT_PUBLIC void MSG_process_resume(msg_process_t process);
 XBT_PUBLIC int MSG_process_is_suspended(msg_process_t process);
 XBT_PUBLIC void MSG_process_restart(msg_process_t process);
+XBT_PUBLIC void MSG_process_auto_restart_set(msg_process_t process, int auto_restart);
 XBT_PUBLIC void MSG_process_daemonize(msg_process_t process);
 XBT_PUBLIC void MSG_process_migrate(msg_process_t process, msg_host_t host);
 XBT_PUBLIC void MSG_process_join(msg_process_t process, double timeout);
 XBT_PUBLIC void MSG_process_kill(msg_process_t process);
+XBT_PUBLIC void MSG_process_killall();
 XBT_PUBLIC void MSG_process_set_kill_time(msg_process_t process, double kill_time);
+XBT_PUBLIC void MSG_process_yield();
 
-/* ******************************** File ************************************ */
-typedef sg_file_t msg_file_t;
-XBT_PUBLIC_DATA int sg_storage_max_file_descriptors;
 
 /**
  * \brief @brief Communication action.
@@ -235,11 +242,7 @@ XBT_PUBLIC msg_process_t MSG_process_create_with_environment(const char* name, x
 XBT_PUBLIC msg_process_t MSG_process_attach(const char* name, void* data, msg_host_t host, xbt_dict_t properties);
 XBT_PUBLIC void MSG_process_detach();
 
-XBT_PUBLIC int MSG_process_killall();
-XBT_PUBLIC void MSG_process_yield();
-
 XBT_PUBLIC void MSG_process_set_data_cleanup(void_f_pvoid_t data_cleanup);
-XBT_PUBLIC msg_process_t MSG_process_from_PID(int PID);
 XBT_PUBLIC int MSG_process_self_PID();
 XBT_PUBLIC int MSG_process_self_PPID();
 XBT_PUBLIC const char* MSG_process_self_name();
@@ -251,7 +254,6 @@ XBT_PUBLIC void* MSG_process_get_data(msg_process_t process);
 XBT_PUBLIC msg_error_t MSG_process_set_data(msg_process_t process, void* data);
 
 XBT_PUBLIC void MSG_process_on_exit(int_f_pvoid_pvoid_t fun, void* data);
-XBT_PUBLIC void MSG_process_auto_restart_set(msg_process_t process, int auto_restart);
 
 XBT_PUBLIC void MSG_process_ref(msg_process_t process);
 XBT_PUBLIC void MSG_process_unref(msg_process_t process);
@@ -337,11 +339,6 @@ XBT_PUBLIC const char* MSG_task_get_category(msg_task_t task);
  */
 XBT_PUBLIC void MSG_mailbox_set_async(const char* alias);
 
-/************************** Action handling **********************************/
-XBT_PUBLIC msg_error_t MSG_action_trace_run(char* path);
-XBT_PUBLIC void MSG_action_init();
-XBT_PUBLIC void MSG_action_exit();
-
 /** @brief Opaque type representing a semaphore
  *  @ingroup msg_synchro
  *  @hideinitializer
@@ -378,7 +375,7 @@ SG_END_DECL()
 #ifdef __cplusplus
 XBT_PUBLIC msg_process_t MSG_process_create_from_stdfunc(const char* name, std::function<void()> code, void* data,
                                                          msg_host_t host,
-                                                         std::map<std::string, std::string>* properties);
+                                                         std::unordered_map<std::string, std::string>* properties);
 #endif
 
 #endif