1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
2 /*
3 * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
4 * University Research and Technology
5 * Corporation. All rights reserved.
6 * Copyright (c) 2004-2009 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) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
14 * Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
15 * Copyright (c) 2015-2016 Research Organization for Information Science
16 * and Technology (RIST). All rights reserved.
17 * Copyright (c) 2019 IBM Corporation. All rights reserved.
18 * $COPYRIGHT$
19 *
20 * Additional copyrights may follow
21 *
22 * $HEADER$
23 */
24 /** @file:
25 *
26 */
27 #include <src/include/pmix_config.h>
28
29 #include <pmix_common.h>
30
31 #ifdef HAVE_STRING_H
32 #include <string.h>
33 #endif
34
35 #include "src/class/pmix_list.h"
36 #include "src/mca/base/base.h"
37 #include "src/mca/psquash/base/base.h"
38
39 /*
40 * The following file was created by configure. It contains extern
41 * statements and the definition of an array of pointers to each
42 * component's public mca_base_component_t struct.
43 */
44
45 #include "src/mca/psquash/base/static-components.h"
46
47 static bool initialized = false;
48
49 pmix_psquash_base_module_t pmix_psquash = {0};
50
51 static pmix_status_t pmix_psquash_close(void)
52 {
53 if (!initialized) {
54 return PMIX_SUCCESS;
55 }
56 initialized = false;
57
58 return pmix_mca_base_framework_components_close(&pmix_psquash_base_framework, NULL);
59 }
60
61 static pmix_status_t pmix_psquash_open(pmix_mca_base_open_flag_t flags)
62 {
63 if (initialized) {
64 return PMIX_SUCCESS;
65 }
66 /* initialize globals */
67 initialized = true;
68
69 /* Open up all available components */
70 return pmix_mca_base_framework_components_open(&pmix_psquash_base_framework, flags);
71 }
72
73 PMIX_MCA_BASE_FRAMEWORK_DECLARE(pmix, psquash, "PMIx Squash Operations",
74 NULL, pmix_psquash_open, pmix_psquash_close,
75 mca_psquash_base_static_components, 0);