61 integer,
allocatable :: elems(:)
67 integer(omp_lock_kind) :: lock
94 integer :: nelems, pol
144 if (q%nelems .eq. 0)
then 148 else if (q%nelems .eq. q%maxelems)
then 149 write(*,
'("Cannot push anymore", i4,x,i4)')elem, q%nelems
162 q%nelems = q%nelems+1
188 write(*,
'(i3,"->")',advance=
'no')elem
205 integer :: qrm_queue_pop
208 if (q%nelems .eq. 0)
then 213 q%elems(qrm_queue_pop) = 0
214 q%nelems = q%nelems-1
239 if (q%nelems .eq. 0)
then 245 q%nelems = q%nelems-1
249 if (q%elems(tmp) .eq. n)
then 250 q%elems(tmp) = q%elems(n)
251 q%nelems = q%nelems-1
252 if(n .eq. q%t) q%t = tmp
290 integer :: qrm_queue_next, n
295 call omp_set_lock(q%lock)
297 if (q%nelems .eq. 0)
then 299 else if (n .eq. q%t)
then 306 qrm_queue_next = q%elems(n)
310 call omp_unset_lock(q%lock)
Generic interface for the qrm_adealloc_i, qrm_adealloc_2i, qrm_adealloc_s, qrm_adealloc_2s, qrm_adealloc_3s, qrm_adealloc_d, qrm_adealloc_2d, qrm_adealloc_3d, qrm_adealloc_c, qrm_adealloc_2c, qrm_adealloc_3c, qrm_adealloc_z, qrm_adealloc_2z, qrm_adealloc_3z, routines.
This module contains all the facilities for front queues.
subroutine qrm_queue_prnt(q)
Prints the content of a queue.
A data type meant to to define a queue.
subroutine qrm_queue_rm(q, n)
Removes (without returning it) an element from a queue.
integer function qrm_queue_pop(q)
Pops an element from a queue.
Generic interface for the qrm_aalloc_i, qrm_aalloc_2i, qrm_aalloc_s, qrm_aalloc_2s, qrm_aalloc_3s, qrm_aalloc_d, qrm_aalloc_2d, qrm_aalloc_3d, qrm_aalloc_c, qrm_aalloc_2c, qrm_aalloc_3c, qrm_aalloc_z, qrm_aalloc_2z, qrm_aalloc_3z, routines.
subroutine qrm_queue_push(q, elem)
Pushes an element on a queue.
integer, parameter qrm_fifo_
parameter to define the policy of the queue: FIFO
subroutine qrm_queue_free(q)
Frees a queue.
integer, parameter qrm_lifo_
parameter to define the policy of the queue: LIFO
This module implements the memory handling routines. Pretty mucch allocations and deallocations...
integer function qrm_queue_next(q, n)
Returns the element that follows n in the queue q. Very useful for sweeping through a queue...