heap 16 ompi/mca/io/romio321/romio/adio/common/heap-sort.c static void heapify(heap_t *heap, int i); heap 32 ompi/mca/io/romio321/romio/adio/common/heap-sort.c int ADIOI_Heap_create(heap_t *heap, int size) { heap 33 ompi/mca/io/romio321/romio/adio/common/heap-sort.c heap->size = size; heap 34 ompi/mca/io/romio321/romio/adio/common/heap-sort.c heap->nodes = (heap_node_t *) ADIOI_Calloc (size, sizeof(heap_node_t)); heap 35 ompi/mca/io/romio321/romio/adio/common/heap-sort.c if (heap->nodes == NULL) heap 41 ompi/mca/io/romio321/romio/adio/common/heap-sort.c void ADIOI_Heap_free(heap_t *heap) { heap 42 ompi/mca/io/romio321/romio/adio/common/heap-sort.c ADIOI_Free(heap->nodes); heap 46 ompi/mca/io/romio321/romio/adio/common/heap-sort.c static void build_heap(heap_t *heap) ATTRIBUTE((unused, used)); heap 48 ompi/mca/io/romio321/romio/adio/common/heap-sort.c static void build_heap(heap_t *heap) heap 51 ompi/mca/io/romio321/romio/adio/common/heap-sort.c for (i=(heap->size/2-1); i >= 0; i--) heap 52 ompi/mca/io/romio321/romio/adio/common/heap-sort.c heapify(heap, i); heap 55 ompi/mca/io/romio321/romio/adio/common/heap-sort.c static void heapify(heap_t *heap, int i) { heap 60 ompi/mca/io/romio321/romio/adio/common/heap-sort.c nodes = heap->nodes; heap 65 ompi/mca/io/romio321/romio/adio/common/heap-sort.c if ((l <= heap->size) && (nodes[l].offset < nodes[i].offset)) heap 70 ompi/mca/io/romio321/romio/adio/common/heap-sort.c if ((r <= heap->size) && (nodes[r].offset < nodes[smallest].offset)) heap 77 ompi/mca/io/romio321/romio/adio/common/heap-sort.c heapify(heap, smallest); heap 81 ompi/mca/io/romio321/romio/adio/common/heap-sort.c void ADIOI_Heap_insert(heap_t *heap, ADIO_Offset offset, int proc, heap 85 ompi/mca/io/romio321/romio/adio/common/heap-sort.c nodes = heap->nodes; heap 86 ompi/mca/io/romio321/romio/adio/common/heap-sort.c i = ++heap->size - 1; heap 96 ompi/mca/io/romio321/romio/adio/common/heap-sort.c void ADIOI_Heap_extract_min(heap_t *heap, ADIO_Offset* offset, int *proc, heap 99 ompi/mca/io/romio321/romio/adio/common/heap-sort.c nodes = heap->nodes; heap 101 ompi/mca/io/romio321/romio/adio/common/heap-sort.c assert (heap->size > 0); heap 105 ompi/mca/io/romio321/romio/adio/common/heap-sort.c nodes[0] = nodes[heap->size-1]; heap 106 ompi/mca/io/romio321/romio/adio/common/heap-sort.c heap->size--; heap 107 ompi/mca/io/romio321/romio/adio/common/heap-sort.c heapify(heap, 0); heap 111 ompi/mca/io/romio321/romio/adio/common/heap-sort.c static void print_heap(heap_t *heap) ATTRIBUTE((unused, used)); heap 113 ompi/mca/io/romio321/romio/adio/common/heap-sort.c static void print_heap(heap_t *heap) heap 120 ompi/mca/io/romio321/romio/adio/common/heap-sort.c printf ("heap->size = %d\n", heap->size); heap 122 ompi/mca/io/romio321/romio/adio/common/heap-sort.c for (i=0; i < heap->size; i++) { heap 123 ompi/mca/io/romio321/romio/adio/common/heap-sort.c printf ("%lld ", heap->nodes[i].offset); heap 17 ompi/mca/io/romio321/romio/adio/include/heap-sort.h void ADIOI_Heap_free(heap_t *heap); heap 18 ompi/mca/io/romio321/romio/adio/include/heap-sort.h int ADIOI_Heap_create(heap_t *heap, int size); heap 19 ompi/mca/io/romio321/romio/adio/include/heap-sort.h void ADIOI_Heap_insert(heap_t *heap, ADIO_Offset offset, int proc, heap 21 ompi/mca/io/romio321/romio/adio/include/heap-sort.h void ADIOI_Heap_extract_min(heap_t *heap, ADIO_Offset* key, int *proc, heap 43 opal/mca/event/libevent2022/libevent/test/regress_minheap.c check_heap(struct min_heap *heap) heap 46 opal/mca/event/libevent2022/libevent/test/regress_minheap.c for (i = 1; i < heap->n; ++i) { heap 48 opal/mca/event/libevent2022/libevent/test/regress_minheap.c tt_want(evutil_timercmp(&heap->p[i]->ev_timeout, heap 49 opal/mca/event/libevent2022/libevent/test/regress_minheap.c &heap->p[parent_idx]->ev_timeout, >=)); heap 56 opal/mca/event/libevent2022/libevent/test/regress_minheap.c struct min_heap heap; heap 61 opal/mca/event/libevent2022/libevent/test/regress_minheap.c min_heap_ctor(&heap); heap 66 opal/mca/event/libevent2022/libevent/test/regress_minheap.c min_heap_push(&heap, inserted[i]); heap 68 opal/mca/event/libevent2022/libevent/test/regress_minheap.c check_heap(&heap); heap 70 opal/mca/event/libevent2022/libevent/test/regress_minheap.c tt_assert(min_heap_size(&heap) == 1024); heap 73 opal/mca/event/libevent2022/libevent/test/regress_minheap.c min_heap_erase(&heap, inserted[i]); heap 75 opal/mca/event/libevent2022/libevent/test/regress_minheap.c check_heap(&heap); heap 77 opal/mca/event/libevent2022/libevent/test/regress_minheap.c tt_assert(min_heap_size(&heap) == 512); heap 79 opal/mca/event/libevent2022/libevent/test/regress_minheap.c last_e = min_heap_pop(&heap); heap 81 opal/mca/event/libevent2022/libevent/test/regress_minheap.c e = min_heap_pop(&heap); heap 87 opal/mca/event/libevent2022/libevent/test/regress_minheap.c tt_assert(min_heap_size(&heap) == 0); heap 92 opal/mca/event/libevent2022/libevent/test/regress_minheap.c min_heap_dtor(&heap); heap 192 oshmem/mca/memheap/buddy/memheap_buddy.c memheap_buddy.heap.max_order = memheap_log2(context->user_size); heap 193 oshmem/mca/memheap/buddy/memheap_buddy.c memheap_buddy.heap.min_order = MEMHEAP_BASE_MIN_ORDER; heap 197 oshmem/mca/memheap/buddy/memheap_buddy.c if (context->user_size != (1ULL << memheap_buddy.heap.max_order)) { heap 200 oshmem/mca/memheap/buddy/memheap_buddy.c (unsigned long long)context->user_size, 1ULL << memheap_buddy.heap.max_order); heap 205 oshmem/mca/memheap/buddy/memheap_buddy.c memheap_buddy.heap.symmetric_heap = context->user_base_addr; heap 208 oshmem/mca/memheap/buddy/memheap_buddy.c memheap_buddy.super.memheap_size = (1ULL << memheap_buddy.heap.max_order); heap 233 oshmem/mca/memheap/buddy/memheap_buddy.c memheap_buddy.heap.symmetric_heap_hashtable = OBJ_NEW(opal_hash_table_t); heap 234 oshmem/mca/memheap/buddy/memheap_buddy.c if (NULL == memheap_buddy.heap.symmetric_heap_hashtable) { heap 245 oshmem/mca/memheap/buddy/memheap_buddy.c opal_hash_table_init(memheap_buddy.heap.symmetric_heap_hashtable, heap 250 oshmem/mca/memheap/buddy/memheap_buddy.c buddy->heap.bits = (unsigned long**) calloc((buddy->heap.max_order + 1), heap 255 oshmem/mca/memheap/buddy/memheap_buddy.c buddy->heap.num_free = (unsigned int*) calloc((buddy->heap.max_order + 1), heap 260 oshmem/mca/memheap/buddy/memheap_buddy.c if ((NULL == buddy->heap.bits) || (NULL == buddy->heap.num_free) heap 269 oshmem/mca/memheap/buddy/memheap_buddy.c for (i = buddy->heap.min_order; i <= buddy->heap.max_order; ++i) { heap 270 oshmem/mca/memheap/buddy/memheap_buddy.c s = BITS_TO_LONGS(1UL << (buddy->heap.max_order - i)); heap 273 oshmem/mca/memheap/buddy/memheap_buddy.c i, buddy->heap.max_order, s, (int)sizeof(unsigned long)); heap 275 oshmem/mca/memheap/buddy/memheap_buddy.c buddy->heap.bits[i] = (unsigned long*) malloc(s heap 277 oshmem/mca/memheap/buddy/memheap_buddy.c if (NULL == buddy->heap.bits[i]) { heap 281 oshmem/mca/memheap/buddy/memheap_buddy.c bitmap_zero(buddy->heap.bits[i], 1UL << (buddy->heap.max_order - i)); heap 306 oshmem/mca/memheap/buddy/memheap_buddy.c set_bit(0, buddy->heap.bits[buddy->heap.max_order]); heap 308 oshmem/mca/memheap/buddy/memheap_buddy.c buddy->heap.num_free[buddy->heap.max_order] = 1; heap 325 oshmem/mca/memheap/buddy/memheap_buddy.c for (i = 0; i <= buddy->heap.max_order; ++i) { heap 326 oshmem/mca/memheap/buddy/memheap_buddy.c if (NULL != buddy->heap.bits && NULL != buddy->heap.bits[i]) { heap 327 oshmem/mca/memheap/buddy/memheap_buddy.c free(buddy->heap.bits[i]); heap 338 oshmem/mca/memheap/buddy/memheap_buddy.c if (NULL != buddy->heap.bits) { heap 339 oshmem/mca/memheap/buddy/memheap_buddy.c free(buddy->heap.bits); heap 341 oshmem/mca/memheap/buddy/memheap_buddy.c if (NULL != buddy->heap.num_free) { heap 342 oshmem/mca/memheap/buddy/memheap_buddy.c free(buddy->heap.num_free); heap 358 oshmem/mca/memheap/buddy/memheap_buddy.c mca_memheap_buddy_heap_t *heap) heap 365 oshmem/mca/memheap/buddy/memheap_buddy.c for (o = order; o <= heap->max_order; ++o) { heap 366 oshmem/mca/memheap/buddy/memheap_buddy.c if (heap->num_free[o]) { heap 367 oshmem/mca/memheap/buddy/memheap_buddy.c m = 1 << (heap->max_order - o); heap 368 oshmem/mca/memheap/buddy/memheap_buddy.c *seg = find_first_bit(heap->bits[o], m); heap 371 oshmem/mca/memheap/buddy/memheap_buddy.c o, heap->bits[o][0], m, *seg); heap 381 oshmem/mca/memheap/buddy/memheap_buddy.c clear_bit(*seg, heap->bits[o]); heap 382 oshmem/mca/memheap/buddy/memheap_buddy.c --(heap->num_free[o]); heap 387 oshmem/mca/memheap/buddy/memheap_buddy.c set_bit(*seg ^ 1, heap->bits[o]); heap 388 oshmem/mca/memheap/buddy/memheap_buddy.c ++(heap->num_free[o]); heap 400 oshmem/mca/memheap/buddy/memheap_buddy.c mca_memheap_buddy_heap_t *heap) heap 406 oshmem/mca/memheap/buddy/memheap_buddy.c while (test_bit(seg ^ 1, heap->bits[order])) { heap 407 oshmem/mca/memheap/buddy/memheap_buddy.c clear_bit(seg ^ 1, heap->bits[order]); heap 408 oshmem/mca/memheap/buddy/memheap_buddy.c --(heap->num_free[order]); heap 413 oshmem/mca/memheap/buddy/memheap_buddy.c set_bit(seg, heap->bits[order]); heap 414 oshmem/mca/memheap/buddy/memheap_buddy.c ++(heap->num_free[order]); heap 423 oshmem/mca/memheap/buddy/memheap_buddy.c return _buddy_free(buddy, seg, order, &buddy->heap); heap 435 oshmem/mca/memheap/buddy/memheap_buddy.c mca_memheap_buddy_heap_t *heap) heap 442 oshmem/mca/memheap/buddy/memheap_buddy.c if (order < heap->min_order) heap 443 oshmem/mca/memheap/buddy/memheap_buddy.c order = heap->min_order; heap 446 oshmem/mca/memheap/buddy/memheap_buddy.c if (order > heap->max_order) { heap 452 oshmem/mca/memheap/buddy/memheap_buddy.c base = (unsigned long) heap->symmetric_heap; heap 454 oshmem/mca/memheap/buddy/memheap_buddy.c if (OSHMEM_SUCCESS != _buddy_alloc(order, &offset, heap)) { heap 462 oshmem/mca/memheap/buddy/memheap_buddy.c rc = opal_hash_table_set_value_uint64(heap->symmetric_heap_hashtable, heap 475 oshmem/mca/memheap/buddy/memheap_buddy.c alloc_error: _buddy_free(&memheap_buddy, offset, order, heap); heap 481 oshmem/mca/memheap/buddy/memheap_buddy.c return _do_alloc(order, p_buff, &(memheap_buddy.heap)); heap 586 oshmem/mca/memheap/buddy/memheap_buddy.c opal_hash_table_get_value_uint64(memheap_buddy.heap.symmetric_heap_hashtable, heap 608 oshmem/mca/memheap/buddy/memheap_buddy.c if (new_size > (1UL << memheap_buddy.heap.max_order)) { heap 613 oshmem/mca/memheap/buddy/memheap_buddy.c if (old_size + new_size >= (1UL << memheap_buddy.heap.max_order)) { heap 628 oshmem/mca/memheap/buddy/memheap_buddy.c if (old_size + new_size >= (1UL << memheap_buddy.heap.max_order) heap 637 oshmem/mca/memheap/buddy/memheap_buddy.c if (old_size + new_size < (1UL << memheap_buddy.heap.max_order)) heap 657 oshmem/mca/memheap/buddy/memheap_buddy.c base = (unsigned long) memheap_buddy.heap.symmetric_heap; heap 662 oshmem/mca/memheap/buddy/memheap_buddy.c opal_hash_table_get_value_uint64(memheap_buddy.heap.symmetric_heap_hashtable, heap 670 oshmem/mca/memheap/buddy/memheap_buddy.c opal_hash_table_remove_value_uint64(memheap_buddy.heap.symmetric_heap_hashtable, heap 681 oshmem/mca/memheap/buddy/memheap_buddy.c if (memheap_buddy.heap.max_order == 0) heap 685 oshmem/mca/memheap/buddy/memheap_buddy.c if (memheap_buddy.heap.symmetric_heap_hashtable) { heap 686 oshmem/mca/memheap/buddy/memheap_buddy.c OBJ_RELEASE(memheap_buddy.heap.symmetric_heap_hashtable); heap 60 oshmem/mca/memheap/buddy/memheap_buddy.h mca_memheap_buddy_heap_t heap;