Skip to content
Open
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
104 changes: 59 additions & 45 deletions src/sst/elements/miranda/generators/copygen.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,77 +28,92 @@ namespace Miranda {
class CopyGenerator : public RequestGenerator {

public:
SST_ELI_REGISTER_SUBCOMPONENT(
CopyGenerator,
"miranda",
"CopyGenerator",
SST_ELI_ELEMENT_VERSION(1,0,0),
"Creates a single copy of stream of reads/writes replicating an array copy pattern",
SST::Miranda::RequestGenerator
)

SST_ELI_DOCUMENT_PARAMS(
{ "read_start_address", "Sets the start read address for this generator", "0" },
{ "write_start_address", "Sets the start target address for writes for the generator", "1024" },
{ "request_size", "Sets the size of each request in bytes", "8" },
{ "request_count", "Sets the number of items to be copied", "128" },
{ "verbose", "Sets the verbosity of the output", "0" }
)

CopyGenerator( ComponentId_t id, Params& params) : RequestGenerator(id, params) {
build(params);
}

CopyGenerator() = default;


void build(Params& params) {
const uint32_t verbose = params.find<uint32_t>("verbose", 0);
out = new Output("CopyGenerator[@p:@l]: ", verbose, 0, Output::STDOUT);
out = new Output("CopyGenerator[@p:@l]: ", verbose, 0, Output::STDOUT);

readAddr = params.find<uint64_t>("read_start_address", 0);
reqLength = params.find<uint64_t>("operandwidth", 8);
itemCount = params.find<uint64_t>("request_count", 1024);
readAddr = params.find<uint64_t>("read_start_address", 0);
reqLength = params.find<uint64_t>("operandwidth", 8);
itemCount = params.find<uint64_t>("request_count", 1024);

n_per_call = params.find<uint64_t>("n_per_call", 2);
n_per_call = params.find<uint64_t>("n_per_call", 2);

// Write address default is sized for number of requests * req lengtgh
writeAddr = params.find<uint64_t>("write_start_address",
readAddr + (reqLength * itemCount));
// Write address default is sized for number of requests * req lengtgh
writeAddr = params.find<uint64_t>("write_start_address",
readAddr + (reqLength * itemCount));

// Start generator at 0
nextItem = 0;
// Start generator at 0
nextItem = 0;

out->verbose(CALL_INFO, 1, 0, "Copy count is %" PRIu64 "\n", itemCount);
out->verbose(CALL_INFO, 1, 0, "operandwidth %" PRIu64 "\n", reqLength);
out->verbose(CALL_INFO, 1, 0, "read start 0x%" PRIx64 "\n", readAddr);
out->verbose(CALL_INFO, 1, 0, "writestart 0x%" PRIx64 "\n", writeAddr);
out->verbose(CALL_INFO, 1, 0, "N-per-generate %" PRIu64 "\n", n_per_call);
out->verbose(CALL_INFO, 1, 0, "Copy count is %" PRIu64 "\n", itemCount);
out->verbose(CALL_INFO, 1, 0, "operandwidth %" PRIu64 "\n", reqLength);
out->verbose(CALL_INFO, 1, 0, "read start 0x%" PRIx64 "\n", readAddr);
out->verbose(CALL_INFO, 1, 0, "writestart 0x%" PRIx64 "\n", writeAddr);
out->verbose(CALL_INFO, 1, 0, "N-per-generate %" PRIu64 "\n", n_per_call);
}

~CopyGenerator() {
delete out;
delete out;
}

void generate(MirandaRequestQueue<GeneratorRequest*>* q) {
for ( int i = 0; i < n_per_call; i++ ) {
if(nextItem == itemCount) {
return;
}

MemoryOpRequest* read = new MemoryOpRequest(readAddr + (nextItem * reqLength), reqLength, READ);
MemoryOpRequest* write = new MemoryOpRequest(writeAddr + (nextItem * reqLength), reqLength, WRITE);
write->addDependency(read->getRequestID());
q->push_back(read);
q->push_back(write);

nextItem++;
for ( int i = 0; i < n_per_call; i++ ) {
if(nextItem == itemCount) {
return;
}

MemoryOpRequest* read = new MemoryOpRequest(readAddr + (nextItem * reqLength), reqLength, READ);
MemoryOpRequest* write = new MemoryOpRequest(writeAddr + (nextItem * reqLength), reqLength, WRITE);
write->addDependency(read->getRequestID());
q->push_back(read);
q->push_back(write);

nextItem++;
}
}

bool isFinished() {
return (nextItem == itemCount);
return (nextItem == itemCount);
}

void completed() {}

SST_ELI_REGISTER_SUBCOMPONENT(
CopyGenerator,
"miranda",
"CopyGenerator",
SST_ELI_ELEMENT_VERSION(1,0,0),
"Creates a single copy of stream of reads/writes replicating an array copy pattern",
SST::Miranda::RequestGenerator
)
virtual void serialize_order(SST::Core::Serialization::serializer& ser) override {
SST::Miranda::RequestGenerator::serialize_order(ser);
SST_SER(nextItem);
SST_SER(readAddr);
SST_SER(writeAddr);
SST_SER(itemCount);
SST_SER(reqLength);
SST_SER(n_per_call);
SST_SER(out);
}

SST_ELI_DOCUMENT_PARAMS(
{ "read_start_address", "Sets the start read address for this generator", "0" },
{ "write_start_address", "Sets the start target address for writes for the generator", "1024" },
{ "request_size", "Sets the size of each request in bytes", "8" },
{ "request_count", "Sets the number of items to be copied", "128" },
{ "verbose", "Sets the verbosity of the output", "0" }
)
ImplementSerializable(SST::Miranda::CopyGenerator)

private:
uint64_t nextItem;
Expand All @@ -108,7 +123,6 @@ class CopyGenerator : public RequestGenerator {
uint64_t reqLength;
uint64_t n_per_call;
Output* out;

};

}
Expand Down
33 changes: 24 additions & 9 deletions src/sst/elements/miranda/generators/gupsgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ namespace Miranda {
class GUPSGenerator : public RequestGenerator {

public:
GUPSGenerator( ComponentId_t id, Params& params );
void build(Params &params);
~GUPSGenerator();
void generate(MirandaRequestQueue<GeneratorRequest*>* q);
bool isFinished();
void completed();

SST_ELI_REGISTER_SUBCOMPONENT(
GUPSGenerator,
"miranda",
Expand All @@ -58,9 +51,32 @@ class GUPSGenerator : public RequestGenerator {
{ "issue_op_fences", "Issue operation fences, \"yes\" or \"no\", default is yes", "yes" }
)

GUPSGenerator( ComponentId_t id, Params& params );
GUPSGenerator() = default;
~GUPSGenerator();
void build(Params &params);
void generate(MirandaRequestQueue<GeneratorRequest*>* q);
bool isFinished();
void completed();

virtual void serialize_order(SST::Core::Serialization::serializer& ser) override {
SST::Miranda::RequestGenerator::serialize_order(ser);
SST_SER(reqLength);
SST_SER(memLength);
SST_SER(memStart);
SST_SER(issueCount);
SST_SER(iterations);
SST_SER(seed_a);
SST_SER(seed_b);
SST_SER(rng);
SST_SER(out);
SST_SER(issueOpFences);
}

ImplementSerializable(SST::Miranda::GUPSGenerator)

private:
uint64_t reqLength;

uint64_t memLength;
uint64_t memStart;
uint64_t issueCount;
Expand All @@ -70,7 +86,6 @@ class GUPSGenerator : public RequestGenerator {
Random* rng;
Output* out;
bool issueOpFences;

};

}
Expand Down
55 changes: 38 additions & 17 deletions src/sst/elements/miranda/generators/inorderstreambench.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,29 @@ namespace Miranda {
class InOrderSTREAMBenchGenerator : public RequestGenerator {

public:
SST_ELI_REGISTER_SUBCOMPONENT(
InOrderSTREAMBenchGenerator,
"miranda",
"InOrderSTREAMBenchGenerator",
SST_ELI_ELEMENT_VERSION(1,0,0),
"Creates a representation of the STREAM benchmark for in-order CPUs",
SST::Miranda::RequestGenerator
)

SST_ELI_DOCUMENT_PARAMS(
{ "verbose", "Sets the verbosity output of the generator", "0" },
{ "n", "Sets the number of elements in the STREAM arrays", "10000" },
{ "block_per_call", "Sets the number of iterations to generate per call to the generation function", "1"},
{ "operandwidth", "Sets the length of the request, default=8 (i.e. one double)", "8" },
{ "start_a", "Sets the start address of the array a", "0" },
{ "start_b", "Sets the start address of the array b", "1024" },
{ "start_c", "Sets the start address of the array c", "2048" },
)

InOrderSTREAMBenchGenerator( ComponentId_t id, Params& params ) : RequestGenerator(id, params) { build(params); }

InOrderSTREAMBenchGenerator() = default;

void build(Params& params) {

const uint32_t verbose = params.find<uint32_t>("verbose", 0);
Expand Down Expand Up @@ -94,24 +115,24 @@ class InOrderSTREAMBenchGenerator : public RequestGenerator {

void completed() {}

SST_ELI_REGISTER_SUBCOMPONENT(
InOrderSTREAMBenchGenerator,
"miranda",
"InOrderSTREAMBenchGenerator",
SST_ELI_ELEMENT_VERSION(1,0,0),
"Creates a representation of the STREAM benchmark for in-order CPUs",
SST::Miranda::RequestGenerator
)
virtual void serialize_order(SST::Core::Serialization::serializer& ser) override {
SST::Miranda::RequestGenerator::serialize_order(ser);
SST_SER(requestLen);

SST_SER(start_a);
SST_SER(start_b);
SST_SER(start_c);

SST_SER(n);
SST_SER(block_per_call);
SST_SER(i);

SST_SER(out);
}

ImplementSerializable(SST::Miranda::InOrderSTREAMBenchGenerator)


SST_ELI_DOCUMENT_PARAMS(
{ "verbose", "Sets the verbosity output of the generator", "0" },
{ "n", "Sets the number of elements in the STREAM arrays", "10000" },
{ "block_per_call", "Sets the number of iterations to generate per call to the generation function", "1"},
{ "operandwidth", "Sets the length of the request, default=8 (i.e. one double)", "8" },
{ "start_a", "Sets the start address of the array a", "0" },
{ "start_b", "Sets the start address of the array b", "1024" },
{ "start_c", "Sets the start address of the array c", "2048" },
)

private:
uint64_t requestLen;
Expand Down
20 changes: 14 additions & 6 deletions src/sst/elements/miranda/generators/nullgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ namespace Miranda {
class EmptyGenerator : public RequestGenerator {

public:
EmptyGenerator( ComponentId_t id, Params& params ) : RequestGenerator(id, params) {}
~EmptyGenerator() { }
void generate(MirandaRequestQueue<GeneratorRequest*>* q) { }
bool isFinished() { return true; }
void completed() { }

SST_ELI_REGISTER_SUBCOMPONENT(
EmptyGenerator,
"miranda",
Expand All @@ -48,6 +42,20 @@ class EmptyGenerator : public RequestGenerator {
SST_ELI_DOCUMENT_PARAMS(
)

EmptyGenerator( ComponentId_t id, Params& params ) : RequestGenerator(id, params) {}
EmptyGenerator() = default;
~EmptyGenerator() { }
void generate(MirandaRequestQueue<GeneratorRequest*>* q) { }
bool isFinished() { return true; }
void completed() { }

virtual void serialize_order(SST::Core::Serialization::serializer& ser) override {
SST::Miranda::RequestGenerator::serialize_order(ser);
}

ImplementSerializable(SST::Miranda::EmptyGenerator)


};

}
Expand Down
28 changes: 21 additions & 7 deletions src/sst/elements/miranda/generators/randomgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ namespace Miranda {
class RandomGenerator : public RequestGenerator {

public:
RandomGenerator( ComponentId_t id, Params& params );
void build(Params& params);
~RandomGenerator();
void generate(MirandaRequestQueue<GeneratorRequest*>* q);
bool isFinished();
void completed();

SST_ELI_REGISTER_SUBCOMPONENT(
RandomGenerator,
"miranda",
Expand All @@ -54,6 +47,27 @@ class RandomGenerator : public RequestGenerator {
{ "max_address", "Maximum address allowed for generation", "16384" },
{ "issue_op_fences", "Issue operation fences, \"yes\" or \"no\", default is yes", "yes" }
)

RandomGenerator( ComponentId_t id, Params& params );
RandomGenerator() = default;
~RandomGenerator();
void build(Params& params);
void generate(MirandaRequestQueue<GeneratorRequest*>* q);
bool isFinished();
void completed();

virtual void serialize_order(SST::Core::Serialization::serializer& ser) override {
SST::Miranda::RequestGenerator::serialize_order(ser);
SST_SER(reqLength);
SST_SER(maxAddr);
SST_SER(issueCount);
SST_SER(issueOpFences);
SST_SER(rng);
SST_SER(out);
}

ImplementSerializable(SST::Miranda::RandomGenerator)

private:
uint64_t reqLength;
uint64_t maxAddr;
Expand Down
30 changes: 23 additions & 7 deletions src/sst/elements/miranda/generators/revsinglestream.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ namespace Miranda {
class ReverseSingleStreamGenerator : public RequestGenerator {

public:
ReverseSingleStreamGenerator( ComponentId_t id, Params& params );
void build(Params& params);
~ReverseSingleStreamGenerator();
void generate(MirandaRequestQueue<GeneratorRequest*>* q);
bool isFinished();
void completed();

SST_ELI_REGISTER_SUBCOMPONENT(
ReverseSingleStreamGenerator,
"miranda",
Expand All @@ -52,6 +45,29 @@ class ReverseSingleStreamGenerator : public RequestGenerator {
{ "stride", "Sets the stride, since this is a reverse stream this is subtracted per iteration, def=1", "1" },
)

ReverseSingleStreamGenerator( ComponentId_t id, Params& params );
ReverseSingleStreamGenerator() = default;
~ReverseSingleStreamGenerator();
void build(Params& params);
void generate(MirandaRequestQueue<GeneratorRequest*>* q);
bool isFinished();
void completed();

virtual void serialize_order(SST::Core::Serialization::serializer& ser) override {
SST::Miranda::RequestGenerator::serialize_order(ser);
SST_SER(startIndex);
SST_SER(stopIndex);
SST_SER(datawidth);
SST_SER(nextIndex);
SST_SER(stride);

SST_SER(out);
}

ImplementSerializable(SST::Miranda::ReverseSingleStreamGenerator)



private:
uint64_t startIndex;
uint64_t stopIndex;
Expand Down
Loading
Loading