Skip to content

Commit

Permalink
Added simple ember examples
Browse files Browse the repository at this point in the history
  • Loading branch information
nab880 committed Nov 7, 2024
1 parent 48cbb8c commit a54104c
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/sst/elements/ember/mpi/motifs/emberexample.cc
Original file line number Diff line number Diff line change
@@ -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 <sst_config.h>
#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<EmberEvent*>& evQ)
{
return true;
}
51 changes: 51 additions & 0 deletions src/sst/elements/ember/mpi/motifs/emberexample.h
Original file line number Diff line number Diff line change
@@ -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<EmberEvent*>& evQ);
};

}
}

#endif /* _H_EMBER_EXAMPLE */
66 changes: 66 additions & 0 deletions src/sst/elements/ember/test/example.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit a54104c

Please sign in to comment.