+/**
+ * \brief Returns the synchronization mode used when processes are run in
+ * parallel.
+ * \return how threads are synchronized if processes are run in parallel
+ */
+XBT_INLINE e_xbt_parmap_mode_t SIMIX_context_get_parallel_mode(void) {
+ e_xbt_parmap_mode_t mode = XBT_PARMAP_FUTEX;
+ const char* mode_name = xbt_cfg_get_string(_surf_cfg_set, "contexts/synchro");
+ if (!strcmp(mode_name, "posix")) {
+ mode = XBT_PARMAP_POSIX;
+ }
+ else if (!strcmp(mode_name, "futex")) {
+ mode = XBT_PARMAP_FUTEX;
+ }
+ else if (!strcmp(mode_name, "busy_wait")) {
+ mode = XBT_PARMAP_BUSY_WAIT;
+ }
+ else {
+ XBT_WARN("Command line setting of the parallel synchronization mode should "
+ "be one of \"posix\", \"futex\" or \"busy_wait\"");
+ }
+ return mode;
+}