1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2 /*
3 * Copyright (c) 2004-2005 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) 2006 Voltaire. All rights reserved.
14 * Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved.
15 * Copyright (c) 2012 NVIDIA Corporation. All rights reserved.
16 * Copyright (c) 2015 Los Alamos National Security, LLC. All rights
17 * reserved.
18 *
19 * $COPYRIGHT$
20 *
21 * Additional copyrights may follow
22 *
23 * $HEADER$
24 */
25
26 #define OPAL_DISABLE_ENABLE_MEM_DEBUG 1
27 #include "opal_config.h"
28 #include "opal/mca/base/base.h"
29 #include "rcache_gpusm.h"
30 #ifdef HAVE_UNISTD_H
31 #include <unistd.h>
32 #endif
33 #ifdef HAVE_MALLOC_H
34 #include <malloc.h>
35 #endif
36
37 /*
38 * Local functions
39 */
40 static int gpusm_open(void);
41 static int gpusm_close(void);
42 static int gpusm_register(void);
43 static mca_rcache_base_module_t* gpusm_init(struct mca_rcache_base_resources_t* resources);
44
45 mca_rcache_gpusm_component_t mca_rcache_gpusm_component = {
46 {
47 /* First, the mca_base_component_t struct containing meta
48 information about the component itself */
49
50 .rcache_version = {
51 MCA_RCACHE_BASE_VERSION_3_0_0,
52
53 .mca_component_name = "gpusm",
54 MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
55 OPAL_RELEASE_VERSION),
56 .mca_open_component = gpusm_open,
57 .mca_close_component = gpusm_close,
58 .mca_register_component_params = gpusm_register,
59 },
60 .rcache_data = {
61 /* The component is checkpoint ready */
62 MCA_BASE_METADATA_PARAM_CHECKPOINT
63 },
64
65 .rcache_init = gpusm_init,
66 }
67 };
68
69 /**
70 * Component open/close/init/register functions. Most do not do anything,
71 * but keep around for placeholders.
72 */
gpusm_open(void)73 static int gpusm_open(void)
74 {
75 return OPAL_SUCCESS;
76 }
77
78
gpusm_register(void)79 static int gpusm_register(void)
80 {
81 return OPAL_SUCCESS;
82 }
83
84
gpusm_close(void)85 static int gpusm_close(void)
86 {
87 return OPAL_SUCCESS;
88 }
89
90
gpusm_init(struct mca_rcache_base_resources_t * resources)91 static mca_rcache_base_module_t* gpusm_init(struct mca_rcache_base_resources_t *resources)
92 {
93 mca_rcache_gpusm_module_t* rcache_module;
94
95 (void) resources;
96
97 rcache_module = (mca_rcache_gpusm_module_t *) calloc (1, sizeof (*rcache_module));
98 if (NULL == rcache_module) {
99 return NULL;
100 }
101
102 mca_rcache_gpusm_module_init(rcache_module);
103
104 return &rcache_module->super;
105 }
106