1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2 /*
3 * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana
4 * University Research and Technology
5 * Corporation. All rights reserved.
6 * Copyright (c) 2004-2005 The University of Tennessee and The University
7 * of Tennessee Research Foundation. All rights
8 * reserved.
9 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10 * University of Stuttgart. All rights reserved.
11 * Copyright (c) 2004-2005 The Regents of the University of California.
12 * All rights reserved.
13 * Copyright (c) 2015 Los Alamos National Security, LLC. All rights
14 * reserved.
15 * Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
16 * Copyright (c) 2017 Mellanox Technologies, Inc.
17 * All rights reserved.
18 * $COPYRIGHT$
19 *
20 * Additional copyrights may follow
21 *
22 * $HEADER$
23 *
24 * These symbols are in a file by themselves to provide nice linker
25 * semantics. Since linkers generally pull in symbols by object
26 * files, keeping these symbols as the only symbols in this file
27 * prevents utility programs such as "ompi_info" from having to import
28 * entire components just to query their version and parameters.
29 */
30
31 #include <src/include/pmix_config.h>
32 #include "pmix_common.h"
33
34
35 #include <src/mca/pshmem/pshmem.h>
36 #include "pshmem_mmap.h"
37
38 static pmix_status_t component_open(void);
39 static pmix_status_t component_close(void);
40 static pmix_status_t component_query(pmix_mca_base_module_t **module, int *priority);
41
42 /*
43 * Instantiate the public struct with all of our public information
44 * and pointers to our public functions in it
45 */
46 pmix_pshmem_base_component_t mca_pshmem_mmap_component = {
47 .base = {
48 PMIX_PSHMEM_BASE_VERSION_1_0_0,
49
50 /* Component name and version */
51 .pmix_mca_component_name = "mmap",
52 PMIX_MCA_BASE_MAKE_VERSION(component,
53 PMIX_MAJOR_VERSION,
54 PMIX_MINOR_VERSION,
55 PMIX_RELEASE_VERSION),
56
57 /* Component open and close functions */
58 .pmix_mca_open_component = component_open,
59 .pmix_mca_close_component = component_close,
60 .pmix_mca_query_component = component_query,
61 },
62 .data = {
63 /* The component is checkpoint ready */
64 PMIX_MCA_BASE_METADATA_PARAM_CHECKPOINT
65 }
66 };
67
68
69 static int component_open(void)
70 {
71 return PMIX_SUCCESS;
72 }
73
74
75 static int component_query(pmix_mca_base_module_t **module, int *priority)
76 {
77 *priority = 10;
78 *module = (pmix_mca_base_module_t *)&pmix_mmap_module;
79 return PMIX_SUCCESS;
80 }
81
82
83 static int component_close(void)
84 {
85 return PMIX_SUCCESS;
86 }