-
Notifications
You must be signed in to change notification settings - Fork 148
Network Storage (NetworkIO) Implementation for SST Firefly NIC #2643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RishankPratikHPLabs
wants to merge
2
commits into
sstsimulator:devel
Choose a base branch
from
RishankPratikHPLabs:nwStorage-feature
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // SPDX-FileCopyrightText: Copyright Hewlett Packard Enterprise Development LP | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "sst/elements/ember/embergen.h" | ||
| #include "sst/elements/ember/libs/emberLib.h" | ||
| #include "sst/elements/ember/libs/networkIOEvents/emberNetworkIOReadEvent.h" | ||
| #include "sst/elements/ember/libs/networkIOEvents/emberNetworkIOWriteEvent.h" | ||
| #include "sst/elements/hermes/networkIOapi.h" | ||
|
|
||
| using namespace Hermes; | ||
|
|
||
| namespace SST { | ||
| namespace Ember { | ||
|
|
||
| class EmberNetworkIOLib : public EmberLib { | ||
| public: | ||
| SST_ELI_REGISTER_MODULE( | ||
| EmberNetworkIOLib, | ||
| "ember", | ||
| "networkIOLib", | ||
| SST_ELI_ELEMENT_VERSION(1,0,0), | ||
| "Network I/O Library for network-attached storage operations", | ||
| SST::Ember::EmberLib | ||
| ) | ||
|
|
||
| SST_ELI_DOCUMENT_PARAMS() | ||
|
|
||
| EmberNetworkIOLib(Params& params) {} | ||
|
|
||
| void networkIORead(std::queue<EmberEvent*>& q, Hermes::MemAddr dest, uint64_t offset, uint64_t length) | ||
| { | ||
| q.push(new EmberNetworkIOReadEvent(api(), m_output, dest, offset, length)); | ||
| } | ||
|
|
||
| void networkIOWrite(std::queue<EmberEvent*>& q, uint64_t offset, Hermes::MemAddr src, uint64_t length) | ||
| { | ||
| q.push(new EmberNetworkIOWriteEvent(api(), m_output, offset, src, length)); | ||
| } | ||
|
|
||
| private: | ||
| NetworkIO::Interface& api() { return *static_cast<NetworkIO::Interface*>(m_api); } | ||
| }; | ||
|
|
||
| } | ||
| } |
31 changes: 31 additions & 0 deletions
31
src/sst/elements/ember/libs/networkIOEvents/emberNetworkIOEvent.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // SPDX-FileCopyrightText: Copyright Hewlett Packard Enterprise Development LP | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <sst/elements/ember/emberevent.h> | ||
| #include <sst/elements/hermes/networkIOapi.h> | ||
|
|
||
| using namespace Hermes; | ||
|
|
||
| namespace SST { | ||
| namespace Ember { | ||
|
|
||
| typedef Statistic<uint32_t> EmberEventTimeStatistic; | ||
|
|
||
| class EmberNetworkIOEvent : public EmberEvent { | ||
| public: | ||
| EmberNetworkIOEvent(NetworkIO::Interface& api, Output* output, | ||
| EmberEventTimeStatistic* stat = NULL) : | ||
| EmberEvent(output, stat), m_api(api) | ||
| { | ||
| m_state = IssueCallback; | ||
| } | ||
|
|
||
| protected: | ||
| NetworkIO::Interface& m_api; | ||
| }; | ||
|
|
||
| } | ||
| } | ||
|
|
36 changes: 36 additions & 0 deletions
36
src/sst/elements/ember/libs/networkIOEvents/emberNetworkIOReadEvent.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // SPDX-FileCopyrightText: Copyright Hewlett Packard Enterprise Development LP | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "emberNetworkIOEvent.h" | ||
|
|
||
| namespace SST { | ||
| namespace Ember { | ||
|
|
||
| class EmberNetworkIOReadEvent : public EmberNetworkIOEvent { | ||
| public: | ||
| EmberNetworkIOReadEvent(NetworkIO::Interface& api, Output* output, Hermes::MemAddr dest, | ||
| uint64_t offset, uint32_t length, | ||
| EmberEventTimeStatistic* stat = NULL) : | ||
| EmberNetworkIOEvent(api, output, stat), | ||
| m_dest(dest), m_offset(offset), m_length(length) | ||
| {} | ||
|
|
||
| ~EmberNetworkIOReadEvent() {} | ||
|
|
||
| std::string getName() { return "NetworkIORead"; } | ||
|
|
||
| virtual void issue(uint64_t time, Callback callback) { | ||
| EmberEvent::issue(time); | ||
| m_api.networkIORead(m_dest.getSimVAddr(), m_offset, m_length, callback); | ||
| } | ||
|
|
||
| private: | ||
| Hermes::MemAddr m_dest; | ||
| uint64_t m_offset; | ||
| uint32_t m_length; | ||
| }; | ||
|
|
||
| } | ||
| } |
36 changes: 36 additions & 0 deletions
36
src/sst/elements/ember/libs/networkIOEvents/emberNetworkIOWriteEvent.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // SPDX-FileCopyrightText: Copyright Hewlett Packard Enterprise Development LP | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "emberNetworkIOEvent.h" | ||
|
|
||
| namespace SST { | ||
| namespace Ember { | ||
|
|
||
| class EmberNetworkIOWriteEvent : public EmberNetworkIOEvent { | ||
| public: | ||
| EmberNetworkIOWriteEvent(NetworkIO::Interface& api, Output* output, uint64_t offset, | ||
| Hermes::MemAddr src, uint32_t length, | ||
| EmberEventTimeStatistic* stat = NULL) : | ||
| EmberNetworkIOEvent(api, output, stat), | ||
| m_offset(offset), m_src(src), m_length(length) | ||
| {} | ||
|
|
||
| ~EmberNetworkIOWriteEvent() {} | ||
|
|
||
| std::string getName() { return "NetworkIOWrite"; } | ||
|
|
||
| virtual void issue(uint64_t time, Callback callback) { | ||
| EmberEvent::issue(time); | ||
| m_api.networkIOWrite(m_offset, m_src.getSimVAddr(), m_length, callback); | ||
| } | ||
|
|
||
| private: | ||
| uint64_t m_offset; | ||
| Hermes::MemAddr m_src; | ||
| uint32_t m_length; | ||
| }; | ||
|
|
||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // SPDX-FileCopyrightText: Copyright Hewlett Packard Enterprise Development LP | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| #include <sst_config.h> | ||
| #include "emberNetworkIOGen.h" | ||
|
|
||
| using namespace SST::Ember; | ||
|
|
||
| EmberNetworkIOGenerator::EmberNetworkIOGenerator(ComponentId_t id, Params& params, std::string name) | ||
| : EmberGenerator(id, params, name), m_networkIOLib(nullptr) | ||
| { | ||
| m_shmemLib = NULL; | ||
| } | ||
|
|
||
| void EmberNetworkIOGenerator::setup() | ||
| { | ||
| m_shmemLib = static_cast<EmberShmemLib*>(getLib("shmem")); | ||
| m_networkIOLib = static_cast<EmberNetworkIOLib*>(getLib("networkIO")); | ||
| assert(m_shmemLib); | ||
| assert(m_networkIOLib); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // SPDX-FileCopyrightText: Copyright Hewlett Packard Enterprise Development LP | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| #pragma once | ||
| #include "sst/elements/ember/embergen.h" | ||
| #include "sst/elements/ember/libs/emberLib.h" | ||
| #include "sst/elements/ember/libs/emberShmemLib.h" | ||
| #include "sst/elements/ember/libs/emberNetworkIOLib.h" | ||
|
|
||
| using namespace Hermes; | ||
|
|
||
| namespace SST { | ||
| namespace Ember { | ||
|
|
||
| class EmberNetworkIOGenerator : public EmberGenerator { | ||
| public: | ||
| EmberNetworkIOGenerator(ComponentId_t id, Params& params, std::string name = ""); | ||
| ~EmberNetworkIOGenerator() {} | ||
| virtual void completed(const SST::Output*, uint64_t time) {} | ||
| virtual void setup(); | ||
|
|
||
| protected: | ||
| EmberShmemLib* m_shmemLib; | ||
|
|
||
|
|
||
| EmberNetworkIOLib* m_networkIOLib; | ||
| EmberNetworkIOLib& networkIO() { return *m_networkIOLib; } | ||
|
|
||
| EmberShmemLib& shmem() { return *m_shmemLib; } | ||
|
|
||
| // Barrier macro (same as EmberShmemGen) | ||
| #define enQ_barrier_all shmem().barrier_all | ||
| #define enQ_malloc shmem().malloc | ||
| #define enQ_my_pe shmem().my_pe | ||
| }; | ||
|
|
||
| } | ||
| } | ||
|
|
56 changes: 56 additions & 0 deletions
56
src/sst/elements/ember/networkIO/motifs/emberTestNetworkIO.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // SPDX-FileCopyrightText: Copyright Hewlett Packard Enterprise Development LP | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| #include <sst_config.h> | ||
| #include "emberTestNetworkIO.h" | ||
| #include <iostream> | ||
|
|
||
| using namespace SST::Ember; | ||
|
|
||
| EmberTestNetworkIOGenerator::EmberTestNetworkIOGenerator(SST::ComponentId_t id, Params& params) | ||
| : EmberNetworkIOGenerator(id, params, "TestNetworkIO"), m_phase(0) | ||
| { | ||
| m_messageSize = params.find<uint32_t>("arg.messageSize", 1024); | ||
| m_iterations = params.find<uint32_t>("arg.iterations", 5); | ||
| m_opType = params.find<std::string>("arg.op", "write"); | ||
| m_fileSize = params.find<uint64_t>("arg.fileSize", 10485760); // 10MB default | ||
|
|
||
| m_rng = new SST::RNG::MarsagliaRNG(); | ||
| m_startTime = 0; | ||
| m_stopTime = 0; | ||
| } | ||
|
|
||
| bool EmberTestNetworkIOGenerator::generate( std::queue<EmberEvent*>& evQ) | ||
| { | ||
| bool ret = false; | ||
| switch(m_phase) | ||
| { | ||
| case 0: | ||
| memSetNotBacked(); | ||
| m_localBuffer = memAlloc(m_messageSize); | ||
| enQ_getTime(evQ, &m_startTime); | ||
| for (uint32_t i = 0; i < m_iterations; i++) | ||
| { | ||
| uint64_t offset = m_rng->generateNextUInt64() % m_fileSize; | ||
|
|
||
| if (m_opType == "read") | ||
| networkIO().networkIORead(evQ, m_localBuffer, offset, m_messageSize); | ||
| else | ||
| networkIO().networkIOWrite(evQ, offset, m_localBuffer, m_messageSize); | ||
| } | ||
| enQ_getTime(evQ, &m_stopTime); | ||
| break; | ||
|
|
||
| case 1: | ||
| double totalTime = (double)(m_stopTime - m_startTime)/1000000000.0; | ||
| double latency = (totalTime/m_iterations); | ||
| output("message-size %u, iterations %u, total-time %.3lf us\n", | ||
| m_messageSize, m_iterations, totalTime * 1000000.0) ; | ||
| ret = true; | ||
| break; | ||
| } | ||
|
|
||
| ++m_phase; | ||
| return ret; | ||
| } | ||
|
|
57 changes: 57 additions & 0 deletions
57
src/sst/elements/ember/networkIO/motifs/emberTestNetworkIO.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| // SPDX-FileCopyrightText: Copyright Hewlett Packard Enterprise Development LP | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <strings.h> | ||
| #include <sst/core/rng/marsaglia.h> | ||
| #include "networkIO/emberNetworkIOGen.h" | ||
|
|
||
| namespace SST { | ||
| namespace Ember { | ||
|
|
||
| class EmberTestNetworkIOGenerator : public EmberNetworkIOGenerator | ||
| { | ||
| public: | ||
| SST_ELI_REGISTER_SUBCOMPONENT( | ||
| EmberTestNetworkIOGenerator, | ||
| "ember", | ||
| "TestNetworkIOMotif", | ||
| SST_ELI_ELEMENT_VERSION(1,0,0), | ||
| "Network IO Test", | ||
| SST::Ember::EmberGenerator | ||
| ) | ||
|
|
||
| SST_ELI_DOCUMENT_PARAMS( | ||
| {"arg.messageSize","Message size in bytes","1024"}, | ||
| {"arg.iterations","Number of iterations to perform","1"}, | ||
| {"arg.op","Operation type: read or write","write"}, | ||
| {"arg.fileSize","Storage file size in bytes","10485760"} | ||
| ) | ||
|
|
||
| EmberTestNetworkIOGenerator(SST::ComponentId_t id, Params& params); | ||
|
|
||
| bool generate( std::queue<EmberEvent*>& evQ); | ||
|
|
||
| private: | ||
| // Simulation control | ||
| int m_phase; | ||
|
|
||
| // Random number generation | ||
| SST::RNG::MarsagliaRNG* m_rng; // RNG instance for offset generation | ||
|
|
||
| // Operation parameters | ||
| uint32_t m_messageSize; // Size of each read/write operation | ||
| uint32_t m_iterations; // Number of operations to perform | ||
| uint64_t m_fileSize; // Total file size for offset generation | ||
| std::string m_opType; // Operation type: "read" or "write" | ||
|
|
||
| // Runtime state | ||
| Hermes::MemAddr m_localBuffer; // Buffer for data transfer | ||
|
|
||
| // Performance measurement | ||
| uint64_t m_startTime; | ||
| uint64_t m_stopTime; | ||
| }; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # SPDX-FileCopyrightText: Copyright Hewlett Packard Enterprise Development LP | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| # This file must be ordered | ||
| # | ||
| # [JOB_ID] | ||
| # [NID_LIST] | ||
| # [MOTIF] | ||
| # [MOTIF] | ||
| # | ||
| # keywords must be left justified and not contain white space | ||
| # all characters between keywords will be considered part of the leading keyword | ||
| # you can have multiple MOTIF keywords for a given JOB_ID | ||
| # you can have multiple jobs | ||
| # two jobs can not have the same NID | ||
|
|
||
| [VAR] TOTAL_NODES=4 | ||
| [VAR] COMPUTE_OFFSET=0 | ||
| [VAR] COMPUTE_NODES=2 | ||
| [VAR] SSD_START_NODE=2 | ||
| [VAR] SSD_NODES=2 | ||
|
|
||
| [JOB_ID] 1 | ||
| [NID_LIST] generateNidList=generateNidListRange({COMPUTE_OFFSET},{COMPUTE_NODES}) | ||
| [PARAM] ember:firefly.hadesNetworkIO.ssd_start_node={SSD_START_NODE} | ||
| [PARAM] ember:firefly.hadesNetworkIO.numStorageNodes={SSD_NODES} | ||
| [PARAM] ember:firefly.hadesNetworkIO.storageNodeCapacity=1GiB | ||
| [MOTIF] TestNetworkIO iterations=1 messageSize=1000 op=write | ||
|
|
||
| [JOB_ID] 2 | ||
| [NID_LIST] generateNidList=generateNidListRange({SSD_START_NODE},{SSD_NODES}) | ||
| [MOTIF] Null | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New line at end of line |
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New line at end of line