/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <cerrno>
-#include <cstring>
-
-#include <utility>
-#include <string>
-
-#include <xbt/config.hpp>
-#include <xbt/log.h>
-#include <xbt/range.hpp>
-#include <xbt/sysdep.h>
-
#include "simgrid/modelchecker.h"
-#include "simgrid/sg_config.hpp"
-#include "smx_private.hpp"
#include "src/internal_config.h"
-#include "xbt/log.h"
-#include "xbt/xbt_os_thread.h"
+#include "src/simix/smx_private.hpp"
+#include "xbt/config.hpp"
+
+#include <thread>
#ifdef _WIN32
#include <windows.h>
*/
void SIMIX_context_set_nthreads(int nb_threads) {
if (nb_threads<=0) {
- nb_threads = xbt_os_get_numcores();
- XBT_INFO("Auto-setting contexts/nthreads to %d",nb_threads);
+ nb_threads = std::thread::hardware_concurrency();
+ XBT_INFO("Auto-setting contexts/nthreads to %d", nb_threads);
}
#if !HAVE_THREAD_CONTEXTS
xbt_assert(nb_threads == 1, "Parallel runs are impossible when the pthreads are missing.");