86 q->
lock = PASTIX_ATOMIC_UNLOCKED;
183 pastix_atomic_lock( &(q->
lock) );
192 assert( (q->
size == 0) || (tmp != NULL) );
218 i = hi; hi = (i+1)/2-1;
220 pastix_atomic_unlock( &(q->
lock) );
270 pastix_atomic_lock( &(q->
lock) );
275 pastix_atomic_unlock( &(q->
lock) );
281 if (key1 != NULL) { *key1 = q->
elttab[0].
key1; }
282 if (key2 != NULL) { *key2 = q->
elttab[0].
key2; }
288 while(i <= (q->
used/2))
315 pastix_atomic_unlock( &(q->
lock) );
339 fprintf(stderr,
"Queue :\n");
340 for (i = 0; i < q->
used; i++, item++) {
341 fprintf(stderr,
"(%ld %ld %ld) ",
344 (
long)(item->
key2) );
346 fprintf(stderr,
"\n");
349 fprintf(stderr,
"\n");
BEGIN_C_DECLS typedef int pastix_int_t
pastix_atomic_lock_t lock
pastix_queue_item_t * elttab
volatile pastix_int_t used
void pqueuePush2(pastix_queue_t *, pastix_int_t, double, double)
Insert an element into the sorted queue.
pastix_int_t pqueueRead(const pastix_queue_t *)
Read the first element of the queue.
void pqueueClear(pastix_queue_t *)
Reset the number of used element to 0.
void pqueueExit(pastix_queue_t *)
Free the structure associated to the queue.
pastix_int_t pqueuePop2(pastix_queue_t *, double *, double *)
Remove the first element of the queue and return its keys if needed.
void pqueuePrint(const pastix_queue_t *)
Print the queue.
pastix_int_t pqueueSize(const pastix_queue_t *)
Return the size of the queue.
int pqueueInit(pastix_queue_t *, pastix_int_t)
Initialize the queue structure with an initial space to store the elements.
static int pqueueItemComparison(const pastix_queue_item_t *item1, const pastix_queue_item_t *item2)
Compare two items of the queue based on the couple (key1, key2).