SST  7.0.0
StructuralSimulationToolkit
element.h
1 // Copyright 2009-2017 Sandia Corporation. Under the terms
2 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2017, Sandia Corporation
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 
12 #ifndef SST_CORE_ELEMENT_H
13 #define SST_CORE_ELEMENT_H
14 
15 #include <sst/core/sst_types.h>
16 #include <sst/core/params.h>
17 
18 #include <stdio.h>
19 #include <string>
20 
21 #include <elibase.h>
22 
23 namespace SST {
24 class Component;
25 class ConfigGraph;
26 class PartitionGraph;
27 class Introspector;
28 class Module;
29 class Params;
30 class SubComponent;
31 namespace Partition {
32  class SSTPartitioner;
33 }
34 class RankInfo;
35 
36 typedef Component* (*componentAllocate)(ComponentId_t, Params&);
37 typedef Introspector* (*introspectorAllocate)(Params&);
38 typedef void (*eventInitialize)(void);
39 typedef Module* (*moduleAllocate)(Params&);
40 typedef Module* (*moduleAllocateWithComponent)(Component*, Params&);
41 typedef SubComponent* (*subcomponentAllocate)(Component*, Params&);
42 typedef SST::Partition::SSTPartitioner* (*partitionFunction)(RankInfo, RankInfo, int);
43 typedef void (*generateFunction)(ConfigGraph*, std::string options, int ranks);
44 typedef void* (*genPythonModuleFunction)(void);
45 
46 
47 /** Describes a Component and its associated information
48  */
50  const char *name; /*!< Name of the component */
51  const char *description; /*!< Brief description of what the component does */
52  void (*printHelp)(FILE *output); /*!< Pointer to a function that will print additional documentation about the component. (optional) */
53  componentAllocate alloc; /*!< Pointer to function to allocate a new instance of this component. */
54  const ElementInfoParam *params; /*!< List of parameters for which this component expects to look. */
55  const ElementInfoPort *ports; /*!< List of ports that this component uses. */
56  uint32_t category; /*!< Bit-mask of categories in which this component fits. */
57  const ElementInfoStatistic *stats; /*!< List of statistic Names that this component wants enabled. */
58  const ElementInfoSubComponentSlot *subComponents;
59 };
60 
61 /** Describes an Introspector
62  */
64  const char *name; /*!< Name of the introspector */
65  const char *description; /*!< Brief description of what the introspector does. */
66  void (*printHelp)(FILE *output); /*!< Pointer to a function that will print additional documentation about the introspector. (optional) */
67  introspectorAllocate alloc; /*!< Pointer to a function to allocate a new instance of this introspector. */
68  const ElementInfoParam *params; /*!< List of parameters which this introspector uses. */
69 };
70 
71 /** Describes an Event
72  */
74  const char *name; /*!< Name of the event */
75  const char *description; /*!< Brief description of this event. */
76  void (*printHelp)(FILE *output); /*!< Pointer to a function that will print additional documentation about the event. (optional) */
77  eventInitialize init; /*!< Pointer to a function to initialize the library for use of this event. (optional) */
78 };
79 
80 /** Describes a Module
81  */
83  const char *name; /*!< Name of the module. */
84  const char *description; /*!< Brief description of the module. */
85  void (*printHelp)(FILE *output); /*!< Pointer to a function that will print additional documentation about the module. (optional) */
86  moduleAllocate alloc; /*!< Pointer to a function to do a default initialization of the module. */
87  moduleAllocateWithComponent alloc_with_comp; /*!< Pointer to a function to initialize a module instance, passing a Component as an argument. */
88  const ElementInfoParam *params; /*!< List of parameters which are used by this module. */
89  const char *provides; /*!< Name of SuperClass which for this module can be used. */
90 };
91 
93  const char *name; /*!< Name of the subcomponent. */
94  const char *description; /*!< Brief description of the subcomponent. */
95  void (*printHelp)(FILE *output); /*!< Pointer to a function that will print additional documentation about the subcomponent (optional) */
96  subcomponentAllocate alloc; /*!< Pointer to a function to initialize a subcomponent instance, passing a Component as an argument. */
97  const ElementInfoParam *params; /*!< List of parameters which are used by this subcomponent. */
98  const ElementInfoStatistic *stats; /*!< List of statistics supplied by this subcomponent. */
99  const char *provides; /*!< Name of SuperClass which for this subcomponent can be used. */
100  const ElementInfoPort *ports; /*!< List of ports that this subcomponent uses. */
101  const ElementInfoSubComponentSlot *subComponents;
102 };
103 
104 /** Describes a Partitioner
105  */
107  const char *name; /*!< Name of the Partitioner */
108  const char *description; /*!< Brief description of the partitioner */
109  void (*printHelp)(FILE *output); /*!< Pointer to a function that will print additional documentation about the partitioner. (optional) */
110  partitionFunction func; /*!< Function to be called to perform the paritioning */
111 };
112 
113 /** Describes a Generator
114  */
116  const char *name; /*!< Name of the Generator */
117  const char *description; /*!< Brief description of the generator */
118  void (*printHelp)(FILE *output); /*!< Pointer to a function that will print additional documentation about the generator. (optional) */
119  generateFunction func; /*!< Function to be called to perform the graph generation */
120 };
121 
122 /** Describes all the parts of the Element Library
123  */
124 #ifdef SST_ELI_COMPILE_OLD_ELI_WITHOUT_DEPRECATION_WARNINGS
125 struct ElementLibraryInfo {
126 #else
127 #if SST_BUILDING_CORE
128 struct ElementLibraryInfo {
129 #else
130 struct __attribute__ ((deprecated("Old ELI support (defined in sst/core/element.h) will be removed in version 8.0, but is still the preferred API until version 7.1. New ELI support (defined in sst/core/elementinfo.h) is available, but experimental and subject to change until version 7.1."))) ElementLibraryInfo {
131 #endif
132 #endif
133  const char *name; /*!< Name of the Library. */
134  const char *description; /*!< Brief description of the Library */
135  const struct ElementInfoComponent* components; /*!< List of Components contained in the library. */
136  const struct ElementInfoEvent* events; /*!< List of Events exported by the library. */
137  const struct ElementInfoIntrospector* introspectors; /*!< List of Introspectors provided by the library. */
138  const struct ElementInfoModule* modules; /*!< List of Modules provided by the library. */
139  const struct ElementInfoSubComponent* subcomponents; /*!< List of SubComponents provided by the library. */
140  const struct ElementInfoPartitioner* partitioners; /*!< List of Partitioners provided by the library. */
141  genPythonModuleFunction pythonModuleGenerator; /*!< Pointer to Function to generate a Python Module for use in Configurations */
142  const struct ElementInfoGenerator* generators; /*!< List of Generators provided by the library. */
143 };
144 
145 
146 } //namespace SST
147 
148 #endif // SST_CORE_ELEMENT_H
const ElementInfoStatistic * stats
Definition: element.h:98
Describes an Event.
Definition: element.h:73
void(* printHelp)(FILE *output)
Definition: element.h:95
const char * provides
Definition: element.h:89
Describes a Component and its associated information.
Definition: element.h:49
componentAllocate alloc
Definition: element.h:53
Describes a Partitioner.
Definition: element.h:106
void(* printHelp)(FILE *output)
Definition: element.h:118
const char * description
Definition: element.h:51
Definition: elibase.h:62
const struct ElementInfoComponent * components
Definition: element.h:135
uint32_t category
Definition: element.h:56
const char * name
Definition: element.h:50
introspectorAllocate alloc
Definition: element.h:67
Describes all the parts of the Element Library.
Definition: element.h:130
moduleAllocate alloc
Definition: element.h:86
const char * description
Definition: element.h:65
const char * description
Definition: element.h:75
void(* printHelp)(FILE *output)
Definition: element.h:52
Definition: action.cc:17
const char * name
Definition: element.h:133
const ElementInfoStatistic * stats
Definition: element.h:57
void(* printHelp)(FILE *output)
Definition: element.h:76
const struct ElementInfoPartitioner * partitioners
Definition: element.h:140
Describes Statistics used by a Component.
Definition: elibase.h:31
Describes a Generator.
Definition: element.h:115
const char * name
Definition: element.h:74
Describes an Introspector.
Definition: element.h:63
void(* printHelp)(FILE *output)
Definition: element.h:109
const char * description
Definition: element.h:108
eventInitialize init
Definition: element.h:77
const ElementInfoParam * params
Definition: element.h:68
const char * name
Definition: element.h:64
const struct ElementInfoModule * modules
Definition: element.h:138
const ElementInfoParam * params
Definition: element.h:97
Describes Parameters to a Component.
Definition: elibase.h:40
partitionFunction func
Definition: element.h:110
const char * description
Definition: element.h:84
subcomponentAllocate alloc
Definition: element.h:96
moduleAllocateWithComponent alloc_with_comp
Definition: element.h:87
Base class for Partitioning graphs.
Definition: sstpart.h:31
const char * name
Definition: element.h:83
const char * provides
Definition: element.h:99
const struct ElementInfoIntrospector * introspectors
Definition: element.h:137
Describes a Module.
Definition: element.h:82
void(* printHelp)(FILE *output)
Definition: element.h:66
const ElementInfoPort * ports
Definition: element.h:55
genPythonModuleFunction pythonModuleGenerator
Definition: element.h:141
const ElementInfoPort * ports
Definition: element.h:100
const char * description
Definition: element.h:94
const struct ElementInfoEvent * events
Definition: element.h:136
const ElementInfoParam * params
Definition: element.h:88
const char * description
Definition: element.h:117
void(* printHelp)(FILE *output)
Definition: element.h:85
const struct ElementInfoSubComponent * subcomponents
Definition: element.h:139
const char * description
Definition: element.h:134
const ElementInfoParam * params
Definition: element.h:54
const char * name
Definition: element.h:107
Describes Ports that the Component can use.
Definition: elibase.h:48
generateFunction func
Definition: element.h:119
const char * name
Definition: element.h:93
Definition: element.h:92
const struct ElementInfoGenerator * generators
Definition: element.h:142
const char * name
Definition: element.h:116