memcpy(request->buf, message->buf, request->datatype->size * request->count);
request->src = message->src;
request->completed = 1;
- SIMIX_broadcast(request->cond);
+ SIMIX_cond_broadcast(request->cond);
SIMIX_mutex_unlock(request->mutex);
smpi_request_new, smpi_request_free, smpi_request_reset);
smpi_global->message_mallocator = xbt_mallocator_new(SMPI_MESSAGE_MALLOCATOR_SIZE,
smpi_message_new, smpi_message_free, smpi_message_reset);
+
+ //
smpi_global->pending_send_request_queues = xbt_new(xbt_fifo_t, size);
smpi_global->pending_send_request_queues_mutexes = xbt_new(smx_mutex_t, size);
smpi_global->pending_recv_request_queues = xbt_new(xbt_fifo_t, size);
smpi_global->timers = xbt_new(xbt_os_timer_t, size);
smpi_global->timers_mutexes = xbt_new(smx_mutex_t, size);
-
for(i = 0; i < size; i++) {
smpi_global->pending_send_request_queues[i] = xbt_fifo_new();
smpi_global->pending_send_request_queues_mutexes[i] = SIMIX_mutex_init();
SIMIX_global_init(&argc, argv);
- // initialize smpi_global
- smpi_global_init();
-
SIMIX_function_register("smpi_simulated_main", smpi_simulated_main);
SIMIX_function_register("smpi_sender", smpi_sender);
SIMIX_function_register("smpi_receiver", smpi_receiver);
// FIXME: ought to verify these files...
SIMIX_create_environment(argv[1]);
+
+ // must initialize globals between creating environment and launching app....
+ smpi_global_init();
+
SIMIX_launch_application(argv[2]);
/* Prepare to display some more info when dying on Ctrl-C pressing */
if (!request->completed) {
SIMIX_cond_wait(request->cond, request->mutex);
}
- status->MPI_SOURCE = request->src;
+ if (NULL != status) {
+ status->MPI_SOURCE = request->src;
+ }
SIMIX_mutex_unlock(request->mutex);
}
}