diff --git a/configure.ac b/configure.ac index 1d82c44024..8e76ddf7df 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ # # Set Version of SST Elements Library -AC_INIT([SST Elements Library], [-dev], [sst@sandia.gov]) +AC_INIT([SST Elements Library], [7.0.0], [sst@sandia.gov]) AC_PREREQ([2.59]) AC_COPYRIGHT([Copyright Sandia National Laboratories, 2004-2017]) diff --git a/src/sst/elements/pyproto/Makefile.am b/src/sst/elements/pyproto/Makefile.am deleted file mode 100644 index 2b71fe60fa..0000000000 --- a/src/sst/elements/pyproto/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# -*- Makefile -*- -# -# - -AM_CPPFLAGS = \ - $(PYTHON_CPPFLAGS) - -compdir = $(pkglibdir) -comp_LTLIBRARIES = libpyproto.la -libpyproto_la_SOURCES = \ - eli.cc \ - pyproto.h \ - pyproto.cc \ - pymodule.h \ - pymodule.cc \ - pyarchive.h \ - pyarchive.cc - - -libpyproto_la_LDFLAGS = -module -avoid-version \ - $(PYTHON_LDFLAGS) - diff --git a/src/sst/elements/pyproto/eli.cc b/src/sst/elements/pyproto/eli.cc deleted file mode 100644 index 4efba9904d..0000000000 --- a/src/sst/elements/pyproto/eli.cc +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2009-2017 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2017, Sandia Corporation -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#include "sst_config.h" - -#include "pyproto.h" - -#define SST_ELI_COMPILE_OLD_ELI_WITHOUT_DEPRECATION_WARNINGS - -#include "sst/core/element.h" - -extern "C" void* genPyProtoPyModule(void); - -using namespace SST; - -static Component* create_pyproto(SST::ComponentId_t id, SST::Params& params) -{ - return new PyProtoNS::PyProto(id, params); -} - - -static const ElementInfoParam pyProto_params[] = { - { NULL, NULL, NULL} -}; - -static const ElementInfoPort pyProto_ports[] = { - {"port%d", "Link to another object", NULL}, - {NULL, NULL, NULL} -}; - - -static const ElementInfoComponent pyProto_Components[] = { - { "PyProto", // Name - "Python Prototyping Component", // Description - NULL, // PrintHelp - create_pyproto, // Allocator - pyProto_params, // Parameters - pyProto_ports, // Ports - COMPONENT_CATEGORY_UNCATEGORIZED, // Category - NULL // Statistics - }, - { NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL} -}; - -extern "C" { - ElementLibraryInfo pyproto_eli = { - "pyproto", // Name - "Python-based Prototyping Library", // Description - pyProto_Components, // Components - NULL, // Events - NULL, // Introspectors - NULL, // Modules - NULL, // Subcomponents - NULL, // Partitioners - genPyProtoPyModule, // Python Module Generator - NULL // Generators - }; -} - - diff --git a/src/sst/elements/pyproto/example.py b/src/sst/elements/pyproto/example.py deleted file mode 100644 index 50f868f314..0000000000 --- a/src/sst/elements/pyproto/example.py +++ /dev/null @@ -1,71 +0,0 @@ -import sst -from sst.pyproto import * - - -class MyEvent(PyEvent): - def __init__(self, cycle, count): - PyEvent.__init__(self) - self.cycle = cycle - self.count = count - - def __str__(self): - return "{%d, %d}"%(self.cycle, self.count) - - -class MyObject(PyProto): - def __init__(self, name): - PyProto.__init__(self, name) - self.name = name - self.countdown = 10 - - self.addClock(self._clockHandle, "1MHz") - - def setPollLink(self, link): - self.myPollLink = self.addLink(link, "1us") - - def setActiveLink(self, link): - self.myActiveLink = self.addLink(link, "1us", self._linkHandle) - - def _linkHandle(self, event): - print self.name, "LinkHandle ", event - - def _clockHandle(self, cycle): - print self.name, "Clock ", cycle - ev = self.myPollLink.recv() - if ev: - print self.name, "Received on pollLink: ", ev - if 0 == (cycle % 10): - ev = MyEvent(cycle, self.countdown) - print self.name, "Sending event", ev - link = self.myPollLink if 0 == (self.countdown%2) else self.myActiveLink - link.send(ev) - self.countdown -= 1 - return (self.countdown == 0) - - def construct(self): - print self.name, "Construct()" - - def init(self, phase): - print self.name, "init(%d)"%phase - - def setup(self): - print self.name, "setup()" - - def finish(self): - print self.name, "finish()" - - - -link0 = sst.Link("Mylink0") -link1 = sst.Link("Mylink1") - - -alice = MyObject("Alice") -alice.setPollLink(link0) -alice.setActiveLink(link1) - -bob = MyObject("Bob") -bob.setPollLink(link0) -bob.setActiveLink(link1) - - diff --git a/src/sst/elements/pyproto/pyarchive.cc b/src/sst/elements/pyproto/pyarchive.cc deleted file mode 100644 index 12320db9aa..0000000000 --- a/src/sst/elements/pyproto/pyarchive.cc +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2009-2017 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2017, Sandia Corporation -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#include -#include - -#include - -#include -#include - -#include "pymodule.h" -#include "pyproto.h" - -#include "pyarchive.h" - -namespace SST { -namespace PyProtoNS { - -PyEvent_t *convertEventToPython(SST::Event *event) -{ - PyEvent *pe = dynamic_cast(event); - if ( pe ) { - return pe->getPyObj(); - } else { -#if 0 - PyEvent_t *out = NULL; - polymorphic_PyEvent_oarchive oa(std::cout, boost::archive::no_header|boost::archive::no_codecvt); - - oa << event; - - return oa.getEvent(); -#endif - } - return NULL; -} - - -} -} diff --git a/src/sst/elements/pyproto/pyarchive.h b/src/sst/elements/pyproto/pyarchive.h deleted file mode 100644 index 6d0b271604..0000000000 --- a/src/sst/elements/pyproto/pyarchive.h +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2009-2017 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2017, Sandia Corporation -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#include - -#include -#include -#include - -#include - -#include - - -#if 0 -#include -#include -#include -#endif - -#include "pymodule.h" -#include "pyproto.h" - -namespace SST { -namespace PyProtoNS { - -#if 0 -class PyEvent_oarchive : public boost::archive::detail::common_oarchive -{ - // permit serialization system privileged access to permit - // implementation of inline templates for maximum speed. - friend class boost::archive::detail::interface_oarchive; - friend class boost::archive::detail::polymorphic_oarchive_route; - friend class boost::archive::save_access; - - // member template for saving primitive types. - // Specialize for any types/templates that require special treatment - void save(const boost::archive::class_id_type & t) { } - void save(const boost::archive::class_id_optional_type & t) { } - void save(const boost::archive::tracking_type & t) { } - void save(const boost::archive::object_id_type & t) { } - void save(const boost::archive::version_type & t) { } - void save(const boost::archive::class_name_type & t) - { - //fprintf(stderr, "save of class_name_type called: %s\n", t.t); - if ( ! set_BaseName ) { - PyObject_SetAttrString((PyObject*)pyEvent, "type", PyString_FromString(t.t)); - } - set_BaseName = true; - } - - void setItem(PyObject *obj) - { - fprintf(stderr, "Setting %s\n", current_name.c_str()); - PyDict_SetItemString(pyEvent->dict, current_name.c_str(), obj); - } - - void save(const int & t) - { - setItem(PyInt_FromLong(t)); - } - - void save(const long & t) - { - setItem(PyLong_FromLong(t)); - } - - void save(const unsigned long & t) - { - setItem(PyLong_FromUnsignedLong(t)); - } - - void save(const long long & t) - { - setItem(PyLong_FromLongLong(t)); - } - - void save(const unsigned long long & t) - { - setItem(PyLong_FromUnsignedLongLong(t)); - } - - void save(const float & t) - { - setItem(PyFloat_FromDouble(t)); - } - - void save(const double & t) - { - setItem(PyFloat_FromDouble(t)); - } - - void save(const bool& t) - { - setItem(PyBool_FromLong(t)); - } - - void save(const std::string & t) - { - setItem(PyString_FromString(t.c_str())); - } - - template - void save(T & t) - { - fprintf(stderr, "Type [%s] (%s) needs an implementation!\n", - current_name.c_str(), typeid(T).name()); - } - - void buildCurrentName() - { - current_name = std::accumulate( stack.begin(), stack.end(), std::string(""), - [](const std::string &a, const std::string &b) { - return a.empty() ? b : (a + "::" + b); - }); - } - - - PyEvent_t *pyEvent; - std::vector stack; - std::string current_name; - bool set_BaseName; - -public: - template - PyEvent_oarchive( std::basic_ostream<_Elem, _Tr> & os, unsigned int flags) : boost::archive::detail::common_oarchive(flags) - { - PyObject *args = Py_BuildValue("()"); - pyEvent = (PyEvent_t*)PyObject_CallObject((PyObject*)getEventObject(), args); - Py_XDECREF(args); - - set_BaseName = false; - } - - virtual ~PyEvent_oarchive() - { - Py_XDECREF((PyObject*)pyEvent); - } - - /** Returns new reference */ - PyEvent_t* getEvent() - { - Py_XINCREF((PyObject*)pyEvent); - return pyEvent; - } - - - // archives are expected to support this function - void save_binary(const void *address, std::size_t count) - { - fprintf(stderr, "save_binary of %p[%zu] called\n", address, count); - } - - // Called before a save() - void save_start(char const *name) - { - //fprintf(stderr, "save_start(%s)\n", name); - if ( name ) - stack.push_back(name); - buildCurrentName(); - } - - void save_end(char const *name) - { - //fprintf(stderr, "save_end(%s)\n", name); - if ( name && !stack.empty() ) - stack.pop_back(); - buildCurrentName(); - } -}; - - - -typedef boost::archive::detail::polymorphic_oarchive_route polymorphic_PyEvent_oarchive; - -#endif -} -} - -#if 0 -BOOST_SERIALIZATION_REGISTER_ARCHIVE( - SST::PyProtoNS::polymorphic_PyEvent_oarchive -) - -#endif diff --git a/src/sst/elements/pyproto/pymodule.cc b/src/sst/elements/pyproto/pymodule.cc deleted file mode 100644 index b8c74f0ff8..0000000000 --- a/src/sst/elements/pyproto/pymodule.cc +++ /dev/null @@ -1,458 +0,0 @@ -// Copyright 2009-2017 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2017, Sandia Corporation -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#include -#include -#include - -#include - -#include - -#include "pymodule.h" -#include "pyproto.h" - -extern "C" { - -static PyMethodDef moduleMethods[] = { - { NULL, NULL, 0, NULL } -}; - -static int pyEvent_Init(PyEvent_t *self, PyObject *args, PyObject *kwds); -static void pyEvent_Dealloc(PyEvent_t *self); -static PyMethodDef pyEventMethods[] = { - { NULL, NULL, 0, NULL } -}; -static PyMemberDef pyEventMembers[] = { - { (char*)"type", T_OBJECT, offsetof(PyEvent_t, type), 0, (char*)"Type of Event"}, - { (char*)"sst", T_OBJECT, offsetof(PyEvent_t, dict), 0, (char*)"SST Event members"}, - { NULL, 0, 0, 0, NULL } -}; - -static PyTypeObject PyEventDef = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - "sst.pyproto.PyEvent", /* tp_name */ - sizeof(PyEvent_t), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)pyEvent_Dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ - "PyProto Event", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - pyEventMethods, /* tp_methods */ - pyEventMembers, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)pyEvent_Init, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ -}; - - - -static int pyLink_Init(PyLink_t *self, PyObject *args, PyObject *kwds); -static void pyLink_Dealloc(PyLink_t *self); -static PyObject* pyLink_recv(PyObject *self, PyObject *args); -static PyObject* pyLink_send(PyObject *self, PyObject *args); - - -static PyMethodDef pyLinkMethods[] = { - { "recv", pyLink_recv, METH_NOARGS, "Receive from a link"}, - { "send", pyLink_send, METH_VARARGS, "Send on a link"}, - { NULL, NULL, 0, NULL } -}; - - -static PyTypeObject PyLinkDef = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - "sst.pyproto.PyLink", /* tp_name */ - sizeof(PyLink_t), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)pyLink_Dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ - "PyProto Link", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - pyLinkMethods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)pyLink_Init, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ -}; - - - -static int pyProto_Init(PyProto_t *self, PyObject *args, PyObject *kwds); -static void pyProto_Dealloc(PyProto_t *self); -static PyObject* pyProto_addLink(PyObject *self, PyObject *args); -static PyObject* pyProto_addClock(PyObject *self, PyObject *args); -static PyObject* pyProto_construct(PyObject *self, PyObject *args); -static PyObject* pyProto_init(PyObject *self, PyObject *args); -static PyObject* pyProto_setup(PyObject *self, PyObject *args); -static PyObject* pyProto_finish(PyObject *self, PyObject *args); - -static PyMethodDef pyProtoMethods[] = { - { "addLink", pyProto_addLink, METH_VARARGS, "Add a Link"}, - { "addClock", pyProto_addClock, METH_VARARGS, "Add a clock handler"}, - { "construct", pyProto_construct, METH_NOARGS, "Called during Construction"}, - { "init", pyProto_init, METH_O, "Called during init"}, - { "setup", pyProto_setup, METH_NOARGS, "Called during setup"}, - { "finish", pyProto_finish, METH_NOARGS, "Called during finish"}, - { NULL, NULL, 0, NULL } -}; - -static PyTypeObject PyProtoDef = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - "sst.pyproto.PyProto", /* tp_name */ - sizeof(PyProto_t), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)pyProto_Dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ - "PyProto Prototype", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - pyProtoMethods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)pyProto_Init, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ -}; - - - -void* genPyProtoPyModule(void) -{ - // Must return a PyObject - - /* Initialize Types */ - PyEventDef.tp_new = PyType_GenericNew; - PyLinkDef.tp_new = PyType_GenericNew; - PyProtoDef.tp_new = PyType_GenericNew; - - if ( ( PyType_Ready(&PyEventDef) < 0 ) || - ( PyType_Ready(&PyLinkDef) < 0 ) || - ( PyType_Ready(&PyProtoDef) < 0 ) ) - SST::Output::getDefaultObject().fatal(CALL_INFO, -1, - "Failed to instantiate PyProto Python Module"); - - PyObject *module = Py_InitModule("sst.pyproto", moduleMethods); - if ( !module ) - SST::Output::getDefaultObject().fatal(CALL_INFO, -1, - "Failed to instantiate PyProto Python Module"); - -#if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif - Py_INCREF(&PyEventDef); - Py_INCREF(&PyLinkDef); - Py_INCREF(&PyProtoDef); -#if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#pragma GCC diagnostic pop -#endif - - PyModule_AddObject(module, "PyEvent", (PyObject*)&PyEventDef); - PyModule_AddObject(module, "PyLink", (PyObject*)&PyLinkDef); - PyModule_AddObject(module, "PyProto", (PyObject*)&PyProtoDef); - - Py_INCREF(module); /* Want to return a NEW reference */ - return module; -} - - - - - -/***** PyEvent *****/ - -static int pyEvent_Init(PyEvent_t *self, PyObject *args, PyObject *kwds) -{ - self->type = PyString_FromString("Python"); - self->dict = PyDict_New(); - PyErr_Print(); - return 0; -} - - -static void pyEvent_Dealloc(PyEvent_t *self) -{ - Py_XDECREF(self->type); - Py_XDECREF(self->dict); - self->ob_type->tp_free((PyObject*)self); -} - - - -/***** PyLink *****/ - -static int pyLink_Init(PyLink_t *self, PyObject *args, PyObject *kwds) -{ - char *p; - if ( !PyArg_ParseTuple(args, "Osn", - &self->object, &p, &self->portNumber) ) - return -1; - - self->portName = strdup(p); - Py_XINCREF(self->object); - - return 0; -} - - -static void pyLink_Dealloc(PyLink_t *self) -{ - Py_XDECREF(self->object); - free(self->portName); - self->ob_type->tp_free((PyObject*)self); -} - - -static PyObject* pyLink_recv(PyObject *self, PyObject *args) -{ - PyLink_t* l = (PyLink_t*)self; - SST::PyProtoNS::PyProto *p = (SST::PyProtoNS::PyProto*)((PyProto_t*)l->object)->component; - PyEvent_t *e = p->doLinkRecv(l->portNumber); - if ( e ) { - return (PyObject*)e; - } else { - Py_XINCREF(Py_None); - return Py_None; - } -} - -static PyObject* pyLink_send(PyObject *self, PyObject *args) -{ - PyLink_t* l = (PyLink_t*)self; - SST::PyProtoNS::PyProto *p = (SST::PyProtoNS::PyProto*)((PyProto_t*)l->object)->component; - - PyObject *event = NULL; - if ( !PyArg_ParseTuple(args, "O!", &PyEventDef, &event) ) - return NULL; - - Py_XINCREF(event); - p->doLinkSend(l->portNumber, (PyEvent_t*)event); - return PyInt_FromLong(0); -} - - - -/***** PyProto *****/ - -static int pyProto_Init(PyProto_t *self, PyObject *args, PyObject *kwds) -{ - char *name; - if ( !PyArg_ParseTuple(args, "s", &name) ) - return -1; - - self->name = strdup(name); - self->clocks = new PyProto_t::clockArray_t(); - self->links = new PyProto_t::linkArray_t(); - self->constructed = false; - - PyObject* sys_mod_dict = PyImport_GetModuleDict(); - PyObject* sst_mod = PyMapping_GetItemString(sys_mod_dict, (char*)"sst"); - self->tcomponent = PyObject_CallMethod(sst_mod, (char*)"Component", - (char*)"ss", self->name, (char*)"pyproto.PyProto"); - if ( !self->tcomponent ) - SST::Output::getDefaultObject().fatal(CALL_INFO, -1, - "Failed to load sst.Component\n"); - - SST::PyProtoNS::PyProto::addComponent(self); - - return 0; -} - -static void pyProto_Dealloc(PyProto_t *self) -{ - Py_XDECREF((PyObject*)self->tcomponent); - delete self->links; - delete self->clocks; - free(self->name); - self->ob_type->tp_free((PyObject*)self); -} - - - -static PyObject* pyProto_addLink(PyObject *self, PyObject *args) -{ - PyProto_t *pself = (PyProto_t*)self; - if ( pself->constructed ) { - SST::Output::getDefaultObject().fatal(CALL_INFO, -1, - "Cannot add a Link once construction complete."); - } - - PyObject *slink = NULL; - char *lat = NULL; - PyObject *cb = NULL; - if ( !PyArg_ParseTuple(args, "Os|O", &slink, &lat, &cb) ) { - return NULL; - } - - size_t pnum = pself->links->size(); - char port[16] = {0}; - snprintf(port, 15, "port%zu", pnum); - PyObject_CallMethod(pself->tcomponent, (char*)"addLink", - (char*)"Oss", slink, port, lat); - - /* Push the callback (or NULL) onto the stack */ - Py_XINCREF(cb); - pself->links->push_back(std::make_pair(port, cb)); - if ( (pnum+1) != pself->links->size() ) - SST::Output::getDefaultObject().fatal(CALL_INFO, -1, - "Looks like a threading bug!\n"); - - - /* Allocate new Python-facing object */ - PyObject* sys_mod_dict = PyImport_GetModuleDict(); - PyObject* module = PyMapping_GetItemString(sys_mod_dict, (char*)"sst.pyproto"); - PyObject *nlink = PyObject_CallMethod(module, (char*)"PyLink", - (char*)"Osn", pself, port, pnum); - - return nlink; -} - - -static PyObject* pyProto_addClock(PyObject *self, PyObject *args) -{ - PyProto_t *pself = (PyProto_t*)self; - if ( pself->constructed ) { - SST::Output::getDefaultObject().fatal(CALL_INFO, -1, - "Cannot add a clock once construction complete."); - } - - PyObject *cb = NULL; - char *freq = NULL; - - if ( !PyArg_ParseTuple(args, "Os", &cb, &freq) ) { - SST::Output::getDefaultObject().output("Bad arguments for function PyProto.addClock()\n"); - return NULL; - } - - Py_INCREF(cb); - pself->clocks->push_back(std::make_pair(cb, freq)); - - return PyInt_FromLong(0); -} - - -static PyObject* pyProto_construct(PyObject *self, PyObject *args) -{ - return PyInt_FromLong(0); -} - - -static PyObject* pyProto_init(PyObject *self, PyObject *args) -{ - return PyInt_FromLong(0); -} - - -static PyObject* pyProto_setup(PyObject *self, PyObject *args) -{ - return PyInt_FromLong(0); -} - - -static PyObject* pyProto_finish(PyObject *self, PyObject *args) -{ - return PyInt_FromLong(0); -} - - -} /* extern "C" */ - - -namespace SST { -namespace PyProtoNS { - PyTypeObject* getEventObject() { return &PyEventDef; } - PyTypeObject* getPyProtoObject() { return &PyProtoDef; } - PyTypeObject* getPyLinkObject() { return &PyLinkDef; } -} -} - - diff --git a/src/sst/elements/pyproto/pymodule.h b/src/sst/elements/pyproto/pymodule.h deleted file mode 100644 index 483d9edb63..0000000000 --- a/src/sst/elements/pyproto/pymodule.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2009-2017 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2017, Sandia Corporation -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#ifndef COMPONENTS_PYPROTO_PYMODULE_H -#define COMPONENTS_PYPROTO_PYMODULE_H - -extern "C" { - -void* genPyProtoPyModule(void); - - -struct PyEvent_t { - PyObject_HEAD; - PyObject *type; - PyObject *dict; /* Holds elements from Events */ -}; - - -struct PyLink_t { - PyObject_HEAD; - PyObject *object; /* PyProto Object */ - char *portName; - size_t portNumber; -}; - - -struct PyProto_t { - PyObject_HEAD; - char *name; - PyObject *tcomponent; - void *component; - - typedef std::vector > clockArray_t; - typedef std::vector > linkArray_t; - - clockArray_t *clocks; - linkArray_t *links; - bool constructed; - -}; - - -} - -namespace SST { -class Event; -namespace PyProtoNS { - PyEvent_t *convertEventToPython(SST::Event *event); - PyTypeObject* getEventObject(); - PyTypeObject* getPyProtoObject(); - PyTypeObject* getPyLinkObject(); -} -} - -#endif // COMPONENTS_PYPROTO_PYMODULE_H diff --git a/src/sst/elements/pyproto/pyproto.cc b/src/sst/elements/pyproto/pyproto.cc deleted file mode 100644 index 617e076778..0000000000 --- a/src/sst/elements/pyproto/pyproto.cc +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2009-2017 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2017, Sandia Corporation -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#include -#include - -#include - -#include "pyproto.h" -#include "pymodule.h" - - -namespace SST { -namespace PyProtoNS { - - -PyEvent::PyEvent(PyEvent_t *e) : SST::Event() -{ - pyE = e; - Py_XINCREF(pyE); -} - -PyEvent::~PyEvent() -{ - Py_XDECREF(pyE); -} - - - - -PyProto::PyProto(SST::ComponentId_t id, SST::Params ¶ms) : Component(id) -{ - if ( !Py_IsInitialized() ) { /* ERROR */ } - size_t idx = pyObjIdx++; - if ( idx >= pyObjects.size() ) - SST::Output::getDefaultObject().fatal(CALL_INFO, -1, - "PyProto has too many objects\n"); - - that = pyObjects[idx]; - Py_XINCREF(that); - that->component = this; - - /* Call subobject "construct" method */ - PyObject_CallMethod((PyObject*)that, (char*)"construct", (char*)""); - /* Load up links and clocks */ - - for ( auto c : (*that->clocks) ) { - PyObject *cb = c.first; - std::string &rate = c.second; - registerClock(rate, new Clock::Handler(this, &PyProto::clock, cb)); - } - - size_t numLinks = that->links->size(); - for ( size_t nl = 0 ; nl < numLinks ; nl++ ) { - std::string &port = that->links->at(nl).first; - PyObject *cb = that->links->at(nl).second; - - SST::Link *link = NULL; - if ( cb ) { - link = configureLink(port, new Event::Handler(this, &PyProto::linkAction, nl)); - } else { - link = configureLink(port); - } - links.push_back(link); - } - - - that->constructed = true; -} - - - -PyProto::~PyProto() -{ - Py_XDECREF(that); -} - - -void PyProto::init(unsigned int phase) -{ - PyObject *res = PyObject_CallMethod((PyObject*)that, (char*)"init", (char*)"I", phase); - Py_XDECREF(res); -} - - -void PyProto::setup() -{ - PyObject *res = PyObject_CallMethod((PyObject*)that, (char*)"setup", (char*)""); - Py_XDECREF(res); -} - - -void PyProto::finish() -{ - PyObject *res = PyObject_CallMethod((PyObject*)that, (char*)"finish", (char*)""); - Py_XDECREF(res); -} - - - -PyEvent_t* PyProto::doLinkRecv(size_t linkNum) -{ - PyEvent_t *res = NULL; - SST::Link *link = links.at(linkNum); - Event *event = link->recv(); - if ( event ) { - res = convertEventToPython(event); - delete event; - } - return res; -} - - -void PyProto::doLinkSend(size_t linkNum, PyEvent_t* pyEv) -{ - SST::Link *link = links.at(linkNum); - link->send(new PyEvent(pyEv)); -} - - -void PyProto::linkAction(Event *event, size_t linkNum) -{ - PyObject *cb = that->links->at(linkNum).second; - /* Translate the Event to a Python-readable thing */ - /* Do something with the callback */ - PyEvent_t *pe = convertEventToPython(event); - if ( pe ) { - PyObject *args = Py_BuildValue("(O)", pe); - PyObject *res = PyObject_CallObject(cb, args); - Py_XDECREF(res); - Py_XDECREF(pe); - } - delete event; -} - - -bool PyProto::clock(SST::Cycle_t cycle, PyObject *cb) -{ - PyObject *args = Py_BuildValue("(K)", cycle); - PyObject *res = PyObject_CallObject(cb, args); - if ( !res ) PyErr_Print(); - bool bres = (res && 1 == PyObject_IsTrue(res)); - Py_XDECREF(res); - return bres; -} - - - -std::vector PyProto::pyObjects; -std::atomic PyProto::pyObjIdx(0); - -} -} - diff --git a/src/sst/elements/pyproto/pyproto.h b/src/sst/elements/pyproto/pyproto.h deleted file mode 100644 index 3da2a9eb61..0000000000 --- a/src/sst/elements/pyproto/pyproto.h +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2009-2017 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2017, Sandia Corporation -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - -#ifndef COMPONENTS_PYPROTO_PYPROTO_H -#define COMPONENTS_PYPROTO_PYPROTO_H - -#include -#include -#include -#include -#include - -extern "C" struct PyEvent_t; -extern "C" struct PyProto_t; -extern "C" typedef struct _object PyObject; - -namespace SST { -namespace PyProtoNS { - -class PyEvent : public SST::Event -{ -public: - PyEvent(PyEvent_t *e); - ~PyEvent(); - - PyEvent_t* getPyObj() { return pyE; } - -private: - PyEvent_t *pyE; - PyEvent() {} // For serialization only - -public: - void serialize_order(SST::Core::Serialization::serializer &ser) override { - Event::serialize_order(ser); - // TODO: Serialize pyE - } - - ImplementSerializable(SST::PyProtoNS::PyEvent); -}; - - - -class PyProto : public SST::Component -{ -public: - PyProto(SST::ComponentId_t id, SST::Params& params); - ~PyProto(); - - virtual void init(unsigned int phase); - virtual void setup(); - virtual void finish(); - - static void addComponent(PyProto_t* obj) - { - pyObjects.push_back(obj); - } - - PyEvent_t* doLinkRecv(size_t linkNum); - void doLinkSend(size_t linkNum, PyEvent_t* pyEv); - - -protected: - bool clock(SST::Cycle_t cycle, PyObject *cb); - void linkAction(Event *event, size_t linkNum); - -private: - PyProto_t *that; /* The Python-space representation of this */ - std::vector links; - - static std::vector pyObjects; - static std::atomic pyObjIdx; -}; - - -} -} - -#endif diff --git a/src/sst/elements/pyproto/pyproto.py b/src/sst/elements/pyproto/pyproto.py deleted file mode 100644 index 77c84e44cd..0000000000 --- a/src/sst/elements/pyproto/pyproto.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2009-2017 Sandia Corporation. Under the terms -# of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -# Government retains certain rights in this software. -# -# Copyright (c) 2009-2017, Sandia Corporation -# All rights reserved. -# -# Portions are copyright of other developers: -# See the file CONTRIBUTORS.TXT in the top level directory -# the distribution for more information. -# -# This file is part of the SST software package. For license -# information, see the LICENSE file in the top level directory of the -# distribution. - -import sst - -class PyEvent(): - def __init__(self): - pass - - -class PyLink(): - def __init__(self, sstLink, latency, callback): - pass - def recv(self): - pass - def send(self, ev): - pass - - -class PyProto(): - def __init__(self, name): - pass - def addLink(self, link, latency, callback = None): - pass - def addClock(self, callback, rate): - pass - def construct(self): - pass - def init(self, phase): - pass - def setup(self): - pass - def finish(self): - pass - diff --git a/src/sst/elements/pyproto/tests/basic.py b/src/sst/elements/pyproto/tests/basic.py deleted file mode 100644 index 50f868f314..0000000000 --- a/src/sst/elements/pyproto/tests/basic.py +++ /dev/null @@ -1,71 +0,0 @@ -import sst -from sst.pyproto import * - - -class MyEvent(PyEvent): - def __init__(self, cycle, count): - PyEvent.__init__(self) - self.cycle = cycle - self.count = count - - def __str__(self): - return "{%d, %d}"%(self.cycle, self.count) - - -class MyObject(PyProto): - def __init__(self, name): - PyProto.__init__(self, name) - self.name = name - self.countdown = 10 - - self.addClock(self._clockHandle, "1MHz") - - def setPollLink(self, link): - self.myPollLink = self.addLink(link, "1us") - - def setActiveLink(self, link): - self.myActiveLink = self.addLink(link, "1us", self._linkHandle) - - def _linkHandle(self, event): - print self.name, "LinkHandle ", event - - def _clockHandle(self, cycle): - print self.name, "Clock ", cycle - ev = self.myPollLink.recv() - if ev: - print self.name, "Received on pollLink: ", ev - if 0 == (cycle % 10): - ev = MyEvent(cycle, self.countdown) - print self.name, "Sending event", ev - link = self.myPollLink if 0 == (self.countdown%2) else self.myActiveLink - link.send(ev) - self.countdown -= 1 - return (self.countdown == 0) - - def construct(self): - print self.name, "Construct()" - - def init(self, phase): - print self.name, "init(%d)"%phase - - def setup(self): - print self.name, "setup()" - - def finish(self): - print self.name, "finish()" - - - -link0 = sst.Link("Mylink0") -link1 = sst.Link("Mylink1") - - -alice = MyObject("Alice") -alice.setPollLink(link0) -alice.setActiveLink(link1) - -bob = MyObject("Bob") -bob.setPollLink(link0) -bob.setActiveLink(link1) - - diff --git a/src/sst/elements/pyproto/tests/convertFromSST.py b/src/sst/elements/pyproto/tests/convertFromSST.py deleted file mode 100644 index 5384a904db..0000000000 --- a/src/sst/elements/pyproto/tests/convertFromSST.py +++ /dev/null @@ -1,50 +0,0 @@ -import sst -from sst.pyproto import * - - -sst.setProgramOption("stopAtCycle", "10s") - - -class MyObject(PyProto): - def __init__(self, name): - PyProto.__init__(self, name) - self.name = name - self.countdown = 10 - - def setActiveLink(self, link): - self.myActiveLink = self.addLink(link, "1us", self._linkHandle) - - def _linkHandle(self, event): - print self.name, "LinkHandle %s"%event.type - print self.name, "LinkHandle: ", event.sst - - - def construct(self): - print self.name, "Construct()" - - def init(self, phase): - print self.name, "init(%d)"%phase - - def setup(self): - print self.name, "setup()" - - def finish(self): - print self.name, "finish()" - - - -link0 = sst.Link("Mylink0") - -comp_msgGen0 = sst.Component("msgGen0", "simpleElementExample.simpleMessageGeneratorComponent") -comp_msgGen0.addParams({ - "outputinfo" : 1, - "sendcount" : 1, - "clock" : "1MHz" -}) -comp_msgGen0.addLink(link0, "remoteComponent", "10us") - -alice = MyObject("Alice") -alice.setActiveLink(link0) - - - diff --git a/src/sst/elements/savannah/Makefile.am b/src/sst/elements/savannah/Makefile.am deleted file mode 100644 index f689e4fa86..0000000000 --- a/src/sst/elements/savannah/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ - -AM_CPPFLAGS = \ - $(MPI_CPPFLAGS) \ - -I$(top_srcdir)/src - -compdir = $(pkglibdir) -comp_LTLIBRARIES = libsavannah.la - -libsavannah_la_SOURCES = \ - libsavannah.cpp \ - savarb.h \ - savcomp.cc \ - savcomp.h \ - savevent.h \ - arbitrator/savfifoarb.h - -EXTRA_DIST = - -libsavannah_la_LDFLAGS = -module -avoid-version diff --git a/src/sst/elements/savannah/arbitrator/savfifoarb.h b/src/sst/elements/savannah/arbitrator/savfifoarb.h deleted file mode 100644 index 73f9bc1af1..0000000000 --- a/src/sst/elements/savannah/arbitrator/savfifoarb.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2009-2017 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2017, Sandia Corporation -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#ifndef _H_SST_SAVANNAH_IN_ORDER_ARB -#define _H_SST_SAVANNAH_IN_ORDER_ARB - -#include -#include - -namespace SST { -namespace Savannah { - -class SavannahInOrderArbitrator : public SavannahIssueArbitrator { -public: - SavannahInOrderArbitrator(Component* comp, Params& params) : - SavannahIssueArbitrator(comp, params) { - - const int verbose = params.find("verbose"); - output = new SST::Output("SavannahFIFOArb[@p:@l]: ", - verbose, 0, SST::Output::STDOUT); - - maxIssuePerCycle = params.find("max_issue_per_cycle"); - } - - ~SavannahInOrderArbitrator() { - delete output; - } - - void issue(std::queue& q, MemBackend* backend) { - - } - -private: - uint32_t maxIssuePerCycle; - Output* output; - -}; - -} -} - -#endif diff --git a/src/sst/elements/savannah/libsavannah.cpp b/src/sst/elements/savannah/libsavannah.cpp deleted file mode 100644 index 2a5634be91..0000000000 --- a/src/sst/elements/savannah/libsavannah.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2009-2017 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2017, Sandia Corporation -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#include - -#define SST_ELI_COMPILE_OLD_ELI_WITHOUT_DEPRECATION_WARNINGS - -#include "sst/core/element.h" -#include "sst/core/component.h" - -#include "savcomp.h" -#include "savarb.h" -#include "arbitrator/savfifoarb.h" - -using namespace SST; -using namespace SST::Savannah; - -static Component* create_SavannahComponent(ComponentId_t id, Params& params) { - return new SavannahComponent(id, params); -} - -static SubComponent* create_InOrderArbitrator(Component* comp, Params& params) { - return new SavannahInOrderArbitrator(comp, params); -} - -static const ElementInfoParam savannah_params[] = { - { NULL, NULL, NULL } -}; - -static const ElementInfoSubComponent subcomponents[] = { - { - "InOrderArbitrator", - "First-in, First-out request issue", - NULL, - create_InOrderArbitrator, - NULL, // params - NULL, // Statistics - "SST::Savannah::SavannahRequestArbitrator" - }, - { NULL, NULL, NULL, NULL, NULL, NULL } -}; - -static const ElementInfoComponent components[] = { - { - "SavannahComponent", - "Multi-point Memory Controller and Request Arbitration", - NULL, - create_SavannahComponent, - savannah_params, -// prospero_ports, - NULL, - COMPONENT_CATEGORY_MEMORY - }, - { NULL, NULL, NULL, NULL, NULL, NULL, 0 } -}; - -extern "C" { - ElementLibraryInfo savannah_eli = { - "savannah", - "Multi-point Memory Connectors", - components, - NULL, // Events - NULL, // Introspectors - NULL, // Modules - subcomponents, - NULL, - NULL - }; -} - diff --git a/src/sst/elements/savannah/savarb.h b/src/sst/elements/savannah/savarb.h deleted file mode 100644 index f6f588d363..0000000000 --- a/src/sst/elements/savannah/savarb.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2009-2017 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2017, Sandia Corporation -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#ifndef _H_SST_SAVANNAH_ARBITRATOR -#define _H_SST_SAVANNAH_ARBITRATOR - -#include -#include - -#include - -#include "savevent.h" - -using namespace SST::MemHierarchy; - -namespace SST { -namespace Savannah { - -class SavannahIssueArbitrator : public SST::SubComponent { -public: - SavannahIssueArbitrator(Component* comp, Params& params) : SubComponent(comp) {} - ~SavannahIssueArbitrator() {} - virtual void issue(std::queue& q, MemBackend* backend) = 0; -}; - -} -} - -#endif diff --git a/src/sst/elements/savannah/savcomp.cc b/src/sst/elements/savannah/savcomp.cc deleted file mode 100644 index 9c64d3c63b..0000000000 --- a/src/sst/elements/savannah/savcomp.cc +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2009-2017 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2017, Sandia Corporation -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#include -#include - -using namespace SST; -using namespace SST::Savannah; - -#if 0 -bool SavannahComponent::tick(Cycle_t cycle) { - // Poll each link ONCE for a new pending event - for(uint32_t i = 0; i < incomingLinkCount; i++) { - Event* ev = incomingLinks[i]->recv(); - - // NULL if nothing on the link to recv - if(NULL == ev) { - SavannahRequestEvent* savEv = dynamic_cast(ev); - reqQueue.push(savEv); - - // Set the link we are polling event from - savEv->setLink(i); - - linkRequestMap.insert(std::pair(savEv->getRequestPtr(), savEv)); - } - } - - // Provide queue and backend to arbitrator to decide how to issue requests - arbitrator->issue(reqQueue, backend_); - - // Keep ticking me - return false; -} - -void SavannahComponent::handleMemResponse(DRAMReq* resp) { - std::map::iterator respMatch = - linkRequestMap.find(resp); - - if(linkRequestMap.end() == respMatch) { - // Not found. - output->fatal(CALL_INFO, -1, "Response was not found in request table.\n"); - } - - // Find the link and then return to the caller - SavannahRequestEvent* respEv = respMatch->second; - incomingLinks[respEv->getLink()]->send(respEv); -} -#endif - -SavannahComponent::SavannahComponent(ComponentId_t id, Params ¶ms) : - Component(id) { - -#if 0 - const int verbose = params.find("verbose", 0); - output = new SST::Output("Savannah[@p:@l]: ", - verbose, 0, SST::Output::STDOUT); - - std::string backend = params.find("backend", "memHierarchy.simpleMem"); - output->verbose(CALL_INFO, 1, 0, "Loading backend: %s ...\n", backend.c_str()); - - Params backendParams = params.find_prefix_params("backend."); - backend_ = static_cast(loadSubComponent(backend, this, backendParams)); - - if(NULL == backend_) { - output->fatal(CALL_INFO, -1, "Error: unable to load backend %s.\n", - backend.c_str()); - } else { - output->verbose(CALL_INFO, 1, 0, "Backend loaded successfully.\n"); - } - - std::string arbModule = params.find("arbitrator", "savannah.SavannahFIFOArbitrator"); - Params arbParams = params.find_prefix_params("arbitrator."); - - output->verbose(CALL_INFO, 1, 0, "Loading arbitrator: %s ...\n", arbModule.c_str()); - arbitrator = static_cast(loadSubComponent(arbModule, this, arbParams)); - if(NULL == arbitrator) { - output->fatal(CALL_INFO, -1, "Error: unable to load arbitrator: %s\n", arbModule.c_str()); - } else { - output->verbose(CALL_INFO, 1, 0, "Loaded arbitrator (%s) successfully.\n", arbModule.c_str()); - } - - incomingLinkCount = (uint32_t) params.find("link_count", 0); - output->verbose(CALL_INFO, 1, 0, "Will search for %" PRIu32 " links.", incomingLinkCount); - - incomingLinks = (SST::Link**) malloc( sizeof(SST::Link*) * incomingLinkCount); - char* linkNameBuffer = (char*) malloc( sizeof(char) * 128 ); - - for(uint32_t i = 0; i < incomingLinkCount; i++) { - sprintf(linkNameBuffer, "link%" PRIu32, i); - incomingLinks[i] = configureLink(linkNameBuffer); - - if(NULL == incomingLinks[i]) { - output->fatal(CALL_INFO, -1, "Link: %s could not be configured.\n", - linkNameBuffer); - } - } - - free(linkNameBuffer); - - output->verbose(CALL_INFO, 1, 0, "Link configuration completed.\n"); - - std::string pollClock = params.find("clock", "625MHz"); - output->verbose(CALL_INFO, 1, 0, "Register clock at %s\n", pollClock.c_str()); - registerClock( pollClock, new Clock::Handler(this, &SavannahComponent::tick) ); - output->verbose(CALL_INFO, 1, 0, "Clock registration done.\n"); - - // Tell user we are all done - output->verbose(CALL_INFO, 1, 0, "Initialization of Savannah complete.\n"); -#endif -} - -#if 0 -SavannahComponent::~SavannahComponent() { - delete backend_; - delete output; -} -#endif diff --git a/src/sst/elements/savannah/savcomp.h b/src/sst/elements/savannah/savcomp.h deleted file mode 100644 index 592581bcee..0000000000 --- a/src/sst/elements/savannah/savcomp.h +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2009-2017 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2017, Sandia Corporation -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#ifndef _H_SST_SAVANNAH_COMP_H -#define _H_SST_SAVANNAH_COMP_H - -#include -#include -#include -#include -#include - -#include "sst/elements/memHierarchy/memoryController.h" -#include "sst/elements/memHierarchy/membackend/memBackend.h" -#if 0 -#include "sst/elements/memHierarchy/memResponseHandler.h" -#include "sst/elements/memHierarchy/DRAMReq.h" -#endif - -#include "savarb.h" -#include "savevent.h" - -using namespace SST; -using namespace SST::MemHierarchy; - -namespace SST { -namespace Savannah { - -class SavannahComponent : public SST::Component { -#if 0 -class SavannahComponent : public SST::Component, public MemResponseHandler { -#endif - -public: - SavannahComponent(ComponentId_t id, Params ¶ms); - void handleIncomingEvent(SST::Event* ev); - bool tick(Cycle_t cycle); -#if 0 - virtual void handleMemResponse(DRAMReq* resp); - ~SavannahComponent(); - -private: - SavannahComponent(); // Serialization Only - SavannahComponent(const SavannahComponent&); // Do not impl. - void operator=(const SavannahComponent&); // Do not impl. - - SST::Link** incomingLinks; - SavannahIssueArbitrator* arbitrator; - std::map linkRequestMap; - std::queue reqQueue; - - uint32_t incomingLinkCount; - Output* output; - MemBackend* backend_; -#endif -}; - -} -} - -#endif diff --git a/src/sst/elements/savannah/savevent.h b/src/sst/elements/savannah/savevent.h deleted file mode 100644 index e77026e806..0000000000 --- a/src/sst/elements/savannah/savevent.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2009-2017 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2017, Sandia Corporation -// All rights reserved. -// -// Portions are copyright of other developers: -// See the file CONTRIBUTORS.TXT in the top level directory -// the distribution for more information. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#ifndef _H_SST_SAVANNAH_EVENT -#define _H_SST_SAVANNAH_EVENT - -#include "sst/elements/memHierarchy/memoryController.h" -#include "sst/elements/memHierarchy/membackend/memBackend.h" -#if 0 -#include "sst/elements/memHierarchy/DRAMReq.h" -#endif - -using namespace SST::MemHierarchy; - -namespace SST { -namespace Savannah { - -class SavannahRequestEvent : public SST::Event { -public: -#if 0 - SavannahRequestEvent(DRAMReq& req) : - request(req) { - - recvLink = 0; - }; - - DRAMReq& getRequest() { - return request; - } - - DRAMReq* getRequestPtr() { - return &request; - } - - uint32_t getLink() const { - return recvLink; - } - - void setLink(const uint32_t linkID) { - recvLink = linkID; - } - -private: - DRAMReq request; - uint32_t recvLink; -#endif -}; - -} -} - -#endif diff --git a/src/sst/elements/vanadis/Makefile.am b/src/sst/elements/vanadis/Makefile.am deleted file mode 100644 index b7ef6f3bc3..0000000000 --- a/src/sst/elements/vanadis/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ - -AM_CPPFLAGS = \ - $(MPI_CPPFLAGS) - -compdir = $(pkglibdir) -comp_LTLIBRARIES = libvanadis.la -libvanadis_la_SOURCES = - -libvanadis_la_LDFLAGS = -module -avoid-version