#include "private.h"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi, XBT_LOG_ROOT_CAT, "All SMPI categories");
+XBT_LOG_NEW_CATEGORY(smpi, "All SMPI categories");
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_kernel, smpi, "Logging specific to SMPI (kernel)");
smpi_global_t smpi_global = NULL;
int size = SIMIX_host_get_number();
- smpi_global = xbt_new(s_smpi_global_t, 1);
+ /* Connect our log channels: that must be done manually under windows */
+ /* (should be done only once, not for each process) */
+ #ifdef XBT_LOG_CONNECT
+ XBT_LOG_CONNECT(smpi_base, smpi);
+ XBT_LOG_CONNECT(smpi_bench, smpi);
+ XBT_LOG_CONNECT(smpi_kernel, smpi);
+ XBT_LOG_CONNECT(smpi_mpi, smpi);
+ XBT_LOG_CONNECT(smpi_receiver, smpi);
+ XBT_LOG_CONNECT(smpi_sender, smpi);
+ XBT_LOG_CONNECT(smpi_util, smpi);
+ #endif
+ smpi_global = xbt_new(s_smpi_global_t, 1);
// config variable
smpi_global->reference_speed = SMPI_DEFAULT_SPEED;
smpi_global->timer_mutex = SIMIX_mutex_init();
smpi_global->timer_cond = SIMIX_cond_init();
- smpi_global->execute_mutex = SIMIX_mutex_init();
- smpi_global->execute_cond = SIMIX_cond_init();
- smpi_global->execute_count = 0;
-
smpi_global->do_once_duration_nodes = NULL;
smpi_global->do_once_duration = NULL;
smpi_global->do_once_mutex = SIMIX_mutex_init();
xbt_os_timer_free(smpi_global->timer);
SIMIX_mutex_destroy(smpi_global->timer_mutex);
SIMIX_cond_destroy(smpi_global->timer_cond);
- SIMIX_mutex_destroy(smpi_global->execute_mutex);
- SIMIX_cond_destroy(smpi_global->execute_cond);
for(curr = smpi_global->do_once_duration_nodes; NULL != curr; curr = next) {
next = curr->next;
{
smx_host_t host = SIMIX_host_self();
smpi_host_data_t hdata = (smpi_host_data_t)SIMIX_host_get_data(host);
-
return hdata->index;
}
+smx_mutex_t smpi_host_mutex()
+{
+ smx_host_t host = SIMIX_host_self();
+ smpi_host_data_t hdata = (smpi_host_data_t)SIMIX_host_get_data(host);
+ return hdata->mutex;
+}
+
+smx_cond_t smpi_host_cond()
+{
+ smx_host_t host = SIMIX_host_self();
+ smpi_host_data_t hdata = (smpi_host_data_t)SIMIX_host_get_data(host);
+ return hdata->cond;
+}
+
int smpi_run_simulation(int *argc, char **argv)
{
smx_cond_t cond = NULL;