Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sst/elements/iris/sumi/sim_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class SimTransport : public Transport, public SST::Hg::Library {

int* nidlist() const override;

void incomingEvent(SST::Event *ev);
void incomingEvent(SST::Event *ev) override;

void compute(SST::Hg::TimeDelta t);

Expand Down
1 change: 0 additions & 1 deletion src/sst/elements/mask-mpi/mpi_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ Questions? Contact [email protected]
#include <sst/core/params.h>
#include <sst/core/factory.h>
#include <mercury/components/operating_system_fwd.h>
#include <mercury/operating_system/libraries/event_library.h>
#include <mercury/operating_system/libraries/library.h>
#include <mercury/operating_system/process/software_id.h>
#include <iris/sumi/message_fwd.h>
Expand Down
3 changes: 0 additions & 3 deletions src/sst/elements/mercury/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ libhg_la_SOURCES = \
operating_system/launch/app_launch_request.cc \
operating_system/launch/app_launcher.cc \
operating_system/libraries/library.cc \
operating_system/libraries/event_library.cc \
operating_system/libraries/unblock_event.cc \
operating_system/process/app.cc \
operating_system/process/global.cc \
Expand Down Expand Up @@ -167,9 +166,7 @@ nobase_library_include_HEADERS = \
operating_system/launch/app_launcher.h \
operating_system/launch/app_launcher_fwd.h \
operating_system/launch/app_launch_request.h \
operating_system/libraries/event_library_fwd.h \
operating_system/libraries/service_fwd.h \
operating_system/libraries/event_library.h \
operating_system/libraries/service.h \
operating_system/libraries/library.h \
operating_system/libraries/library_fwd.h \
Expand Down
7 changes: 3 additions & 4 deletions src/sst/elements/mercury/components/operating_system_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <mercury/components/node_base_fwd.h>
#include <mercury/operating_system/process/thread_info.h>
#include <mercury/operating_system/process/mutex.h>
#include <mercury/operating_system/libraries/event_library_fwd.h>
#include <mercury/hardware/network/network_message.h>

#include <cstdint>
Expand Down Expand Up @@ -114,11 +113,11 @@ class OperatingSystemAPI : public SST::Hg::SubComponent {

virtual condition_t *getCondition(int id) = 0;

virtual EventLibrary *eventLibrary(const std::string &name) const = 0;
virtual Library *eventLibrary(const std::string &name) const = 0;

virtual void registerEventLib(EventLibrary *lib) = 0;
virtual void registerEventLib(Library *lib) = 0;

virtual void unregisterEventLib(EventLibrary *lib) = 0;
virtual void unregisterEventLib(Library *lib) = 0;

virtual void handleRequest(Request *req) = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ bool eraseCondition(int id) override {
return OperatingSystemImpl::eraseCondition(id);
}

EventLibrary *eventLibrary(const std::string &name) const override {
Library *eventLibrary(const std::string &name) const override {
return OperatingSystemImpl::eventLibrary(name);
}

void registerEventLib(EventLibrary *lib) override {
void registerEventLib(Library *lib) override {
OperatingSystemImpl::registerEventLib(lib);
}

void unregisterEventLib(EventLibrary *lib) override {
void unregisterEventLib(Library *lib) override {
OperatingSystemImpl::unregisterEventLib(lib);
}

Expand Down
12 changes: 6 additions & 6 deletions src/sst/elements/mercury/components/operating_system_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <mercury/operating_system/launch/app_launcher.h>
#include <mercury/operating_system/libraries/unblock_event.h>
#include <mercury/operating_system/process/app.h>
#include <mercury/operating_system/libraries/event_library.h>
#include <mercury/operating_system/libraries/library.h>
#include <mercury/operating_system/libraries/unblock_event.h>
#include <mercury/operating_system/process/thread_id.h>
#include <mercury/operating_system/threading/stack_alloc.h>
Expand Down Expand Up @@ -385,7 +385,7 @@ OperatingSystemImpl::eraseCondition(int id)
}
}

EventLibrary*
Library*
OperatingSystemImpl::eventLibrary(const std::string& name) const
{
auto it = libs_.find(name);
Expand All @@ -397,7 +397,7 @@ OperatingSystemImpl::eventLibrary(const std::string& name) const
}

void
OperatingSystemImpl::registerEventLib(EventLibrary* lib)
OperatingSystemImpl::registerEventLib(Library* lib)
{
#if SST_HG_SANITY_CHECK
if (lib->libName() == "") {
Expand All @@ -416,14 +416,14 @@ OperatingSystemImpl::registerEventLib(EventLibrary* lib)
for (Request *req : reqs) {
out_->debug(CALL_INFO, 1, 0, "delivering delayed event to lib %s: %s\n",
lib->libName().c_str(), toString(req).c_str());
os_api_->sendExecutionEventNow(newCallback(lib, &EventLibrary::incomingRequest, req));
os_api_->sendExecutionEventNow(newCallback(lib, &Library::incomingRequest, req));
}
pending_library_request_.erase(iter);
}
}

void
OperatingSystemImpl::unregisterEventLib(EventLibrary *lib) {
OperatingSystemImpl::unregisterEventLib(Library *lib) {
out_->debug(CALL_INFO, 1, 0, "unregistering lib %s\n",
lib->libName().c_str());
int &refcount = lib_refcounts_[lib];
Expand Down Expand Up @@ -512,7 +512,7 @@ OperatingSystemImpl::handleEventLibraryRequest(const std::string& name, Request*
auto it = libs_.find(name);
bool found = it != libs_.end();
if (found){
EventLibrary* lib = it->second;
Library* lib = it->second;
out_->debug(CALL_INFO, 1, 0, "delivering message to event lib %s:%p: %s\n",
name.c_str(), lib, toString(req).c_str());
lib->incomingRequest(req);
Expand Down
10 changes: 5 additions & 5 deletions src/sst/elements/mercury/components/operating_system_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ class OperatingSystemImpl {

bool eraseCondition(int id);

EventLibrary* eventLibrary(const std::string& name) const;
Library* eventLibrary(const std::string& name) const;

void registerEventLib(EventLibrary* lib);
void registerEventLib(Library* lib);

void unregisterEventLib(EventLibrary* lib);
void unregisterEventLib(Library* lib);

void handleRequest(Request* req);

Expand Down Expand Up @@ -183,8 +183,8 @@ class OperatingSystemImpl {

std::map<std::string, Library*> internal_apis_;
std::list<AppLaunchRequest*> requests_;
std::unordered_map<std::string, EventLibrary*> libs_;
std::unordered_map<EventLibrary*, int> lib_refcounts_;
std::unordered_map<std::string, Library*> libs_;
std::unordered_map<Library*, int> lib_refcounts_;
std::map<std::string, std::list<Request*>> pending_library_request_;

void initThreading(SST::Params& params);
Expand Down

This file was deleted.

100 changes: 0 additions & 100 deletions src/sst/elements/mercury/operating_system/libraries/event_library.h

This file was deleted.

This file was deleted.

25 changes: 25 additions & 0 deletions src/sst/elements/mercury/operating_system/libraries/library.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,30 @@ Library::Library(SST::Params & params, App *parent) :
api_parent_app_(parent)
{ }

void
Library::incomingRequest(Request* /*ev*/)
{
sst_hg_throw_printf(SST::Hg::UnimplementedError,
"%s::incomingRequest: this library should only block, never receive incoming",
toString().c_str());
}

void
Library::incomingEvent(Event* /*ev*/)
{
sst_hg_throw_printf(SST::Hg::UnimplementedError,
"%s::incomingEvent: this library should only block, never receive incoming",
toString().c_str());
}

Library::Library(const std::string& libname, SoftwareId sid, OperatingSystemAPI* os) :
os_(os),
sid_(sid),
addr_(os->addr()),
libname_(libname)
{
os_->registerEventLib(this);
}

} // end namespace Hg
} // end namespace SST
Loading
Loading