git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6344
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
xbt_mallocator_t message_mallocator;
// FIXME: request queues should be moved to host data...
xbt_mallocator_t message_mallocator;
// FIXME: request queues should be moved to host data...
- xbt_fifo_t *pending_send_request_queues;
xbt_fifo_t *received_message_queues;
smx_process_t *main_processes;
xbt_fifo_t *received_message_queues;
smx_process_t *main_processes;
int finalize; /* for main stopping sender&receiver */
xbt_fifo_t pending_recv_request_queue;
int finalize; /* for main stopping sender&receiver */
xbt_fifo_t pending_recv_request_queue;
+ xbt_fifo_t pending_send_request_queue;
} s_smpi_host_data_t;
typedef struct smpi_host_data_t *smpi_host_data_t;
} s_smpi_host_data_t;
typedef struct smpi_host_data_t *smpi_host_data_t;
hdata->finalize = 0;
hdata->pending_recv_request_queue = xbt_fifo_new();
hdata->finalize = 0;
hdata->pending_recv_request_queue = xbt_fifo_new();
+ hdata->pending_send_request_queue = xbt_fifo_new();
hdata->main = SIMIX_process_self();
hdata->sender = SIMIX_process_create("smpi_sender",
hdata->main = SIMIX_process_self();
hdata->sender = SIMIX_process_create("smpi_sender",
SIMIX_mutex_destroy(hdata->mutex);
SIMIX_cond_destroy(hdata->cond);
xbt_fifo_free(hdata->pending_recv_request_queue);
SIMIX_mutex_destroy(hdata->mutex);
SIMIX_cond_destroy(hdata->cond);
xbt_fifo_free(hdata->pending_recv_request_queue);
+ xbt_fifo_free(hdata->pending_send_request_queue);
}
int smpi_mpi_barrier(smpi_mpi_communicator_t comm)
}
int smpi_mpi_barrier(smpi_mpi_communicator_t comm)
if (NULL == request) {
retval = MPI_ERR_INTERN;
} else {
if (NULL == request) {
retval = MPI_ERR_INTERN;
} else {
- xbt_fifo_push(smpi_global->pending_send_request_queues[hdata->index], request);
-
- if (SIMIX_process_is_suspended(hdata->sender)) {
- SIMIX_process_resume(hdata->sender);
- }
+ xbt_fifo_push(hdata->pending_send_request_queue, request);
+ SIMIX_process_resume(hdata->sender);
smpi_message_free, smpi_message_reset);
// queues
smpi_message_free, smpi_message_reset);
// queues
- smpi_global->pending_send_request_queues = xbt_new(xbt_fifo_t, size);
smpi_global->received_message_queues = xbt_new(xbt_fifo_t, size);
// sender/receiver processes
smpi_global->received_message_queues = xbt_new(xbt_fifo_t, size);
// sender/receiver processes
smpi_global->do_once_mutex = SIMIX_mutex_init();
for (i = 0; i < size; i++) {
smpi_global->do_once_mutex = SIMIX_mutex_init();
for (i = 0; i < size; i++) {
- smpi_global->pending_send_request_queues[i] = xbt_fifo_new();
smpi_global->received_message_queues[i] = xbt_fifo_new();
}
smpi_global->received_message_queues[i] = xbt_fifo_new();
}
SIMIX_mutex_destroy(smpi_global->do_once_mutex);
for (i = 0; i < size; i++) {
SIMIX_mutex_destroy(smpi_global->do_once_mutex);
for (i = 0; i < size; i++) {
- xbt_fifo_free(smpi_global->pending_send_request_queues[i]);
xbt_fifo_free(smpi_global->received_message_queues[i]);
}
xbt_fifo_free(smpi_global->received_message_queues[i]);
}
- xbt_free(smpi_global->pending_send_request_queues);
xbt_free(smpi_global->received_message_queues);
xbt_free(smpi_global);
xbt_free(smpi_global->received_message_queues);
xbt_free(smpi_global);
- request_queue = smpi_global->pending_send_request_queues[index];
+ request_queue = mydata->pending_send_request_queue;
while (1) {
request = xbt_fifo_shift(request_queue);
while (1) {
request = xbt_fifo_shift(request_queue);