Commit 0dc501a0 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

fix waitall, may terminate early.


Former-commit-id: dc7fbe6566032ee469ab0a2d36c10cca630ea51b
parent d02fc045
......@@ -744,9 +744,10 @@ int engine_exchange_strays ( struct engine *e , struct part *parts , struct xpar
/* Wait for each part array to come in and collect the new
parts from the proxies. */
for ( k = 0 ; k < 2*(nr_in + nr_out) ; k++ ) {
if ( MPI_Waitany( 2*e->nr_proxies , reqs_in , &pid , &status ) != MPI_SUCCESS ||
pid == MPI_UNDEFINED )
if ( MPI_Waitany( 2*e->nr_proxies , reqs_in , &pid , &status ) != MPI_SUCCESS ) {
error( "MPI_Waitany failed." );
if ( pid == MPI_UNDEFINED )
break;
// message( "request from proxy %i has arrived." , pid );
if ( reqs_in[pid & ~1] == MPI_REQUEST_NULL &&
reqs_in[pid | 1 ] == MPI_REQUEST_NULL ) {
......
......@@ -507,11 +507,11 @@ void space_rebuild ( struct space *s , double cell_max ) {
void parts_sort ( struct part *parts , struct xpart *xparts , int *ind , int N , int min , int max ) {
struct qstack {
int i, j, min, max;
volatile int i, j, min, max;
volatile int ready;
};
struct qstack *qstack;
int qstack_size = (max-min)/2 + 1;
int qstack_size = (max-min)/2 + 10;
volatile unsigned int first, last, waiting;
int pivot;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment