Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Misc. cosmetic changes.
[simgrid.git] / src / xbt / xbt_virtu.cpp
1 /* virtualization layer for XBT */
2
3 /* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved.          */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #include "src/kernel/actor/ActorImpl.hpp"
9 #include "xbt/virtu.h"
10
11 int xbt_getpid()
12 {
13   const auto* self = simgrid::kernel::actor::ActorImpl::self();
14   return self == nullptr ? 0 : static_cast<int>(self->get_pid());
15 }
16
17 const char* xbt_procname(void)
18 {
19   return SIMIX_is_maestro() ? "maestro" : simgrid::kernel::actor::ActorImpl::self()->get_cname();
20 }