p Testing a simple master/slave example application handling failures
$ masterslave/masterslave_failure$EXEEXT small_platform_with_failures.xml masterslave/deployment_masterslave.xml
-> [0.000000] simix/smx_process.c:84: [simix_process/WARNING] Cannot launch process 'slave' on failed host 'Fafard'
+> [0.000000] simix/smx_process.c:92: [simix_process/WARNING] Cannot launch process 'slave' on failed host 'Fafard'
> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 5 slave(s) :
> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Jupiter
> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Fafard
const char *gras_os_myname(void)
{
- smx_host_t host = SIMIX_host_self();
- if (host != NULL)
- return SIMIX_host_get_name(SIMIX_host_self());
- else
- return "";
+ smx_host_t host;
+ smx_process_t process = SIMIX_process_self();
+
+ /*HACK: maestro used not have a simix process, now it does so
+ SIMIX_process_self will return something different to NULL. This breaks
+ the old xbt_log logic that assumed that NULL was equivalent to maestro,
+ thus when printing it searches for maestro host name (which doesn't exists)
+ and breaks the logging.
+ As a hack we check for maestro by looking to the assigned host, if it is
+ NULL then we are sure is maestro
+ */
+ if (process != NULL && (host = SIMIX_host_self()) != NULL)
+ return SIMIX_host_get_name(host);
+
+ return "";
}
const char *xbt_procname(void)
{
- const char *res = NULL;
smx_process_t process = SIMIX_process_self();
- if (process != NULL)
- res = SIMIX_process_get_name(process);
- if (res)
- return res;
- else
- return "";
+ /*FIXME: maestro used not have a simix process, now it does so
+ SIMIX_process_self will return something different to NULL. This breaks
+ the old xbt_log logic that assumed that NULL was equivalent to maestro,
+ thus when printing it searches for maestro host name (which doesn't exists)
+ and breaks the logging.
+ As a hack we check for maestro by looking to the assigned host, if it is
+ NULL then we are sure is maestro
+ */
+ if (process != NULL && SIMIX_host_self())
+ return SIMIX_process_get_name(process);
+
+ return "";
}
int gras_os_getpid(void)
#include "xbt/swag.h"
#include "private.h"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smx_context, simix, "Context switching mecanism");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_context, simix, "Context switching mecanism");
/**
# include <valgrind/valgrind.h>
#endif /* HAVE_VALGRIND_VALGRIND_H */
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smx_context);
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
typedef struct s_smx_ctx_sysv {
SMX_CTX_BASE_T;
#include "xbt/swag.h"
#include "xbt/xbt_os_thread.h"
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smx_context);
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
typedef struct s_smx_ctx_thread {
SMX_CTX_BASE_T;
XBT_LOG_EXTERNAL_CATEGORY(simix_host);
XBT_LOG_EXTERNAL_CATEGORY(simix_process);
XBT_LOG_EXTERNAL_CATEGORY(simix_synchro);
+XBT_LOG_EXTERNAL_CATEGORY(simix_context);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_kernel, simix,
"Logging specific to SIMIX (kernel)");
XBT_LOG_CONNECT(simix_kernel, simix);
XBT_LOG_CONNECT(simix_process, simix);
XBT_LOG_CONNECT(simix_synchro, simix);
+ XBT_LOG_CONNECT(simix_context, simix);
simix_global = xbt_new0(s_SIMIX_Global_t, 1);
/**
* \brief Move a process to the list of process to destroy. *
*/
-
void SIMIX_process_cleanup(void *arg)
{
xbt_swag_remove(arg, simix_global->process_to_run);
/**
* \brief Creates and runs the maestro process
- *
*/
void __SIMIX_create_maestro_process()
{