std::ostringstream id;
id << std::this_thread::get_id();
- XBT_INFO("sthread main() is starting in thread %s", id.str().c_str());
+ XBT_DEBUG("sthread main() is starting in thread %s", id.str().c_str());
sg4::Engine e(&argc, argv);
auto* zone = sg4::create_full_zone("world");
zone->seal();
/* Launch the user's main() on an actor */
- sthread_inside_simgrid = 0;
+ sthread_enable();
sg4::ActorPtr main_actor = sg4::Actor::create("tid 0", lilibeth, raw_main, argc, argv, envp);
- XBT_INFO("sthread main() is launching the simulation");
+ XBT_INFO("Starting the simulation.");
sg4::Engine::get_instance()->run();
+ XBT_INFO("All threads exited. Terminating the simulation.");
return 0;
}
+
struct sthread_mutex {
s4u_Mutex* mutex;
};
if (SMPI_is_inited())
SMPI_thread_create();
#endif
- sthread_inside_simgrid = 0;
+ sthread_enable();
user_function(param);
- sthread_inside_simgrid = 1;
+ sthread_disable();
}
int sthread_create(unsigned long int* thread, const /*pthread_attr_t*/ void* attr, void* (*start_routine)(void*),
void* arg)
{
- static int TID = 1;
-
+ static int TID = 0;
TID++;
+ XBT_VERB("Create thread %d", TID);
int rank = 0;
#if HAVE_SMPI
if (SMPI_is_inited())