diff --git a/src/sst/elements/ember/Makefile.am b/src/sst/elements/ember/Makefile.am index ab907fd870..bf75971bd6 100644 --- a/src/sst/elements/ember/Makefile.am +++ b/src/sst/elements/ember/Makefile.am @@ -12,6 +12,8 @@ compdir = $(pkglibdir) comp_LTLIBRARIES = libember.la libember_la_SOURCES = \ + example/motifs/emberexample.h \ + example/motifs/emberexample.cc \ embergen.h \ embergen.cc \ embermap.h \ diff --git a/src/sst/elements/ember/example/example.py b/src/sst/elements/ember/example/example.py new file mode 100644 index 0000000000..98a673522e --- /dev/null +++ b/src/sst/elements/ember/example/example.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# +# Copyright 2009-2022 NTESS. Under the terms +# of Contract DE-NA0003525 with NTESS, the U.S. +# Government retains certain rights in this software. +# +# Copyright (c) 2009-2022, NTESS +# All rights reserved. +# +# 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 +from sst.merlin.base import * +from sst.merlin.endpoint import * +from sst.merlin.interface import * +from sst.merlin.topology import * +from sst.ember import * + + +def example(): + PlatformDefinition.setCurrentPlatform("firefly-defaults") + + # Setup the topology + topo = topoDragonFly() + topo.hosts_per_router = 2 + topo.routers_per_group = 4 + topo.intergroup_links = 2 + topo.num_groups = 4 + topo.algorithm = ["minimal", "adaptive-local"] + + # Set up the routers + router = hr_router() + router.link_bw = "4GB/s" + router.flit_size = "8B" + router.xbar_bw = "6GB/s" + router.input_latency = "20ns" + router.output_latency = "20ns" + router.input_buf_size = "4kB" + router.output_buf_size = "4kB" + router.num_vns = 2 + router.xbar_arb = "merlin.xbar_arb_lru" + + topo.router = router + topo.link_latency = "20ns" + + # set up the endpoint + networkif = ReorderLinkControl() + networkif.link_bw = "4GB/s" + networkif.input_buf_size = "1kB" + networkif.output_buf_size = "1kB" + + ep = EmberMPIJob(0, topo.getNumNodes()) + ep.network_interface = networkif + ep.addMotif("Example") + ep.nic.nic2host_lat = "100ns" + + system = System() + system.setTopology(topo) + system.allocateNodes(ep, "linear") + + system.build() + + +if __name__ == "__main__": + example() diff --git a/src/sst/elements/ember/example/motifs/emberexample.cc b/src/sst/elements/ember/example/motifs/emberexample.cc new file mode 100644 index 0000000000..82a5f40078 --- /dev/null +++ b/src/sst/elements/ember/example/motifs/emberexample.cc @@ -0,0 +1,30 @@ +// Copyright 2009-2022 NTESS. Under the terms +// of Contract DE-NA0003525 with NTESS, the U.S. +// Government retains certain rights in this software. +// +// Copyright (c) 2009-2022, NTESS +// All rights reserved. +// +// Portions are copyright of other developers: +// See the file CONTRIBUTORS.TXT in the top level directory +// of 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 "emberexample.h" + +using namespace SST::Ember; + +Example::Example(SST::ComponentId_t id, Params& params) : + EmberMessagePassingGenerator(id, params, "Null" ) +{ +} + +bool Example::generate( std::queue& evQ) +{ + return true; +} diff --git a/src/sst/elements/ember/example/motifs/emberexample.h b/src/sst/elements/ember/example/motifs/emberexample.h new file mode 100644 index 0000000000..7312a342ba --- /dev/null +++ b/src/sst/elements/ember/example/motifs/emberexample.h @@ -0,0 +1,70 @@ +// Copyright 2009-2022 NTESS. Under the terms +// of Contract DE-NA0003525 with NTESS, the U.S. +// Government retains certain rights in this software. +// +// Copyright (c) 2009-2022, NTESS +// All rights reserved. +// +// Portions are copyright of other developers: +// See the file CONTRIBUTORS.TXT in the top level directory +// of 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_EMBER_EXAMPLE +#define _H_EMBER_EXAMPLE + +#include "../../mpi/embermpigen.h" + +namespace SST { +namespace Ember { + +class Example : public EmberMessagePassingGenerator { + public: + + SST_ELI_REGISTER_SUBCOMPONENT_DERIVED( + Example, + "ember", + "ExampleMotif", + SST_ELI_ELEMENT_VERSION(1,0,0), + "Performs an idle on the node, no traffic can be generated.", + SST::Ember::EmberGenerator + ); + + SST_ELI_DOCUMENT_PARAMS( + ); + + SST_ELI_DOCUMENT_STATISTICS( + { "time-Init", "Time spent in Init event", "ns", 0}, + { "time-Finalize", "Time spent in Finalize event", "ns", 0}, + { "time-Rank", "Time spent in Rank event", "ns", 0}, + { "time-Size", "Time spent in Size event", "ns", 0}, + { "time-Send", "Time spent in Recv event", "ns", 0}, + { "time-Recv", "Time spent in Recv event", "ns", 0}, + { "time-Irecv", "Time spent in Irecv event", "ns", 0}, + { "time-Isend", "Time spent in Isend event", "ns", 0}, + { "time-Wait", "Time spent in Wait event", "ns", 0}, + { "time-Waitall", "Time spent in Waitall event", "ns", 0}, + { "time-Waitany", "Time spent in Waitany event", "ns", 0}, + { "time-Compute", "Time spent in Compute event", "ns", 0}, + { "time-Barrier", "Time spent in Barrier event", "ns", 0}, + { "time-Alltoallv", "Time spent in Alltoallv event", "ns", 0}, + { "time-Alltoall", "Time spent in Alltoall event", "ns", 0}, + { "time-Allreduce", "Time spent in Allreduce event", "ns", 0}, + { "time-Reduce", "Time spent in Reduce event", "ns", 0}, + { "time-Bcast", "Time spent in Bcast event", "ns", 0}, + { "time-Gettime", "Time spent in Gettime event", "ns", 0}, + { "time-Commsplit", "Time spent in Commsplit event", "ns", 0}, + { "time-Commcreate", "Time spent in Commcreate event", "ns", 0}, + ); + + Example(SST::ComponentId_t id, Params& params); + bool generate( std::queue& evQ); +}; + +} +} + +#endif /* _H_EMBER_EXAMPLE */