1 /* sg_dns - name resolution (simulator) */
3 /* Copyright (c) 2005, 2007, 2009, 2010. The SimGrid Team.
4 * All rights reserved. */
6 /* This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
10 #include "gras/Virtu/virtu_sg.h"
12 const char *gras_os_myname(void)
15 smx_process_t process = SIMIX_process_self();
17 /*HACK: maestro used not have a simix process, now it does so
18 SIMIX_process_self will return something different to NULL. This breaks
19 the old xbt_log logic that assumed that NULL was equivalent to maestro,
20 thus when printing it searches for maestro host name (which doesn't exists)
21 and breaks the logging.
22 As a hack we check for maestro by looking to the assigned host, if it is
23 NULL then we are sure is maestro
25 if (process != NULL && (host = SIMIX_host_self()) != NULL)
26 return SIMIX_host_get_name(host);