root/oshmem/mca/memheap/buddy/memheap_buddy_component.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. _basic_open
  2. mca_memheap_buddy_component_query
  3. mca_memheap_buddy_component_close

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2013      Mellanox Technologies, Inc.
   4  *                         All rights reserved.
   5  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
   6  *                         reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 #include "oshmem_config.h"
  14 #include "opal/util/output.h"
  15 #include "oshmem/mca/memheap/memheap.h"
  16 #include "oshmem/mca/memheap/base/base.h"
  17 #include "oshmem/mca/memheap/buddy/memheap_buddy.h"
  18 #include "memheap_buddy_component.h"
  19 
  20 static int mca_memheap_buddy_component_close(void);
  21 static int mca_memheap_buddy_component_query(mca_base_module_t **module, int *priority);
  22 
  23 static int _basic_open(void);
  24 
  25 mca_memheap_base_component_t mca_memheap_buddy_component = {
  26     .memheap_version = {
  27         MCA_MEMHEAP_BASE_VERSION_2_0_0,
  28 
  29         .mca_component_name = "buddy",
  30         MCA_BASE_MAKE_VERSION(component, OSHMEM_MAJOR_VERSION, OSHMEM_MINOR_VERSION,
  31                               OSHMEM_RELEASE_VERSION),
  32 
  33         .mca_open_component = _basic_open,
  34         .mca_close_component = mca_memheap_buddy_component_close,
  35         .mca_query_component = mca_memheap_buddy_component_query,
  36     },
  37     .memheap_data = {
  38         /* The component is checkpoint ready */
  39         MCA_BASE_METADATA_PARAM_CHECKPOINT
  40     },
  41     .memheap_init = mca_memheap_buddy_module_init
  42 };
  43 
  44 /* Open component */
  45 static int _basic_open(void)
  46 {
  47     return OSHMEM_SUCCESS;
  48 }
  49 
  50 /* query component */
  51 static int
  52 mca_memheap_buddy_component_query(mca_base_module_t **module, int *priority)
  53 {
  54     *priority = memheap_buddy.priority;
  55     *module = (mca_base_module_t *)&memheap_buddy.super;
  56     return OSHMEM_SUCCESS;
  57 }
  58 
  59 /*
  60  * This function is automaticaly called from mca_base_components_close.
  61  * It releases the component's allocated memory.
  62  */
  63 int mca_memheap_buddy_component_close()
  64 {
  65     mca_memheap_buddy_finalize();
  66     return OSHMEM_SUCCESS;
  67 }

/* [<][>][^][v][top][bottom][index][help] */