- // node 0 sets the globals
- if (0 == i) {
-
-
- // signal all nodes to perform initialization
- SIMIX_mutex_lock(smpi_global->start_stop_mutex);
- smpi_global->root_ready = 1;
- SIMIX_cond_broadcast(smpi_global->start_stop_cond);
- SIMIX_mutex_unlock(smpi_global->start_stop_mutex);
-
- } else {
-
- // make sure root is done before own initialization
- SIMIX_mutex_lock(smpi_global->start_stop_mutex);
- while (!smpi_global->root_ready) {
- SIMIX_cond_wait(smpi_global->start_stop_cond,
- smpi_global->start_stop_mutex);
- }
- SIMIX_mutex_unlock(smpi_global->start_stop_mutex);
-
- }
-
- // wait for all nodes to signal initializatin complete
- SIMIX_mutex_lock(smpi_global->start_stop_mutex);
- smpi_global->ready_process_count++;
- if (smpi_global->ready_process_count >= 3 * smpi_global->host_count) {
- SIMIX_cond_broadcast(smpi_global->start_stop_cond);
- }
- while (smpi_global->ready_process_count < 3 * smpi_global->host_count) {
- SIMIX_cond_wait(smpi_global->start_stop_cond,
- smpi_global->start_stop_mutex);
- }
- SIMIX_mutex_unlock(smpi_global->start_stop_mutex);
-