OpenMPI  0.1.1
rcache_vma_tree.c File Reference

Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana University Research and Technology Corporation. More...

#include "ompi_config.h"
#include "opal/mca/mca.h"
#include "rcache_vma_tree.h"

Functions

 OBJ_CLASS_INSTANCE (mca_rcache_vma_reg_list_item_t, opal_list_item_t, NULL, NULL)
 
static void mca_rcache_vma_construct (opal_object_t *object)
 
static void mca_rcache_vma_destruct (opal_object_t *object)
 
 OBJ_CLASS_INSTANCE (mca_rcache_vma_t, ompi_free_list_item_t, mca_rcache_vma_construct, mca_rcache_vma_destruct)
 
static int mca_rcache_vma_tree_node_compare (void *key1, void *key2)
 Function for the red black tree to compare 2 keys. More...
 
static int mca_rcache_vma_tree_node_compare_search (void *key1, void *key2)
 
static int mca_rcache_vma_tree_node_compare_closest (void *key1, void *key2)
 
static mca_rcache_vma_tmca_rcache_vma_new (mca_rcache_vma_module_t *vma_rcache, uintptr_t start, uintptr_t end)
 
void mca_rcache_vma_destroy (mca_rcache_vma_t *vma)
 
static int mca_rcache_vma_compare_regs (mca_mpool_base_registration_t *reg1, mca_mpool_base_registration_t *reg2)
 
static int mca_rcache_vma_add_reg (mca_rcache_vma_t *vma, mca_mpool_base_registration_t *reg)
 
static void mca_rcache_vma_remove_reg (mca_rcache_vma_t *vma, mca_mpool_base_registration_t *reg)
 
static int mca_rcache_vma_copy_reg_list (mca_rcache_vma_t *to, mca_rcache_vma_t *from)
 
static int mca_rcache_vma_compare_reg_lists (mca_rcache_vma_t *vma1, mca_rcache_vma_t *vma2)
 
int mca_rcache_vma_tree_init (mca_rcache_vma_module_t *rcache)
 
mca_mpool_base_registration_tmca_rcache_vma_tree_find (mca_rcache_vma_module_t *vma_rcache, unsigned char *base, unsigned char *bound)
 Returns the item in the vma tree.
 
static bool is_reg_in_array (mca_mpool_base_registration_t **regs, int cnt, mca_mpool_base_registration_t *p)
 
int mca_rcache_vma_tree_find_all (mca_rcache_vma_module_t *vma_rcache, unsigned char *base, unsigned char *bound, mca_mpool_base_registration_t **regs, int reg_cnt)
 Returns all registration that overlaps given memory region.
 
static int mca_rcache_vma_can_insert (mca_rcache_vma_module_t *vma_rcache, size_t nbytes, size_t limit)
 
static void mca_rcache_vma_update_byte_count (mca_rcache_vma_module_t *vma_rcache, size_t nbytes)
 
int mca_rcache_vma_tree_insert (mca_rcache_vma_module_t *vma_rcache, mca_mpool_base_registration_t *reg, size_t limit)
 
int mca_rcache_vma_tree_delete (mca_rcache_vma_module_t *vma_rcache, mca_mpool_base_registration_t *reg)
 Function to remove previously memory from the tree without freeing it. More...
 

Detailed Description

Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana University Research and Technology Corporation.

All rights reserved. Copyright (c) 2004-2007 The University of Tennessee and The University of Tennessee Research Foundation. All rights reserved. Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, University of Stuttgart. All rights reserved. Copyright (c) 2004-2005 The Regents of the University of California. All rights reserved.

Copyright (c) 2006 Voltaire. All rights reserved. Copyright (c) 2007 Mellanox Technologies. All rights reserved. Copyright (c) 2009 IBM Corporation. All rights reserved.

$COPYRIGHT$

Additional copyrights may follow

$HEADER$

Description of the Registration Cache framework

Function Documentation

int mca_rcache_vma_tree_delete ( mca_rcache_vma_module_t vma_rcache,
mca_mpool_base_registration_t reg 
)

Function to remove previously memory from the tree without freeing it.

Parameters
basepointer to the memory to free
Return values
OMPI_SUCCESS
OMPI_ERR_BAD_PARAMif the passed base pointer was invalid

References mca_rcache_vma_t::end, ompi_rb_tree_delete(), ompi_rb_tree_find_with(), opal_list_append, opal_list_get_begin(), opal_list_get_end(), opal_list_get_next, opal_list_get_prev, opal_list_is_empty(), opal_list_remove_item(), mca_rcache_vma_t::reg_list, mca_rcache_vma_t::start, mca_rcache_vma_t::super, and opal_list_t::super.

static int mca_rcache_vma_tree_node_compare ( void *  key1,
void *  key2 
)
static

Function for the red black tree to compare 2 keys.

Parameters
key1a pointer to the 1st key
key2a pointer to the second key
Return values
-1if key1 is below key2
1if key 1 is above key2
0if the keys are the same

References mca_rcache_vma_t::start.