From a54104cee0d3d587248bad21dcc80061c3f913ba Mon Sep 17 00:00:00 2001 From: nab880 Date: Wed, 6 Nov 2024 16:11:22 -0800 Subject: [PATCH] Added simple ember examples --- .../elements/ember/mpi/motifs/emberexample.cc | 30 +++++++++ .../elements/ember/mpi/motifs/emberexample.h | 51 ++++++++++++++ src/sst/elements/ember/test/example.py | 66 +++++++++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 src/sst/elements/ember/mpi/motifs/emberexample.cc create mode 100644 src/sst/elements/ember/mpi/motifs/emberexample.h create mode 100644 src/sst/elements/ember/test/example.py diff --git a/src/sst/elements/ember/mpi/motifs/emberexample.cc b/src/sst/elements/ember/mpi/motifs/emberexample.cc new file mode 100644 index 0000000000..44ff6eceab --- /dev/null +++ b/src/sst/elements/ember/mpi/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; +using namespace SST::Ember; + +ExampleGenerator::ExampleGenerator(SST::ComponentId_t id, Params& params) : + EmberMessagePassingGenerator(id, params, "Null" ) +{ +} + +bool ExampleGenerator::generate( std::queue& evQ) +{ + return true; +} diff --git a/src/sst/elements/ember/mpi/motifs/emberexample.h b/src/sst/elements/ember/mpi/motifs/emberexample.h new file mode 100644 index 0000000000..a11e8a9a37 --- /dev/null +++ b/src/sst/elements/ember/mpi/motifs/emberexample.h @@ -0,0 +1,51 @@ +// 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 ExampleGenerator : public EmberMessagePassingGenerator { + +public: + + SST_ELI_REGISTER_SUBCOMPONENT( + ExampleGenerator, + "ember", + "ExampleMotif", + SST_ELI_ELEMENT_VERSION(1,0,0), + "Performs an idle cycle on the node, no traffic is generated.", + SST::Ember::EmberGenerator + ) + + SST_ELI_DOCUMENT_PARAMS( + { "arg.messageSize", "Sets the size of exchange", "1"}, + ); + + SST_ELI_DOCUMENT_STATISTICS( + ); + + ExampleGenerator(SST::ComponentId_t id, Params& params); + bool generate( std::queue& evQ); +}; + +} +} + +#endif /* _H_EMBER_EXAMPLE */ diff --git a/src/sst/elements/ember/test/example.py b/src/sst/elements/ember/test/example.py new file mode 100644 index 0000000000..7afef58d45 --- /dev/null +++ b/src/sst/elements/ember/test/example.py @@ -0,0 +1,66 @@ +#!/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.nic.nic2host_lat = "100ns" + ep.addMotif("Example") + system = System() + system.setTopology(topo) + system.allocateNodes(ep, "linear") + + system.build() + + +if __name__ == "__main__": + example()