Initial commit
This commit is contained in:
Executable
+7
@@ -0,0 +1,7 @@
|
||||
|
||||
wfinput=for1/wfInput.code
|
||||
wfoutput=for1/wfOutput.code
|
||||
|
||||
atomicTask.0=for1/atomic1.properties
|
||||
atomicTask.1=for1/atomic2.properties
|
||||
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
|
||||
name=AtomicActivity1
|
||||
entries=4
|
||||
entry.0=atomic1a.code
|
||||
entryname.0=atomic1a
|
||||
entrytype.0=pthreads
|
||||
entrymetadata.0={{\"key1\", \"value1\"}, {\"key2\", \"value2\"}}
|
||||
entry.1=atomic1b.code
|
||||
entryname.1=atomic1b
|
||||
entrytype.1=openCL
|
||||
entry.2=atomic1b.code
|
||||
entryname.2=atomic1c
|
||||
entrytype.2=cuda
|
||||
entry.3=atomic1sim.code
|
||||
entryname.3=atomic1sim
|
||||
entrytype.3=pthreads
|
||||
entrymetadata.3={{\"sim-mode\", \"1\"}}
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
auto myiter = WFR_SELF_GETITERATIONID();
|
||||
std::cout << "AtomicActivity1 [" << myiter << "]:" << std::endl
|
||||
<< "\titerCount: " << sin->iterCount.getValue() << std::endl
|
||||
<< "\ttaskIn1: " << sin->taskIn1.getValue() << std::endl
|
||||
<< "\tloopPortIn1: " << sin->loopPortIn1.getValue() << std::endl;
|
||||
#include <sstream>
|
||||
if (myiter+1 != sin->taskIn1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: IterationID+1 [" << myiter+1 << "] does not match taskIn1 [" << sin->taskIn1.getValue()<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter == 0 && sin->iterCount.getValue() != sin->loopPortIn1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: LoopPortIn1 [" << sin->loopPortIn1.getValue() << "] does not match iterCount [" << sin->iterCount.getValue()<< "] in 1st iteration.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter > 0 && sin->loopPortIn1.getValue() != myiter) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: LoopPortIn1 [" << sin->loopPortIn1.getValue() << "] does not match iterationID- [" << myiter << "] in subsequent iterations.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->taskOut1.setValue(sin->taskIn1.getValue());
|
||||
sout->isOK.setValue(true);
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
auto myiter = WFR_SELF_GETITERATIONID();
|
||||
std::cout << "AtomicActivity1 [" << myiter << "]:" << std::endl
|
||||
<< "\titerCount: " << sin->iterCount.getValue() << std::endl
|
||||
<< "\ttaskIn1: " << sin->taskIn1.getValue() << std::endl
|
||||
<< "\tloopPortIn1: " << sin->loopPortIn1.getValue() << std::endl;
|
||||
#include <sstream>
|
||||
if (myiter+1 != sin->taskIn1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: IterationID+1 [" << myiter+1 << "] does not match taskIn1 [" << sin->taskIn1.getValue()<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter == 0 && sin->iterCount.getValue() != sin->loopPortIn1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: LoopPortIn1 [" << sin->loopPortIn1.getValue() << "] does not match iterCount [" << sin->iterCount.getValue()<< "] in 1st iteration.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter > 0 && sin->loopPortIn1.getValue() != myiter) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: LoopPortIn1 [" << sin->loopPortIn1.getValue() << "] does not match iterationID- [" << myiter << "] in subsequent iterations.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->taskOut1.setValue(sin->taskIn1.getValue());
|
||||
sout->isOK.setValue(true);
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
auto myiter = WFR_SELF_GETITERATIONID();
|
||||
std::cout << "AtomicActivity1 [" << myiter << "]:" << std::endl
|
||||
<< "\titerCount: " << sin->iterCount.getValue() << std::endl
|
||||
<< "\ttaskIn1: " << sin->taskIn1.getValue() << std::endl
|
||||
<< "\tloopPortIn1: " << sin->loopPortIn1.getValue() << std::endl;
|
||||
#include <sstream>
|
||||
if (myiter+1 != sin->taskIn1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: IterationID+1 [" << myiter+1 << "] does not match taskIn1 [" << sin->taskIn1.getValue()<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter == 0 && sin->iterCount.getValue() != sin->loopPortIn1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: LoopPortIn1 [" << sin->loopPortIn1.getValue() << "] does not match iterCount [" << sin->iterCount.getValue()<< "] in 1st iteration.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter > 0 && sin->loopPortIn1.getValue() != myiter) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: LoopPortIn1 [" << sin->loopPortIn1.getValue() << "] does not match iterationID- [" << myiter << "] in subsequent iterations.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->taskOut1.setValue(sin->taskIn1.getValue());
|
||||
sout->isOK.setValue(true);
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
auto myiter = WFR_SELF_GETITERATIONID();
|
||||
std::cout << "AtomicActivity1 [" << myiter << "]:" << std::endl
|
||||
<< "\titerCount: " << sin->iterCount.getValue() << std::endl
|
||||
<< "\ttaskIn1: " << sin->taskIn1.getValue() << std::endl
|
||||
<< "\tloopPortIn1: " << sin->loopPortIn1.getValue() << std::endl;
|
||||
#include <sstream>
|
||||
if (myiter+1 != sin->taskIn1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: IterationID+1 [" << myiter+1 << "] does not match taskIn1 [" << sin->taskIn1.getValue()<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter == 0 && sin->iterCount.getValue() != sin->loopPortIn1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: LoopPortIn1 [" << sin->loopPortIn1.getValue() << "] does not match iterCount [" << sin->iterCount.getValue()<< "] in 1st iteration.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter > 0 && sin->loopPortIn1.getValue() != myiter) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: LoopPortIn1 [" << sin->loopPortIn1.getValue() << "] does not match iterationID- [" << myiter << "] in subsequent iterations.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
|
||||
EXECUTE_SIMULATION_MODE
|
||||
|
||||
sout->taskOut1.setValue(sin->taskIn1.getValue());
|
||||
sout->isOK.setValue(true);
|
||||
Executable
+79
@@ -0,0 +1,79 @@
|
||||
std::cout << "AtomicActivity2:" << std::endl
|
||||
<< "\titerCount: " << sin->iterCount.getValue() << std::endl
|
||||
<< "\toutPortIn1: " << sin->outPortIn1.getValue() << std::endl
|
||||
<< "\toutPortIn2: " << sin->outPortIn2.getValue() << std::endl
|
||||
<< "\tloopPortIn1: " << sin->loopPortIn1.getValue() << std::endl;
|
||||
if (sin->iterCount.getValue() <= 0) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: iterCount [" << sin->iterCount.getValue() << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->iterCount.getValue() != sin->outPortIn1.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: outPortIn1 [" << sin->outPortIn1.getValue() << "] is not equal iterCount [" << (sin->iterCount.getValue()) << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->iterCount.getValue() != sin->outPortIn2.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: outPortIn2 [" << sin->outPortIn2.getValue() << "] is not equal iterCount [" << (sin->iterCount.getValue()) << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->iterCount.getValue() != sin->loopPortIn1.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPortIn1 [" << sin->loopPortIn1.getValue() << "] is not equal iterCount [" << (sin->iterCount.getValue()) << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->unionPortIn1.getSize() != sin->iterCount.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: unionPortIn1 collection size [" << sin->unionPortIn1.getSize() << "] is not equal iterCount [" << sin->iterCount.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\tunionPortIn1: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->unionPortIn1.getSize(); t++) {
|
||||
if (sin->unionPortIn1.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: unionPortIn1 collection value index [" << t << "] does not have value [" << sin->unionPortIn1.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->unionPortIn1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
if (sin->isOkUnion1.getSize() != sin->iterCount.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOkUnion1 collection size [" << sin->isOkUnion1.getSize() << "] is not equal iterCount [" << sin->iterCount.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\tisOkUnion1: [ ";
|
||||
isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->isOkUnion1.getSize(); t++) {
|
||||
if (!sin->isOkUnion1.getEntryValue(t)) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOkUnion1 collection value at index [" << t << "] is not true].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->isOkUnion1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
sout->outPortOut1.setValue(sin->outPortIn1.getValue());
|
||||
sout->loopPortOut1.setValue(sin->loopPortIn1.getValue());
|
||||
sout->unionPortOut1 = sin->unionPortIn1;
|
||||
sout->isOK.setValue(true);
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
|
||||
name=AtomicActivity2
|
||||
entries=2
|
||||
entry.0=atomic2.code
|
||||
entry.1=atomic2sim.code
|
||||
entryname.1=atomic2sim
|
||||
entrytype.1=pthreads
|
||||
entrymetadata.1={{\"sim-mode\", \"1\"}}
|
||||
Executable
+82
@@ -0,0 +1,82 @@
|
||||
std::cout << "AtomicActivity2:" << std::endl
|
||||
<< "\titerCount: " << sin->iterCount.getValue() << std::endl
|
||||
<< "\toutPortIn1: " << sin->outPortIn1.getValue() << std::endl
|
||||
<< "\toutPortIn2: " << sin->outPortIn2.getValue() << std::endl
|
||||
<< "\tloopPortIn1: " << sin->loopPortIn1.getValue() << std::endl;
|
||||
if (sin->iterCount.getValue() <= 0) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: iterCount [" << sin->iterCount.getValue() << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->iterCount.getValue() != sin->outPortIn1.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: outPortIn1 [" << sin->outPortIn1.getValue() << "] is not equal iterCount [" << (sin->iterCount.getValue()) << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->iterCount.getValue() != sin->outPortIn2.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: outPortIn2 [" << sin->outPortIn2.getValue() << "] is not equal iterCount [" << (sin->iterCount.getValue()) << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->iterCount.getValue() != sin->loopPortIn1.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPortIn1 [" << sin->loopPortIn1.getValue() << "] is not equal iterCount [" << (sin->iterCount.getValue()) << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->unionPortIn1.getSize() != sin->iterCount.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: unionPortIn1 collection size [" << sin->unionPortIn1.getSize() << "] is not equal iterCount [" << sin->iterCount.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\tunionPortIn1: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->unionPortIn1.getSize(); t++) {
|
||||
if (sin->unionPortIn1.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: unionPortIn1 collection value index [" << t << "] does not have value [" << sin->unionPortIn1.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->unionPortIn1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
if (sin->isOkUnion1.getSize() != sin->iterCount.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOkUnion1 collection size [" << sin->isOkUnion1.getSize() << "] is not equal iterCount [" << sin->iterCount.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\tisOkUnion1: [ ";
|
||||
isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->isOkUnion1.getSize(); t++) {
|
||||
if (!sin->isOkUnion1.getEntryValue(t)) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOkUnion1 collection value at index [" << t << "] is not true].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->isOkUnion1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
|
||||
EXECUTE_SIMULATION_MODE
|
||||
|
||||
sout->outPortOut1.setValue(sin->outPortIn1.getValue());
|
||||
sout->loopPortOut1.setValue(sin->loopPortIn1.getValue());
|
||||
sout->unionPortOut1 = sin->unionPortIn1;
|
||||
sout->isOK.setValue(true);
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
wfInput.iterationCount.setValue(2);
|
||||
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
/*if (wfOutput.unionPortOut1.getSize() != wfInput.iterationCount.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: unionPortOut1 collection size [" << wfOutput.unionPortOut1.getSize() << "] is not equal iterCount [" << wfInput.iterationCount.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (wfOutput.outPortOut1.getValue() != wfInput.iterationCount.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: outPortOut1 value [" << wfOutput.outPortOut1.getValue() << "] is not equal iterCount [" << wfInput.iterationCount.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (wfOutput.loopPortOut1.getValue() != wfInput.iterationCount.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPortOut1 value [" << wfOutput.loopPortOut1.getValue() << "] is not equal iterCount [" << wfInput.iterationCount.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}*/
|
||||
std::cout << "wfOutput:" << std::endl
|
||||
<< "\toutPortOut1: " << wfOutput.outPortOut1.getValue() << std::endl
|
||||
<< "\tloopPortOut1: " << wfOutput.loopPortOut1.getValue() << std::endl
|
||||
<< "\tisOK: " << wfOutput.isOK.getValue() << std::endl;
|
||||
std::cout << "\tunionPortOut1: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < wfOutput.unionPortOut1.getSize(); t++) {
|
||||
if (wfOutput.unionPortOut1.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: unionPortOut1 collection value index [" << t << "] does not have correct value [" << wfOutput.unionPortOut1.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << wfOutput.unionPortOut1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
|
||||
wfinput=foreach1/wfInput.code
|
||||
wfoutput=foreach1/wfOutput.code
|
||||
|
||||
atomicTask.0=foreach1/atomic1.properties
|
||||
atomicTask.1=foreach1/atomic2.properties
|
||||
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
auto myiter = WFR_SELF_GETITERATIONID();
|
||||
std::cout << "AtomicActivity1 [" << myiter << "]:" << std::endl
|
||||
<< "\telements1Count: " << sin->elements1Count.getValue() << std::endl
|
||||
<< "\telement1in: " << sin->element1in.getValue() << std::endl
|
||||
<< "\tloopPort1: " << sin->loopPort1.getValue() << std::endl
|
||||
<< "\telements2Count: " << sin->elements2Count.getValue() << std::endl
|
||||
<< "\telement2in: " << sin->element2in.getValue() << std::endl
|
||||
<< "\tloopPort2: " << sin->loopPort2.getValue() << std::endl;
|
||||
#include <sstream>
|
||||
if (myiter == 0 && sin->elements1Count.getValue() != sin->loopPort1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPort1 value [" << sin->loopPort1.getValue() << "] is not equal telements1Count [" << sin->elements1Count.getValue() << "] during first iteration.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter > 0 && myiter != sin->loopPort1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPort1 value [" << sin->loopPort1.getValue() << "] is not equal myiter [" << myiter << "] during subsequent iteration.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter == 0 && sin->elements2Count.getValue() != sin->loopPort2.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPort2 value [" << sin->loopPort2.getValue() << "] is not equal telements2Count [" << sin->elements2Count.getValue() << "] during first iteration.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter > 0 && myiter != sin->loopPort2.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPort2 value [" << sin->loopPort2.getValue() << "] is not equal myiter [" << myiter << "] during subsequent iteration.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if ( myiter+1 != sin->element1in.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: element1in value [" << sin->element1in.getValue() << "] is not equal myiter+1 [" << myiter+1 << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if ( myiter+1 != sin->element2in.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: element2in value [" << sin->element2in.getValue() << "] is not equal myiter+1 [" << myiter+1 << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->element1.setValue(sin->element1in.getValue());
|
||||
sout->element2.setValue(sin->element2in.getValue());
|
||||
sout->isOk.setValue(true);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity1
|
||||
entries=1
|
||||
entry.0=atomic1.code
|
||||
Executable
+164
@@ -0,0 +1,164 @@
|
||||
std::cout << "AtomicActivity2:" << std::endl
|
||||
<< "\telements1Count: " << sin->elements1Count.getValue() << std::endl
|
||||
<< "\telements2Count: " << sin->elements2Count.getValue() << std::endl
|
||||
<< "\tloopPort1: " << sin->loopPort1.getValue() << std::endl
|
||||
<< "\tloopPort2: " << sin->loopPort2.getValue() << std::endl
|
||||
<< "\toutPort1: " << sin->outPort1.getValue() << std::endl
|
||||
<< "\toutPort2: " << sin->outPort2.getValue() << std::endl
|
||||
<< "\toutLoopPort1: " << sin->outLoopPort1.getValue() << std::endl
|
||||
<< "\toutLoopPort2: " << sin->outLoopPort2.getValue() << std::endl;
|
||||
#include <algorithm>
|
||||
auto elemMin = std::min(sin->elements1Count.getValue(), sin->elements2Count.getValue());
|
||||
if (elemMin <= 0) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elemMin [" << elemMin << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->loopPort1.getValue() != elemMin) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPort1 [" << sin->loopPort1.getValue() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->loopPort2.getValue() != elemMin) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPort2 [" << sin->loopPort2.getValue() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->outPort1.getValue() != elemMin) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: outPort1 [" << sin->outPort1.getValue() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->outPort2.getValue() != elemMin) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: outPort2 [" << sin->outPort2.getValue() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->outLoopPort1.getValue() != elemMin) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: outLoopPort1 [" << sin->outLoopPort1.getValue() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->outLoopPort2.getValue() != elemMin) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: outLoopPort2 [" << sin->outLoopPort2.getValue() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->elements1orig.getSize() != sin->elements1Count.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements1orig collection size [" << sin->elements1orig.getSize() << "] is not equal elements1Count [" << sin->elements1Count.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\telements1orig: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->elements1orig.getSize(); t++) {
|
||||
if (sin->elements1orig.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements1orig collection value index [" << t << "] does not have correct value [" << sin->elements1orig.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->elements1orig.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
if (sin->elements2orig.getSize() != sin->elements2Count.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements2orig collection size [" << sin->elements2orig.getSize() << "] is not equal elements2Count [" << sin->elements2Count.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\telements2orig: [ ";
|
||||
isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->elements2orig.getSize(); t++) {
|
||||
if (sin->elements2orig.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements2orig collection value index [" << t << "] does not have correct value [" << sin->elements2orig.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->elements2orig.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
if (sin->elements1in.getSize() != elemMin) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements1in collection size [" << sin->elements1in.getSize() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\telements1in: [ ";
|
||||
isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->elements1in.getSize(); t++) {
|
||||
if (sin->elements1in.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements1in collection value index [" << t << "] does not have correct value [" << sin->elements1in.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->elements1in.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
if (sin->elements2in.getSize() != elemMin) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements2in collection size [" << sin->elements2in.getSize() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\telements2in: [ ";
|
||||
isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->elements2in.getSize(); t++) {
|
||||
if (sin->elements2in.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements2in collection value index [" << t << "] does not have correct value [" << sin->elements2in.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->elements2in.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
if (sin->isOkUnion1.getSize() != elemMin) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOkUnion1 collection size [" << sin->isOkUnion1.getSize() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\tisOkUnion1: [ ";
|
||||
isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->isOkUnion1.getSize(); t++) {
|
||||
if (!sin->isOkUnion1.getEntryValue(t)) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOkUnion1 collection value index [" << t << "] does not have correct value [" << sin->isOkUnion1.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->isOkUnion1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
sout->elements1 = sin->elements1in;
|
||||
sout->elements2 = sin->elements2in;
|
||||
sout->isOK.setValue(true);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity2
|
||||
entries=1
|
||||
entry.0=atomic2.code
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
wfr::lwd::iwir_collection<wfr::lwd::_lwd_iwir_basetype_int, 1> elements1;
|
||||
elements1.init(4);
|
||||
elements1.setEntryValue(0, 1);
|
||||
elements1.setEntryValue(1, 2);
|
||||
elements1.setEntryValue(2, 3);
|
||||
elements1.setEntryValue(3, 4);
|
||||
elements1.setFinalised(true);
|
||||
wfr::lwd::iwir_collection<wfr::lwd::_lwd_iwir_basetype_int, 1> elements2;
|
||||
elements2.init(5);
|
||||
elements2.setEntryValue(0, 1);
|
||||
elements2.setEntryValue(1, 2);
|
||||
elements2.setEntryValue(2, 3);
|
||||
elements2.setEntryValue(3, 4);
|
||||
elements2.setEntryValue(4, 5);
|
||||
elements2.setFinalised(true);
|
||||
wfInput.elements1Count.setValue(elements1.getSize());
|
||||
wfInput.gelements1 = elements1;
|
||||
wfInput.elements2Count.setValue(elements2.getSize());
|
||||
wfInput.gelements2 = elements2;
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
std::cout << "wfOutput:" << std::endl
|
||||
<< "\tisOk: " << wfOutput.isOK.getValue() << std::endl;
|
||||
if (!wfOutput.isOK.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOk [" << wfOutput.isOK.getValue() << "] is not true.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
#include <algorithm>
|
||||
auto elemMin = std::min(wfInput.elements1Count.getValue(), wfInput.elements2Count.getValue());
|
||||
if (elemMin <= 0) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elemMin [" << elemMin << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (wfOutput.elements1.getSize() != elemMin) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements1 collection size [" << wfOutput.elements1.getSize() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\telements1: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < wfOutput.elements1.getSize(); t++) {
|
||||
if (wfOutput.elements1.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements1 collection value index [" << t << "] does not have correct value [" << wfOutput.elements1.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << wfOutput.elements1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
if (wfOutput.elements2.getSize() != elemMin) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements2 collection size [" << wfOutput.elements2.getSize() << "] is not equal elemMin [" << elemMin << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\telements2: [ ";
|
||||
isFirst = true;
|
||||
for (wfr_id_t t = 0; t < wfOutput.elements2.getSize(); t++) {
|
||||
if (wfOutput.elements2.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: elements2 collection value index [" << t << "] does not have correct value [" << wfOutput.elements2.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << wfOutput.elements2.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
wfinput=if1/wfInput.code
|
||||
wfoutput=if1/wfOutput.code
|
||||
includes=if1/includes.code
|
||||
|
||||
atomicTask.0=if1/atomic1.properties
|
||||
atomicTask.1=if1/atomic2.properties
|
||||
atomicTask.2=if1/atomic3.properties
|
||||
atomicTask.3=if1/atomic4.properties
|
||||
atomicTask.4=if1/atomic5.properties
|
||||
atomicTask.5=if1/atomic6.properties
|
||||
atomicTask.6=if1/atomic7.properties
|
||||
atomicTask.7=if1/atomic8.properties
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
sout->if1condOut.setValue(sin->if1cond.getValue());
|
||||
sout->if1ValueOut.setValue(sin->if1Value.getValue());
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity1
|
||||
entries=1
|
||||
entry.0=atomic1.code
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
std::cout << "AtomicActivity2:" << std::endl
|
||||
<< "\tif1cond: " << sin->if1cond.getValue() << std::endl
|
||||
<< "\tif1value: " << sin->if1Value.getValue() << std::endl;
|
||||
if (!sin->if1cond.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if1cond [" << sin->if1cond.getValue() << "] is not true.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->if1Value.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if1Value [" << sin->if1Value.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->if1ValueOut.setValue(2);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity2
|
||||
entries=1
|
||||
entry.0=atomic2.code
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
std::cout << "AtomicActivity3:" << std::endl
|
||||
<< "\tif1cond: " << sin->if1Cond.getValue() << std::endl
|
||||
<< "\tif1value: " << sin->if1Value.getValue() << std::endl;
|
||||
if (sin->if1Cond.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if1cond [" << sin->if1Cond.getValue() << "] is not false.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->if1Value.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if1Value [" << sin->if1Value.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->if1ValueOut.setValue(3);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity3
|
||||
entries=1
|
||||
entry.0=atomic3.code
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
std::cout << "AtomicActivity4:" << std::endl
|
||||
<< "\tif2cond: " << sin->if2cond.getValue() << std::endl
|
||||
<< "\tif2value: " << sin->if2value.getValue() << std::endl;
|
||||
if (!sin->if2cond.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if2cond [" << sin->if2cond.getValue() << "] is not true.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->if2value.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if2Value [" << sin->if2value.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->if2valueOut.setValue(4);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity4
|
||||
entries=1
|
||||
entry.0=atomic4.code
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
std::cout << "AtomicActivity5:" << std::endl
|
||||
<< "\tif1cond: " << sin->if1cond.getValue() << std::endl
|
||||
<< "\tif2cond: " << sin->if2cond.getValue() << std::endl
|
||||
<< "\tif3cond: " << sin->if3cond.getValue() << std::endl
|
||||
<< "\tif4cond: " << sin->if4cond.getValue() << std::endl
|
||||
<< "\tif1valueOrig: " << sin->if1valueOrig.getValue() << std::endl
|
||||
<< "\tif1valueOut: " << sin->if1valueOut.getValue() << std::endl
|
||||
<< "\tif2valueOrig: " << sin->if2valueOrig.getValue() << std::endl
|
||||
<< "\tif2valueOut: " << sin->if2valueOut.getValue() << std::endl;
|
||||
if (sin->if1valueOrig.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if1valueOrig [" << sin->if1valueOrig.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->if2valueOrig.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if2valueOrig [" << sin->if2valueOrig.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->if1cond.getValue() && sin->if1valueOut.getValue() != 2) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if1valueOut [" << sin->if1valueOut.getValue() << "] is not 2.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
} else if (!sin->if1cond.getValue() && sin->if1valueOut.getValue() != 3) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if1valueOut [" << sin->if1valueOut.getValue() << "] is not 3.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->if2cond.getValue() && sin->if2valueOut.getValue() != 4) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if2valueOut [" << sin->if2valueOut.getValue() << "] is not 4.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
} else if (!sin->if2cond.getValue() && sin->if2valueOut.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if2valueOut [" << sin->if2valueOut.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->if3condOut.setValue(sin->if3cond.getValue());
|
||||
sout->if4condOut.setValue(sin->if4cond.getValue());
|
||||
sout->isOk.setValue(true);
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity5
|
||||
entries=1
|
||||
entry.0=atomic5.code
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
std::cout << "AtomicActivity6:" << std::endl
|
||||
<< "\tif3cond: " << sin->if3cond.getValue() << std::endl
|
||||
<< "\tif3value: " << sin->if3value.getValue() << std::endl;
|
||||
if (sin->if3cond.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if3cond [" << sin->if3cond.getValue() << "] is not false.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->if3value.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if3Value [" << sin->if3value.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->if3valueOut.setValue(6);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity6
|
||||
entries=1
|
||||
entry.0=atomic6.code
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
std::cout << "AtomicActivity7:" << std::endl
|
||||
<< "\tif4cond: " << sin->if4cond.getValue() << std::endl
|
||||
<< "\tif4value: " << sin->if4value.getValue() << std::endl;
|
||||
if (!sin->if4cond.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if4cond [" << sin->if4cond.getValue() << "] is not true.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->if4value.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if4Value [" << sin->if4value.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->if4valueOut.setValue(7);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity7
|
||||
entries=1
|
||||
entry.0=atomic7.code
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
std::cout << "AtomicActivity8:" << std::endl
|
||||
<< "\tif3cond: " << sin->if3cond.getValue() << std::endl
|
||||
<< "\tif4cond: " << sin->if4cond.getValue() << std::endl
|
||||
<< "\tif3valueOrig: " << sin->if3valueOrig.getValue() << std::endl
|
||||
<< "\tif3valueOut: " << sin->if3valueOut.getValue() << std::endl
|
||||
<< "\tif4valueOrig: " << sin->if4valueOrig.getValue() << std::endl
|
||||
<< "\tif4valueOut: " << sin->if4ValueOut.getValue() << std::endl;
|
||||
if (sin->if3valueOrig.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if3valueOrig [" << sin->if3valueOrig.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->if4valueOrig.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if4valueOrig [" << sin->if4valueOrig.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->if3cond.getValue() && sin->if3valueOut.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if3valueOut [" << sin->if3valueOut.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
} else if (!sin->if3cond.getValue() && sin->if3valueOut.getValue() != 6) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if3valueOut [" << sin->if3valueOut.getValue() << "] is not 6.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->if4cond.getValue() && sin->if4ValueOut.getValue() != 7) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if4valueOut [" << sin->if4ValueOut.getValue() << "] is not 7.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
} else if (!sin->if4cond.getValue() && sin->if4ValueOut.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if4valueOut [" << sin->if4ValueOut.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->isOk.setValue(true);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity8
|
||||
entries=1
|
||||
entry.0=atomic8.code
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#include <boost/program_options.hpp>
|
||||
#include <thread>
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
|
||||
bool isHelp = false;
|
||||
bool if1Cond = true;
|
||||
bool if2Cond = true;
|
||||
bool if3Cond = true;
|
||||
bool if4Cond = true;
|
||||
boost::program_options::options_description opts("if1 Options");
|
||||
opts.add_options()
|
||||
("help", "Print help message.")
|
||||
("if1", boost::program_options::value<bool>(), "if1 condition")
|
||||
("if2", boost::program_options::value<bool>(), "if2 condition")
|
||||
("if3", boost::program_options::value<bool>(), "if3 condition")
|
||||
("if4", boost::program_options::value<bool>(), "if4 condition");
|
||||
boost::program_options::variables_map vm;
|
||||
auto parsed = boost::program_options::command_line_parser(argc, argv).options(opts).allow_unregistered().run();
|
||||
boost::program_options::store(parsed, vm);
|
||||
boost::program_options::notify(vm);
|
||||
if (vm.count("help")) {
|
||||
std::cerr << opts << std::endl;
|
||||
isHelp = true;
|
||||
} else {
|
||||
if (vm.count("if1")) {
|
||||
if1Cond = vm["if1"].as<bool>();
|
||||
}
|
||||
if (vm.count("if2")) {
|
||||
if2Cond = vm["if2"].as<bool>();
|
||||
}
|
||||
if (vm.count("if3")) {
|
||||
if3Cond = vm["if3"].as<bool>();
|
||||
}
|
||||
if (vm.count("if4")) {
|
||||
if4Cond = vm["if4"].as<bool>();
|
||||
}
|
||||
std::cerr << "if1 = " << if1Cond << std::endl;
|
||||
std::cerr << "if2 = " << if2Cond << std::endl;
|
||||
std::cerr << "if3 = " << if3Cond << std::endl;
|
||||
std::cerr << "if4 = " << if4Cond << std::endl;
|
||||
}
|
||||
wfInput.if1cond.setValue(if1Cond);
|
||||
wfInput.if2cond.setValue(if2Cond);
|
||||
wfInput.if3cond.setValue(if3Cond);
|
||||
wfInput.if4cond.setValue(if4Cond);
|
||||
wfInput.if1Value.setValue(-1);
|
||||
wfInput.if2Value.setValue(-1);
|
||||
wfInput.if3Value.setValue(-1);
|
||||
wfInput.if4Value.setValue(-1);
|
||||
|
||||
Executable
+63
@@ -0,0 +1,63 @@
|
||||
std::cout << "wfOutput:" << std::endl
|
||||
<< "\tisOk1: " << wfOutput.isOk1.getValue() << std::endl
|
||||
<< "\tisOk2: " << wfOutput.isOk2.getValue() << std::endl
|
||||
<< "\tif1valueOut: " << wfOutput.if1valueOut.getValue() << std::endl
|
||||
<< "\tif2valueOut: " << wfOutput.if2ValueOut.getValue() << std::endl
|
||||
<< "\tif3valueOut: " << wfOutput.if3ValueOut.getValue() << std::endl
|
||||
<< "\tif4valueOut: " << wfOutput.if4ValueOut.getValue() << std::endl;
|
||||
if (wfOutput.isOk1.getValue() != true) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOk1 [" << wfOutput.isOk1.getValue() << "] is not true.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (wfOutput.isOk2.getValue() != true) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOk2 [" << wfOutput.isOk2.getValue() << "] is not true.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (wfInput.if1cond.getValue() && wfOutput.if1valueOut.getValue() != 2) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if1valueOut [" << wfOutput.if1valueOut.getValue() << "] is not 2.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
} else if (!wfInput.if1cond.getValue() && wfOutput.if1valueOut.getValue() != 3) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if1valueOut [" << wfOutput.if1valueOut.getValue() << "] is not 3.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (wfInput.if2cond.getValue() && wfOutput.if2ValueOut.getValue() != 4) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if2valueOut [" << wfOutput.if2ValueOut.getValue() << "] is not 4.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
} else if (!wfInput.if2cond.getValue() && wfOutput.if2ValueOut.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if2valueOut [" << wfOutput.if2ValueOut.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (wfInput.if3cond.getValue() && wfOutput.if3ValueOut.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if3valueOut [" << wfOutput.if3ValueOut.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
} else if (!wfInput.if3cond.getValue() && wfOutput.if3ValueOut.getValue() != 6) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if3valueOut [" << wfOutput.if3ValueOut.getValue() << "] is not 6.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (wfInput.if4cond.getValue() && wfOutput.if4ValueOut.getValue() != 7) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if4valueOut [" << wfOutput.if4ValueOut.getValue() << "] is not 7.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
} else if (!wfInput.if4cond.getValue() && wfOutput.if4ValueOut.getValue() != -1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: if4valueOut [" << wfOutput.if4ValueOut.getValue() << "] is not -1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
|
||||
wfinput=if2/wfInput.code
|
||||
wfoutput=if2/wfOutput.code
|
||||
|
||||
atomicTask.0=if2/atomic1.properties
|
||||
atomicTask.1=if2/atomic2.properties
|
||||
atomicTask.2=if2/atomic3.properties
|
||||
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
std::cout << "AtomicActivity1:" << std::endl
|
||||
<< "\tinput: " << sin->input.getValue() << std::endl;
|
||||
if (!sin->input.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: input [" << sin->input.getValue() << "] is not true.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->output.setValue(10);
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity1
|
||||
entries=1
|
||||
entry.0=atomic1.code
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
std::cout << "AtomicActivity2:" << std::endl
|
||||
<< "\tinput: " << sin->input.getValue() << std::endl;
|
||||
if (sin->input.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: input [" << sin->input.getValue() << "] is not false.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->output.setValue(-10);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity2
|
||||
entries=1
|
||||
entry.0=atomic2.code
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
std::cout << "AtomicActivity3:" << std::endl;
|
||||
if (sin->input.getSize() <= 0) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: input size [" << sin->input.getSize() << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->input.getSize() != sin->gIn1.getSize()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: input [" << sin->input.getSize() << "] and gIn1 [" << sin->gIn1.getSize() << "] differ in size.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\tgIn1: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->gIn1.getSize(); t++) {
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->gIn1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
std::cout << "\tinput: [ ";
|
||||
isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->input.getSize(); t++) {
|
||||
if ( (sin->gIn1.getEntryValue(t) && sin->input.getEntryValue(t) != 10) ||
|
||||
(!sin->gIn1.getEntryValue(t) && sin->input.getEntryValue(t) != -10) ) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: input [" << sin->input.getEntryValue(t) << "] and gIn1 [" << sin->gIn1.getEntryValue(t) << "] do not match.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->input.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
sout->isOk.setValue(true);
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity3
|
||||
entries=1
|
||||
entry.0=atomic3.code
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
wfr::lwd::iwir_collection<wfr::lwd::_lwd_iwir_basetype_bool, 1> elements1;
|
||||
elements1.init(8);
|
||||
elements1.setEntryValue(0, true);
|
||||
elements1.setEntryValue(1, false);
|
||||
elements1.setEntryValue(2, true);
|
||||
elements1.setEntryValue(3, false);
|
||||
elements1.setEntryValue(4, true);
|
||||
elements1.setEntryValue(5, false);
|
||||
elements1.setEntryValue(6, true);
|
||||
elements1.setEntryValue(7, false);
|
||||
elements1.setFinalised(true);
|
||||
wfInput.gIn1 = elements1;
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
std::cout << "wfOutput:" << std::endl
|
||||
<< "\tisOk: " << wfOutput.isOk.getValue() << std::endl;
|
||||
if (!wfOutput.isOk.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOk [" << wfOutput.isOk.getValue() << "] is not true.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
|
||||
wfinput=pfor1/wfInput.code
|
||||
wfoutput=pfor1/wfOutput.code
|
||||
|
||||
atomicTask.0=pfor1/atomic1.properties
|
||||
atomicTask.1=pfor1/atomic2.properties
|
||||
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
auto myiter = WFR_SELF_GETITERATIONID();
|
||||
std::cout << "AtomicActivity1 [" << myiter << "]:" << std::endl
|
||||
<< "\tin1: " << sin->in1.getValue() << std::endl
|
||||
<< "\tin2: " << sin->in2.getValue() << std::endl;
|
||||
#include <sstream>
|
||||
if (sin->in2.getValue() <= 0) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in2 value [" << sin->in2.getValue() << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter+1 != sin->in1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in1 value [" << sin->in1.getValue() << "] is not equal to iterationID+1 [" << myiter+1 << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->in1.getValue() > sin->in2.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in1 value [" << sin->in1.getValue() << "] is not less equal than in2 value [" << sin->in2.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->out1.setValue(sin->in1.getValue());
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity1
|
||||
entries=1
|
||||
entry.0=atomic1.code
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
std::cout << "AtomicActivity2:" << std::endl
|
||||
<< "\tin1: " << sin->in1.getValue() << std::endl;
|
||||
#include <sstream>
|
||||
if (sin->in1.getValue() <= 0) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in1 value [" << sin->in1.getValue() << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->in1.getValue() != sin->in2.getSize()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in2 collection size [" << sin->in2.getSize() << "] is not equal in1 [" << sin->in1.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\tin2: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->in2.getSize(); t++) {
|
||||
if (sin->in2.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in2 collection value index [" << t << "] does not has correct value [" << sin->in2.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->in2.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
sout->out1 = sin->in2;
|
||||
sout->isOk.setValue(true);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity2
|
||||
entries=1
|
||||
entry.0=atomic2.code
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
wfInput.iterationCount.setValue(4);
|
||||
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
std::cout << "wfOutput:" << std::endl
|
||||
<< "\tglobalOut1: " << wfOutput.globalOut1.getValue() << std::endl;
|
||||
if (!wfOutput.globalOut1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: globalOut1 [" << wfOutput.globalOut1.getValue() << "] is not true.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
|
||||
if (wfOutput.globalOut2.getSize() != wfInput.iterationCount.getValue()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: globalOut2 collection size [" << wfOutput.globalOut2.getSize() << "] is not equal iterationCount [" << wfInput.iterationCount.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\tglobalOut2: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < wfOutput.globalOut2.getSize(); t++) {
|
||||
if (wfOutput.globalOut2.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: globalOut2 collection value index [" << t << "] does not have correct value [" << wfOutput.globalOut2.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << wfOutput.globalOut2.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
|
||||
wfinput=pforeach1/wfInput.code
|
||||
wfoutput=pforeach1/wfOutput.code
|
||||
|
||||
atomicTask.0=pforeach1/atomic1.properties
|
||||
atomicTask.1=pforeach1/atomic2.properties
|
||||
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
auto myiter = WFR_SELF_GETITERATIONID();
|
||||
std::cout << "AtomicActivity1 [" << myiter << "]:" << std::endl
|
||||
<< "\tin1: " << sin->in1.getValue() << std::endl
|
||||
<< "\tin2: " << sin->in2.getValue() << std::endl;
|
||||
#include <sstream>
|
||||
if (sin->in2.getValue() <= 0) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in2 value [" << sin->in2.getValue() << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (myiter+1 != sin->in1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in1 value [" << sin->in1.getValue() << "] is not equal to iterationID+1 [" << myiter+1 << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->in1.getValue() > sin->in2.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in1 value [" << sin->in1.getValue() << "] is not less/equal than in2 value [" << sin->in2.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->out1.setValue(sin->in1.getValue());
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity1
|
||||
entries=1
|
||||
entry.0=atomic1.code
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
std::cout << "AtomicActivity2:" << std::endl
|
||||
<< "\tin2: " << sin->in2.getValue() << std::endl;
|
||||
#include <sstream>
|
||||
if (sin->in2.getValue() <= 0) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in2 value [" << sin->in2.getValue() << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->in2.getValue() != sin->in1.getSize()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in1 collection size [" << sin->in1.getSize() << "] is not equal in2 [" << sin->in2.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\tin1: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < sin->in1.getSize(); t++) {
|
||||
if (sin->in1.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in1 collection value index [" << t << "] does not have correct value [" << sin->in1.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << sin->in1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
sout->out1 = sin->in1;
|
||||
sout->isOk.setValue(true);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity2
|
||||
entries=1
|
||||
entry.0=atomic2.code
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
wfr::lwd::iwir_collection<wfr::lwd::_lwd_iwir_basetype_int, 1> elements1;
|
||||
elements1.init(4);
|
||||
elements1.setEntryValue(0, 1);
|
||||
elements1.setEntryValue(1, 2);
|
||||
elements1.setEntryValue(2, 3);
|
||||
elements1.setEntryValue(3, 4);
|
||||
elements1.setFinalised(true);
|
||||
wfInput.globalIn1 = elements1;
|
||||
wfInput.globalIn2.setValue(elements1.getSize());
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
std::cout << "wfOutput:" << std::endl
|
||||
<< "\tisOK: " << wfOutput.isOK.getValue() << std::endl;
|
||||
if (!wfOutput.isOK.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: isOK [" << wfOutput.isOK.getValue() << "] is not true.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
|
||||
if (wfOutput.globalOut1.getSize() != wfInput.globalIn1.getSize()) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: globalOut1 collection size [" << wfOutput.globalOut1.getSize() << "] is not equal globalIn1 size [" << wfInput.globalIn1.getSize() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
std::cout << "\tglobalOut1: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < wfOutput.globalOut1.getSize(); t++) {
|
||||
if (wfOutput.globalOut1.getEntryValue(t) != wfInput.globalIn1.getEntryValue(t)) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: globalOut1 collection value index [" << t << "] does not have correct value [" << wfOutput.globalOut1.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << wfOutput.globalOut1.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
|
||||
includes=sparselu/includes.code
|
||||
|
||||
atomicTask.0=sparselu/atomic1.properties
|
||||
atomicTask.1=sparselu/atomic2.properties
|
||||
atomicTask.2=sparselu/atomic3.properties
|
||||
atomicTask.3=sparselu/atomic4.properties
|
||||
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
float** BENCH = sin->BENCH.getValue();
|
||||
int bots_arg_size = sin->bots_arg_size.getValue();
|
||||
int kk = sin->kk.getValue();
|
||||
lu0(BENCH[kk*bots_arg_size+kk]);
|
||||
sout->BENCHout.setValue(BENCH);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=lu0
|
||||
entries=1
|
||||
entry.0=atomic1.code
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
float** BENCH = sin->BENCH.getValue();
|
||||
int bots_arg_size = sin->bots_arg_size.getValue();
|
||||
int kk = sin->kk.getValue();
|
||||
int tmax = sin->tmax.getValue();
|
||||
int t = sin->tindex.getValue();
|
||||
int itercount = bots_arg_size - (kk+1);
|
||||
int iterslice = itercount / (tmax+1);
|
||||
int start = kk+1 + iterslice*t;
|
||||
int stop = kk+1 + iterslice*(t+1);
|
||||
if (t == tmax-1 && stop != bots_arg_size) {
|
||||
stop = bots_arg_size;
|
||||
}
|
||||
for (int jj=start; jj<stop; jj++)
|
||||
if (BENCH[kk*bots_arg_size+jj] != NULL) {
|
||||
fwd(BENCH[kk*bots_arg_size+kk], BENCH[kk*bots_arg_size+jj]);
|
||||
}
|
||||
sout->BENCHout.setValue(BENCH);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=fwd
|
||||
entries=1
|
||||
entry.0=atomic2.code
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
float** BENCH = sin->BENCH.getEntryValue(0);
|
||||
int bots_arg_size = sin->bots_arg_size.getValue();
|
||||
int kk = sin->kk.getValue();
|
||||
int tmax = sin->tmax.getValue();
|
||||
int t = sin->tindex.getValue();
|
||||
int itercount = bots_arg_size - (kk+1);
|
||||
int iterslice = itercount / (tmax+1);
|
||||
int start = kk+1 + iterslice*t;
|
||||
int stop = kk+1 + iterslice*(t+1);
|
||||
if (t == tmax-1 && stop != bots_arg_size) {
|
||||
stop = bots_arg_size;
|
||||
}
|
||||
for (int ii=start; ii<stop; ii++) {
|
||||
if (BENCH[ii*bots_arg_size+kk] != NULL) {
|
||||
bdiv (BENCH[kk*bots_arg_size+kk], BENCH[ii*bots_arg_size+kk]);
|
||||
}
|
||||
}
|
||||
sout->BENCHout.setValue(BENCH);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=bdiv
|
||||
entries=1
|
||||
entry.0=atomic3.code
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
float** BENCH = sin->BENCH.getEntryValue(0);
|
||||
int bots_arg_size = sin->bots_arg_size.getValue();
|
||||
int kk = sin->kk.getValue();
|
||||
int tmax = sin->tmax.getValue();
|
||||
int t = sin->tindex.getValue();
|
||||
int itercount = bots_arg_size - (kk+1);
|
||||
int iterslice = itercount / (tmax+1);
|
||||
int start = kk+1 + iterslice*t;
|
||||
int stop = kk+1 + iterslice*(t+1);
|
||||
if (t == tmax-1 && stop != bots_arg_size) {
|
||||
stop = bots_arg_size;
|
||||
}
|
||||
for (int ii=start; ii<stop; ii++)
|
||||
if (BENCH[ii*bots_arg_size+kk] != NULL)
|
||||
for (int jj=kk+1; jj<bots_arg_size; jj++)
|
||||
if (BENCH[kk*bots_arg_size+jj] != NULL)
|
||||
//#pragma omp task untied firstprivate(kk, jj, ii) shared(BENCH)
|
||||
{
|
||||
if (BENCH[ii*bots_arg_size+jj]==NULL) BENCH[ii*bots_arg_size+jj] = allocate_clean_block();
|
||||
bmod(BENCH[ii*bots_arg_size+kk], BENCH[kk*bots_arg_size+jj], BENCH[ii*bots_arg_size+jj]);
|
||||
}
|
||||
sout->BENCHout.setValue(BENCH);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=bmod
|
||||
entries=1
|
||||
entry.0=atomic4.code
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
#include "sparselu.h"
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
|
||||
wfinput=wavefront/wfInput.code
|
||||
wfoutput=wavefront/wfOutput.code
|
||||
includes=wavefront/includes.code
|
||||
|
||||
atomicTask.0=wavefront/atomic1.properties
|
||||
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#define Idx2D(x, y) (x)*(N+1)+(y)
|
||||
double* mat_a = sin->mat_a.getValue();
|
||||
long chunksize = sin->chunksize.getValue();
|
||||
long N = sin->N.getValue();
|
||||
long i_min = sin->i.getValue();
|
||||
long i_max = std::min(i_min + chunksize, 2*N-2);
|
||||
//fprintf(stderr, "i = [%d, %d)\n", i_min, i_max);
|
||||
for(long i=i_min; i<i_max; ++i) {
|
||||
if(i<N) {
|
||||
for(long j=1; j<=i; ++j) {
|
||||
long x = i-j+1;
|
||||
double old = mat_a[Idx2D(x, j)];
|
||||
mat_a[Idx2D(x, j)] = 0.8*old + 0.2*0.25*mat_a[Idx2D(x-1, j)]*mat_a[Idx2D(x+1, j)]*mat_a[Idx2D(x, j-1)]*mat_a[Idx2D(x, j+1)];
|
||||
}
|
||||
} else {
|
||||
for(long j=i-N+2; j<N; ++j) {
|
||||
long x = i-j+1;
|
||||
double old = mat_a[Idx2D(x, j)];
|
||||
mat_a[Idx2D(x, j)] = 0.9*old + 0.1*0.25*mat_a[Idx2D(x-1, j)]*mat_a[Idx2D(x+1, j)]*mat_a[Idx2D(x, j-1)]*mat_a[Idx2D(x, j+1)];
|
||||
}
|
||||
}
|
||||
}
|
||||
sout->result.setValue(mat_a);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity
|
||||
entries=1
|
||||
entry.0=atomic1.code
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#include <omp.h>
|
||||
#include <boost/program_options.hpp>
|
||||
Executable
+63
@@ -0,0 +1,63 @@
|
||||
long N = 2000;
|
||||
long iterMax = 100;
|
||||
long chunksize = -1;
|
||||
bool isHelp = false;
|
||||
bool disableCheck = false;
|
||||
boost::program_options::options_description opts("Wavefront Options");
|
||||
opts.add_options()
|
||||
("help", "Print help message.")
|
||||
("itermax", boost::program_options::value<long>(), "Iteration count.")
|
||||
("n", boost::program_options::value<long>(), "Array size (n+1 x n+1).")
|
||||
("chunksize", boost::program_options::value<long>(), "Chunk size.")
|
||||
("disable-check", "Don't check for correctness.");
|
||||
boost::program_options::variables_map vm;
|
||||
auto parsed = boost::program_options::command_line_parser(argc, argv).options(opts).allow_unregistered().run();
|
||||
boost::program_options::store(parsed, vm);
|
||||
boost::program_options::notify(vm);
|
||||
if (vm.count("help")) {
|
||||
std::cerr << opts << std::endl;
|
||||
isHelp = true;
|
||||
} else {
|
||||
if (vm.count("itermax")) {
|
||||
iterMax = vm["itermax"].as<long>();
|
||||
}
|
||||
if (vm.count("n")) {
|
||||
N = vm["n"].as<long>();
|
||||
}
|
||||
if (vm.count("chunksize")) {
|
||||
chunksize = vm["chunksize"].as<long>();
|
||||
}
|
||||
if (vm.count("disable-check")) {
|
||||
disableCheck = true;
|
||||
}
|
||||
}
|
||||
long _2N2 = 2*N-2;
|
||||
if (chunksize <= 0) {
|
||||
chunksize = (_2N2/8)+1;
|
||||
}
|
||||
if (!isHelp) {
|
||||
std::cerr << "itermax = " << iterMax << std::endl;
|
||||
std::cerr << "N = " << N << std::endl;
|
||||
std::cerr << "chunksize = " << chunksize << std::endl;
|
||||
if (disableCheck) {
|
||||
std::cerr << "disableCheck = true" << std::endl;
|
||||
} else {
|
||||
std::cerr << "disableCheck = false" << std::endl;
|
||||
}
|
||||
}
|
||||
wfInput.iterMax.setValue(iterMax);
|
||||
wfInput.N.setValue(N);
|
||||
wfInput._2N2.setValue(_2N2);
|
||||
wfInput.chunksize.setValue(chunksize);
|
||||
#define Idx2D(x, y) (x)*(N+1)+(y)
|
||||
double* mat_a = (double*)malloc(sizeof(double)*(N+1)*(N+1));
|
||||
double* mat_b = (double*)malloc(sizeof(double)*(N+1)*(N+1));
|
||||
//srand(time(NULL));
|
||||
srand(20);
|
||||
for(int i=0; i<N; ++i) {
|
||||
for(int j=0; j<N; ++j) {
|
||||
mat_a[Idx2D(i, j)] = ((double)(rand() % 100) / (double)RAND_MAX) * 1000000.0;
|
||||
mat_b[Idx2D(i, j)] = mat_a[Idx2D(i, j)];
|
||||
}
|
||||
}
|
||||
wfInput.mat_a.setValue(mat_a);
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
if (!disableCheck) {
|
||||
double t = omp_get_wtime();
|
||||
omp_set_schedule(omp_sched_dynamic, chunksize);
|
||||
#pragma omp parallel
|
||||
for(int iter=0; iter<iterMax; ++iter) {
|
||||
//#pragma omp for schedule(dynamic,32)
|
||||
#pragma omp for schedule(runtime)
|
||||
for(int i=1; i<2*N-2; ++i) {
|
||||
if(i<N) {
|
||||
for(int j=1; j<=i; ++j) {
|
||||
int x = i-j+1;
|
||||
double old = mat_b[Idx2D(x, j)];
|
||||
mat_b[Idx2D(x, j)] = 0.8*old + 0.2*0.25*mat_b[Idx2D(x-1, j)]*mat_b[Idx2D(x+1, j)]*mat_b[Idx2D(x, j-1)]*mat_b[Idx2D(x, j+1)];
|
||||
}
|
||||
} else {
|
||||
for(int j=i-N+2; j<N; ++j) {
|
||||
int x = i-j+1;
|
||||
double old = mat_b[Idx2D(x, j)];
|
||||
mat_b[Idx2D(x, j)] = 0.9*old + 0.1*0.25*mat_b[Idx2D(x-1, j)]*mat_b[Idx2D(x+1, j)]*mat_b[Idx2D(x, j-1)]*mat_b[Idx2D(x, j+1)];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("OMP Complete: %8.4lf\n", omp_get_wtime()-t);
|
||||
int ok = 0;
|
||||
int nok = 0;
|
||||
int nan = 0;
|
||||
for (int i = 0; i < N; i++) {
|
||||
for (int j = 0; j < N; j++) {
|
||||
if (isnan(mat_a[Idx2D(i, j)]) || isinf(mat_a[Idx2D(i, j)]) || isnan(mat_b[Idx2D(i, j)]) || isinf(mat_b[Idx2D(i, j)])) {
|
||||
nan++;
|
||||
} else if (fabs(mat_a[Idx2D(i, j)] - mat_b[Idx2D(i, j)]) < (double)0.000001) {
|
||||
ok++;
|
||||
} else {
|
||||
//printf("diff[%d,%d]: %.40lf - %.40lf = %.40lf\n", i,j,mat_a[Idx2D(i, j)], mat_b[Idx2D(i, j)], mat_a[Idx2D(i, j)] - mat_b[Idx2D(i, j)]);
|
||||
nok++;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("nan: %d, ok: %d, nok: %d\n", nan, ok, nok);
|
||||
if (nok != 0) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: nok [" << nok << "] is not zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
}
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
|
||||
wfinput=while1/wfInput.code
|
||||
wfoutput=while1/wfOutput.code
|
||||
|
||||
atomicTask.0=while1/atomic1.properties
|
||||
atomicTask.1=while1/atomic2.properties
|
||||
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
auto myiter = WFR_SELF_GETITERATIONID();
|
||||
std::cout << "AtomicActivity1 [" << myiter << "]:" << std::endl
|
||||
<< "\titerCount: " << sin->iterCount.getValue() << std::endl
|
||||
<< "\tloopPortIn1: " << sin->loopPortIn1.getValue() << std::endl;
|
||||
#include <sstream>
|
||||
if (myiter != sin->loopPortIn1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: IterationID [" << myiter << "] does not match loopPortIn1 [" << sin->loopPortIn1.getValue()<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->iterCount.getValue() <= 0) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: iterCount [" << sin->iterCount.getValue() << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->iterCount.getValue() < sin->loopPortIn1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: loopPortIn1 [" << sin->loopPortIn1.getValue() << "] is greater than iterCount [" << sin->iterCount.getValue() << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->taskOut1.setValue(sin->loopPortIn1.getValue()+1);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity1
|
||||
entries=1
|
||||
entry.0=atomic1.code
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
std::cout << "AtomicActivity2:" << std::endl
|
||||
<< "\titerCount: " << sin->iterCount.getValue() << std::endl
|
||||
<< "\tin1: " << sin->in1.getValue() << std::endl
|
||||
<< "\tin3: " << sin->in3.getValue() << std::endl
|
||||
<< "\tin4: " << sin->in4.getValue() << std::endl;
|
||||
if (sin->iterCount.getValue() <= 0) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: iterCount [" << sin->iterCount.getValue() << "] is not greater than zero.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->iterCount.getValue()+1 != sin->in1.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in1 [" << sin->in1.getValue() << "] is not equal iterCount+1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->iterCount.getValue()+1 != sin->in3.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in3 [" << sin->in3.getValue() << "] is not equal iterCount+1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (sin->iterCount.getValue()+1 != sin->in4.getValue()) {
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: in4 [" << sin->in4.getValue() << "] is not equal iterCount+1.";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
sout->out1.setValue(sin->in1.getValue());
|
||||
sout->out2 = sin->in2;
|
||||
sout->isOK.setValue(true);
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
name=AtomicActivity2
|
||||
entries=1
|
||||
entry.0=atomic2.code
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
wfInput.iterationStart.setValue(0);
|
||||
wfInput.iterationCount.setValue(4);
|
||||
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
std::cout << "wfOutput:" << std::endl
|
||||
<< "\tglobalOut1: " << wfOutput.globalOut1.getValue() << std::endl
|
||||
<< "\tisOK: " << wfOutput.isOK.getValue() << std::endl;
|
||||
std::cout << "\tglobalOut2: [ ";
|
||||
bool isFirst = true;
|
||||
for (wfr_id_t t = 0; t < wfOutput.globalOut2.getSize(); t++) {
|
||||
if (wfOutput.globalOut2.getEntryValue(t) != t+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: globalOut2 collection value index [" << t << "] does not have correct value [" << wfOutput.globalOut2.getEntryValue(t)<< "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << wfOutput.globalOut2.getEntryValue(t);
|
||||
}
|
||||
std::cout << " ]" << std::endl;
|
||||
if (wfOutput.globalOut2.getSize() != wfInput.iterationCount.getValue()+1) {
|
||||
#include <sstream>
|
||||
std::stringstream ss;
|
||||
ss << "Test Failure: globalOut2 size [" << wfOutput.globalOut2.getSize() << "] is not equal iterationCount+1 [" << wfInput.iterationCount.getValue()+1 << "].";
|
||||
throw wfr::exception::wfr_fatal_error(ss.str());
|
||||
}
|
||||
Reference in New Issue
Block a user