Initial commit
This commit is contained in:
Executable
+87
@@ -0,0 +1,87 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(wfr-unittests C CXX)
|
||||
|
||||
# Compiler flags
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -DNDEBUG -Wall")
|
||||
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -DNDEBUG -Wall")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -Wall")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_DEBUG}")
|
||||
|
||||
# Find WFR-libraries
|
||||
if (NOT WFR_FOUND)
|
||||
if (NOT WFR_DIR)
|
||||
set(WFR_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../WFR-lib/dist")
|
||||
endif()
|
||||
find_package(WFR REQUIRED)
|
||||
endif()
|
||||
|
||||
# Find IWIR2WFR compiler
|
||||
if (NOT IWIR2WFR_FOUND)
|
||||
if (NOT IWIR2WFR_DIR)
|
||||
set(IWIR2WFR_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../IWIR2WFRcompiler/dist")
|
||||
endif()
|
||||
find_package(IWIR2WFR REQUIRED)
|
||||
endif()
|
||||
|
||||
# Where to find IWIR file and activity implementation repository
|
||||
set(IWIR_DIR "${CMAKE_CURRENT_SOURCE_DIR}/iwir")
|
||||
set(REPO_DIR "${CMAKE_CURRENT_SOURCE_DIR}/iwir/coderepo")
|
||||
|
||||
get_directory_property(hasParent PARENT_DIRECTORY)
|
||||
# Where to install the output
|
||||
if (NOT hasParent)
|
||||
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/dist")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Setup include dir
|
||||
include_directories(${WFR_INCLUDE_DIR})
|
||||
|
||||
# Wavefront needs OpenMP
|
||||
FIND_PACKAGE(OpenMP)
|
||||
if(OPENMP_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
# Enable C++11 support and ignore the Sparselu BOTS main
|
||||
ADD_DEFINITIONS( -std=c++11 -DSPARSELU_SKIP_BOTS_MAIN )
|
||||
|
||||
#
|
||||
# Convenience function for setting up individual unit-tests
|
||||
#
|
||||
function(add_wfr_utest utest_name add_inc)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${utest_name})
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${utest_name}/${utest_name}.cpp ${CMAKE_CURRENT_BINARY_DIR}/${utest_name}/${utest_name}.h
|
||||
COMMAND ${IWIR2WFR_EXE} -i ${IWIR_DIR}/${utest_name}.iwir -o ${CMAKE_CURRENT_BINARY_DIR}/${utest_name}/${utest_name} -skipmain -printir -repoconfig ${REPO_DIR}/${utest_name}.properties
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${utest_name}
|
||||
)
|
||||
add_executable(${utest_name}.bin ${CMAKE_CURRENT_BINARY_DIR}/${utest_name}/${utest_name}.cpp ${ARGN})
|
||||
target_include_directories(${utest_name}.bin PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/${utest_name} ${add_inc})
|
||||
target_link_libraries(${utest_name}.bin ${WFR_LIBRARIES})
|
||||
add_dependencies(${utest_name}.bin wfr_lib) # Otherwise we would have race conditions when compiling the parent project with -j
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${utest_name}/${utest_name}.cpp ${CMAKE_CURRENT_BINARY_DIR}/${utest_name}/${utest_name}.h DESTINATION ${CMAKE_INSTALL_PREFIX}/utests/${utest_name})
|
||||
install(TARGETS ${utest_name}.bin DESTINATION ${CMAKE_INSTALL_PREFIX}/utests/${utest_name})
|
||||
endfunction()
|
||||
|
||||
|
||||
#
|
||||
# Setup individual unit-tests
|
||||
#
|
||||
add_wfr_utest(for1 "")
|
||||
add_wfr_utest(foreach1 "")
|
||||
add_wfr_utest(if1 "")
|
||||
add_wfr_utest(if2 "")
|
||||
add_wfr_utest(pfor1 "")
|
||||
add_wfr_utest(pforeach1 "")
|
||||
add_wfr_utest(sparselu-wfr ${CMAKE_CURRENT_SOURCE_DIR}/src/sparselu ${CMAKE_CURRENT_SOURCE_DIR}/src/sparselu/sparselu_funcs.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/sparselu/bots_main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/sparselu/bots_common.cpp)
|
||||
if(OPENMP_FOUND)
|
||||
add_wfr_utest(wavefront "")
|
||||
endif()
|
||||
add_wfr_utest(while1 "")
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bin/unittests.sh PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_PREFIX}/utests)
|
||||
|
||||
Executable
+108
@@ -0,0 +1,108 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
if [ "$1" != "" ]; then
|
||||
BIN_BASE=$1
|
||||
else
|
||||
BIN_BASE="."
|
||||
fi
|
||||
|
||||
|
||||
if [ "$2" != "" ]; then
|
||||
LIBRARY_PATH=$2:$LD_LIBRARY_PATH
|
||||
else
|
||||
LIBRARY_PATH=../lib:$LD_LIBRARY_PATH
|
||||
fi
|
||||
|
||||
|
||||
|
||||
SUCCESS_COUNT=0
|
||||
FAILURE_COUNT=0
|
||||
TOTAL_COUNT=0
|
||||
|
||||
exec_test() {
|
||||
TIMELIMIT="$1"
|
||||
BINARY="$2"
|
||||
|
||||
PROLOG="Running $BINARY"
|
||||
echo ""
|
||||
echo -n -e "$PROLOG"
|
||||
|
||||
let TOTAL_COUNT=$TOTAL_COUNT+1
|
||||
OUTPUT=$(LD_LIBRARY_PATH=$LIBRARY_PATH timeout $TIMELIMIT ./$BINARY 1>/dev/null 2>&1)
|
||||
CODE=$?
|
||||
RESULT=""
|
||||
REASON=""
|
||||
|
||||
if [ $CODE -eq 0 ]; then
|
||||
RESULT="\e[1m\e[32mOk"
|
||||
let SUCCESS_COUNT=$SUCCESS_COUNT+1
|
||||
elif [ $CODE -eq 124 ]; then
|
||||
RESULT="\e[1m\e[31mFailure"
|
||||
REASON="Timeout"
|
||||
let FAILURE_COUNT=$FAILURE_COUNT+1
|
||||
elif [ $CODE -eq 134 ]; then
|
||||
RESULT="\e[1m\e[31mFailure"
|
||||
REASON="Exception"
|
||||
let FAILURE_COUNT=$FAILURE_COUNT+1
|
||||
else
|
||||
RESULT="\e[1m\e[31mFailure"
|
||||
REASON="Unknown"
|
||||
let FAILURE_COUNT=$FAILURE_COUNT+1
|
||||
fi
|
||||
|
||||
STATUSMSG=$RESULT
|
||||
if [ -n "$REASON" ]; then
|
||||
STATUSMSG="$STATUSMSG ($REASON)"
|
||||
fi
|
||||
STATUSMSG="$STATUSMSG\e[0m"
|
||||
blanks=" "
|
||||
echo -e "${blanks:0:${#width}-${#PROLOG}}$STATUSMSG"
|
||||
|
||||
if [ -n "$OUTPUT" ]; then
|
||||
echo -e "$OUTPUT"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Run unit tests
|
||||
exec_test 10 "$BIN_BASE/for1/for1.bin --early-evaluation"
|
||||
exec_test 10 "$BIN_BASE/for1/for1.bin --late-evaluation"
|
||||
exec_test 10 "$BIN_BASE/foreach1/foreach1.bin --early-evaluation"
|
||||
exec_test 10 "$BIN_BASE/foreach1/foreach1.bin --late-evaluation"
|
||||
exec_test 10 "$BIN_BASE/pfor1/pfor1.bin --early-evaluation"
|
||||
exec_test 10 "$BIN_BASE/pfor1/pfor1.bin --late-evaluation"
|
||||
exec_test 10 "$BIN_BASE/pforeach1/pforeach1.bin --early-evaluation"
|
||||
exec_test 10 "$BIN_BASE/pforeach1/pforeach1.bin --late-evaluation"
|
||||
exec_test 10 "$BIN_BASE/while1/while1.bin --early-evaluation"
|
||||
exec_test 10 "$BIN_BASE/while1/while1.bin --late-evaluation"
|
||||
exec_test 10 "$BIN_BASE/if1/if1.bin --early-evaluation"
|
||||
exec_test 10 "$BIN_BASE/if1/if1.bin --late-evaluation"
|
||||
exec_test 10 "$BIN_BASE/if2/if2.bin --early-evaluation"
|
||||
exec_test 10 "$BIN_BASE/if2/if2.bin --late-evaluation"
|
||||
#exec_test 30 "$BIN_BASE/wavefront/wavefront.bin --early-evaluation"
|
||||
#exec_test 30 "$BIN_BASE/wavefront/wavefront.bin --late-evaluation"
|
||||
#exec_test 260 "$BIN_BASE/sparselu/sparselu-wfr.bin -c --early-evaluation"
|
||||
#exec_test 260 "$BIN_BASE/sparselu/sparselu-wfr.bin -c --late-evaluation"
|
||||
#exec_test 260 "$BIN_BASE/sparselu-wfr/sparselu-wfr.bin --early-evaluation"
|
||||
#exec_test 260 "$BIN_BASE/sparselu-wfr/sparselu-wfr.bin --late-evaluation"
|
||||
|
||||
# Clean up
|
||||
rm -rf *.dot default.sqlite*
|
||||
|
||||
# Display summary
|
||||
|
||||
echo ""
|
||||
echo -e "\e[1mTotal number of tests: $TOTAL_COUNT\e[0m"
|
||||
echo -e "\e[1mNumber of successful tests: $SUCCESS_COUNT\e[0m"
|
||||
echo -e "\e[1mNumber of failed tests: $FAILURE_COUNT\e[0m"
|
||||
echo ""
|
||||
|
||||
# Return value
|
||||
|
||||
RETVAL=0
|
||||
if [ $FAILURE_COUNT -ne 0 ]; then
|
||||
RETVAL=1
|
||||
fi
|
||||
|
||||
exit $RETVAL
|
||||
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());
|
||||
}
|
||||
Executable
+95
@@ -0,0 +1,95 @@
|
||||
<IWIR version="1.1" wfname="UTest_FOR-1" xmlns="http://shiwa-workflow.eu/IWIR">
|
||||
<blockScope name="toplevel">
|
||||
<inputPorts>
|
||||
<inputPort name="iterationCount" type="integer">
|
||||
<properties>
|
||||
<property name="agwl-source" value="8"/>
|
||||
</properties>
|
||||
</inputPort>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<for name="For_1">
|
||||
<inputPorts>
|
||||
<inputPort name="iterCount" type="integer"/>
|
||||
<loopPorts>
|
||||
<loopPort name="forLoopPort1" type="integer"/>
|
||||
</loopPorts>
|
||||
<loopCounter name="ForCounter" from="1" to="" step="1"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<task name="AtomicActivity1" tasktype="AtomicActivity1">
|
||||
<inputPorts>
|
||||
<inputPort name="taskIn1" type="integer"/>
|
||||
<inputPort name="iterCount" type="integer"/>
|
||||
<inputPort name="loopPortIn1" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="taskOut1" type="integer"/>
|
||||
<outputPort name="isOK" type="boolean"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="forOut1" type="integer"/>
|
||||
<outputPort name="forOut2" type="integer"/>
|
||||
<unionPorts>
|
||||
<unionPort name="forOutUnion1" type="collection/integer"/>
|
||||
<unionPort name="isOkUnion1" type="collection/boolean"/>
|
||||
</unionPorts>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="For_1/forLoopPort1" to="AtomicActivity1/loopPortIn1"/>
|
||||
<link from="For_1/iterCount" to="AtomicActivity1/iterCount"/>
|
||||
<link from="For_1/ForCounter" to="AtomicActivity1/taskIn1"/>
|
||||
<link from="AtomicActivity1/taskOut1" to="For_1/forOutUnion1"/>
|
||||
<link from="AtomicActivity1/taskOut1" to="For_1/forOut1"/>
|
||||
<link from="AtomicActivity1/taskOut1" to="For_1/forLoopPort1"/>
|
||||
<link from="AtomicActivity1/isOK" to="For_1/isOkUnion1"/>
|
||||
<link from="For_1/forLoopPort1" to="For_1/forOut2"/>
|
||||
</links>
|
||||
</for>
|
||||
<task name="AtomicActivity2" tasktype="AtomicActivity2">
|
||||
<inputPorts>
|
||||
<inputPort name="iterCount" type="integer"/>
|
||||
<inputPort name="outPortIn1" type="integer"/>
|
||||
<inputPort name="outPortIn2" type="integer"/>
|
||||
<inputPort name="loopPortIn1" type="integer"/>
|
||||
<inputPort name="unionPortIn1" type="collection/integer"/>
|
||||
<inputPort name="isOkUnion1" type="collection/boolean"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="outPortOut1" type="integer"/>
|
||||
<outputPort name="loopPortOut1" type="integer"/>
|
||||
<outputPort name="unionPortOut1" type="collection/integer"/>
|
||||
<outputPort name="isOK" type="boolean"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="outPortOut1" type="integer"/>
|
||||
<outputPort name="loopPortOut1" type="integer"/>
|
||||
<outputPort name="unionPortOut1" type="collection/integer"/>
|
||||
<outputPort name="isOK" type="boolean"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="toplevel/iterationCount" to="For_1/iterCount"/>
|
||||
<link from="toplevel/iterationCount" to="For_1/ForCounter/to"/>
|
||||
<link from="toplevel/iterationCount" to="For_1/forLoopPort1"/>
|
||||
<link from="toplevel/iterationCount" to="AtomicActivity2/iterCount"/>
|
||||
<link from="For_1/forOut1" to="AtomicActivity2/outPortIn1"/>
|
||||
<link from="For_1/forOut2" to="AtomicActivity2/outPortIn2"/>
|
||||
<link from="For_1/forOutUnion1" to="AtomicActivity2/unionPortIn1"/>
|
||||
<link from="For_1/forLoopPort1" to="AtomicActivity2/loopPortIn1"/>
|
||||
<link from="For_1/isOkUnion1" to="AtomicActivity2/isOkUnion1"/>
|
||||
<link from="AtomicActivity2/isOK" to="toplevel/isOK"/>
|
||||
<link from="AtomicActivity2/outPortOut1" to="toplevel/outPortOut1"/>
|
||||
<link from="AtomicActivity2/loopPortOut1" to="toplevel/loopPortOut1"/>
|
||||
<link from="AtomicActivity2/unionPortOut1" to="toplevel/unionPortOut1"/>
|
||||
</links>
|
||||
<properties>
|
||||
<property name="version" value="1.0.0"/>
|
||||
<property name="author" value="matthias"/>
|
||||
<property name="domain" value="Generic"/>
|
||||
</properties>
|
||||
</blockScope>
|
||||
</IWIR>
|
||||
Executable
+127
@@ -0,0 +1,127 @@
|
||||
<IWIR version="1.1" wfname="UTest_ForEach-1" xmlns="http://shiwa-workflow.eu/IWIR">
|
||||
<blockScope name="toplevel">
|
||||
<inputPorts>
|
||||
<inputPort name="gelements1" type="collection/integer"/>
|
||||
<inputPort name="elements1Count" type="integer"/>
|
||||
<inputPort name="gelements2" type="collection/integer"/>
|
||||
<inputPort name="elements2Count" type="integer"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<forEach name="ForEach_1">
|
||||
<inputPorts>
|
||||
<inputPort name="elements1Count" type="integer"/>
|
||||
<inputPort name="elements2Count" type="integer"/>
|
||||
<loopPorts>
|
||||
<loopPort name="loopPort1" type="integer"/>
|
||||
<loopPort name="loopPort2" type="integer"/>
|
||||
</loopPorts>
|
||||
<loopElements>
|
||||
<loopElement name="elements1" type="collection/integer"/>
|
||||
<loopElement name="elements2" type="collection/integer"/>
|
||||
</loopElements>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<task name="AtomicActivity1" tasktype="AtomicActivity1">
|
||||
<inputPorts>
|
||||
<inputPort name="element1in" type="integer"/>
|
||||
<inputPort name="elements1Count" type="integer"/>
|
||||
<inputPort name="element2in" type="integer"/>
|
||||
<inputPort name="elements2Count" type="integer"/>
|
||||
<inputPort name="loopPort1" type="integer"/>
|
||||
<inputPort name="loopPort2" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="element1" type="integer"/>
|
||||
<outputPort name="element2" type="integer"/>
|
||||
<outputPort name="isOk" type="boolean"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="outPort1" type="integer"/>
|
||||
<outputPort name="outPort2" type="integer"/>
|
||||
<outputPort name="outLoopPort1" type="integer"/>
|
||||
<outputPort name="outLoopPort2" type="integer"/>
|
||||
<unionPorts>
|
||||
<unionPort name="unionPort1" type="collection/integer"/>
|
||||
<unionPort name="unionPort2" type="collection/integer"/>
|
||||
<unionPort name="isOkUnion1" type="collection/boolean"/>
|
||||
</unionPorts>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="ForEach_1/elements2" to="AtomicActivity1/element2in"/>
|
||||
<link from="ForEach_1/elements1" to="AtomicActivity1/element1in"/>
|
||||
<link from="ForEach_1/loopPort1" to="AtomicActivity1/loopPort1"/>
|
||||
<link from="ForEach_1/loopPort2" to="AtomicActivity1/loopPort2"/>
|
||||
<link from="ForEach_1/elements2Count" to="AtomicActivity1/elements2Count"/>
|
||||
<link from="ForEach_1/elements1Count" to="AtomicActivity1/elements1Count"/>
|
||||
<link from="ForEach_1/loopPort1" to="ForEach_1/outLoopPort1"/>
|
||||
<link from="ForEach_1/loopPort2" to="ForEach_1/outLoopPort2"/>
|
||||
<link from="AtomicActivity1/element1" to="ForEach_1/outPort1"/>
|
||||
<link from="AtomicActivity1/element2" to="ForEach_1/outPort2"/>
|
||||
<link from="AtomicActivity1/element1" to="ForEach_1/unionPort1"/>
|
||||
<link from="AtomicActivity1/element2" to="ForEach_1/unionPort2"/>
|
||||
<link from="AtomicActivity1/element2" to="ForEach_1/loopPort2"/>
|
||||
<link from="AtomicActivity1/element1" to="ForEach_1/loopPort1"/>
|
||||
<link from="AtomicActivity1/isOk" to="ForEach_1/isOkUnion1"/>
|
||||
</links>
|
||||
</forEach>
|
||||
<task name="AtomicActivity2" tasktype="AtomicActivity2">
|
||||
<inputPorts>
|
||||
<inputPort name="elements1orig" type="collection/integer"/>
|
||||
<inputPort name="elements1in" type="collection/integer"/>
|
||||
<inputPort name="elements1Count" type="integer"/>
|
||||
<inputPort name="elements2orig" type="collection/integer"/>
|
||||
<inputPort name="elements2in" type="collection/integer"/>
|
||||
<inputPort name="elements2Count" type="integer"/>
|
||||
<inputPort name="outPort1" type="integer"/>
|
||||
<inputPort name="outPort2" type="integer"/>
|
||||
<inputPort name="outLoopPort1" type="integer"/>
|
||||
<inputPort name="outLoopPort2" type="integer"/>
|
||||
<inputPort name="loopPort1" type="integer"/>
|
||||
<inputPort name="loopPort2" type="integer"/>
|
||||
<inputPort name="isOkUnion1" type="collection/boolean"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="elements1" type="collection/integer"/>
|
||||
<outputPort name="elements2" type="collection/integer"/>
|
||||
<outputPort name="isOK" type="boolean"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="elements1" type="collection/integer"/>
|
||||
<outputPort name="elements2" type="collection/integer"/>
|
||||
<outputPort name="isOK" type="boolean"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="toplevel/gelements1" to="ForEach_1/elements1"/>
|
||||
<link from="toplevel/elements2Count" to="ForEach_1/elements2Count"/>
|
||||
<link from="toplevel/elements1Count" to="ForEach_1/elements1Count"/>
|
||||
<link from="toplevel/gelements2" to="ForEach_1/elements2"/>
|
||||
<link from="toplevel/elements1Count" to="ForEach_1/loopPort1"/>
|
||||
<link from="toplevel/elements2Count" to="ForEach_1/loopPort2"/>
|
||||
<link from="toplevel/gelements1" to="AtomicActivity2/elements1orig"/>
|
||||
<link from="ForEach_1/outPort1" to="AtomicActivity2/outPort1"/>
|
||||
<link from="ForEach_1/outPort2" to="AtomicActivity2/outPort2"/>
|
||||
<link from="ForEach_1/outLoopPort1" to="AtomicActivity2/outLoopPort1"/>
|
||||
<link from="ForEach_1/outLoopPort2" to="AtomicActivity2/outLoopPort2"/>
|
||||
<link from="ForEach_1/loopPort1" to="AtomicActivity2/loopPort1"/>
|
||||
<link from="ForEach_1/loopPort2" to="AtomicActivity2/loopPort2"/>
|
||||
<link from="ForEach_1/isOkUnion1" to="AtomicActivity2/isOkUnion1"/>
|
||||
<link from="toplevel/elements2Count" to="AtomicActivity2/elements2Count"/>
|
||||
<link from="ForEach_1/unionPort1" to="AtomicActivity2/elements1in"/>
|
||||
<link from="ForEach_1/unionPort2" to="AtomicActivity2/elements2in"/>
|
||||
<link from="toplevel/elements1Count" to="AtomicActivity2/elements1Count"/>
|
||||
<link from="toplevel/gelements2" to="AtomicActivity2/elements2orig"/>
|
||||
<link from="AtomicActivity2/elements2" to="toplevel/elements2"/>
|
||||
<link from="AtomicActivity2/isOK" to="toplevel/isOK"/>
|
||||
<link from="AtomicActivity2/elements1" to="toplevel/elements1"/>
|
||||
</links>
|
||||
<properties>
|
||||
<property name="version" value="1.0.0"/>
|
||||
<property name="author" value="matthias"/>
|
||||
<property name="domain" value="Generic"/>
|
||||
</properties>
|
||||
</blockScope>
|
||||
</IWIR>
|
||||
Executable
+227
@@ -0,0 +1,227 @@
|
||||
<IWIR version="1.1" wfname="UTest_Conditional1" xmlns="http://shiwa-workflow.eu/IWIR">
|
||||
<blockScope name="toplevel">
|
||||
<inputPorts>
|
||||
<inputPort name="if1cond" type="boolean"/>
|
||||
<inputPort name="if2cond" type="boolean"/>
|
||||
<inputPort name="if3cond" type="boolean"/>
|
||||
<inputPort name="if4cond" type="boolean"/>
|
||||
<inputPort name="if1Value" type="integer"/>
|
||||
<inputPort name="if2Value" type="integer"/>
|
||||
<inputPort name="if3Value" type="integer"/>
|
||||
<inputPort name="if4Value" type="integer"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<task name="AtomicActivity1" tasktype="AtomicActivity1">
|
||||
<inputPorts>
|
||||
<inputPort name="if1cond" type="boolean"/>
|
||||
<inputPort name="if1Value" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="if1condOut" type="boolean"/>
|
||||
<outputPort name="if1ValueOut" type="integer"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
<if name="DecisionNode1">
|
||||
<inputPorts>
|
||||
<inputPort name="if1cond" type="boolean"/>
|
||||
<inputPort name="if1Value" type="integer"/>
|
||||
</inputPorts>
|
||||
<condition>if1cond = true</condition>
|
||||
<then>
|
||||
<task name="AtomicActivity2" tasktype="AtomicActivity2">
|
||||
<inputPorts>
|
||||
<inputPort name="if1cond" type="boolean"/>
|
||||
<inputPort name="if1Value" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="if1ValueOut" type="integer"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</then>
|
||||
<else>
|
||||
<task name="AtomicActivity3" tasktype="AtomicActivity3">
|
||||
<inputPorts>
|
||||
<inputPort name="if1Cond" type="boolean"/>
|
||||
<inputPort name="if1Value" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="if1ValueOut" type="integer"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</else>
|
||||
<outputPorts>
|
||||
<outputPort name="if1ValueOut" type="integer"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="DecisionNode1/if1Value" to="AtomicActivity2/if1Value"/>
|
||||
<link from="DecisionNode1/if1cond" to="AtomicActivity2/if1cond"/>
|
||||
<link from="DecisionNode1/if1cond" to="AtomicActivity3/if1Cond"/>
|
||||
<link from="DecisionNode1/if1Value" to="AtomicActivity3/if1Value"/>
|
||||
<link from="AtomicActivity2/if1ValueOut" to="DecisionNode1/if1ValueOut"/>
|
||||
<link from="AtomicActivity3/if1ValueOut" to="DecisionNode1/if1ValueOut"/>
|
||||
</links>
|
||||
</if>
|
||||
<if name="DecisionNode2">
|
||||
<inputPorts>
|
||||
<inputPort name="if2cond" type="boolean"/>
|
||||
<inputPort name="if2value" type="integer"/>
|
||||
</inputPorts>
|
||||
<condition>if2cond = true</condition>
|
||||
<then>
|
||||
<task name="AtomicActivity4" tasktype="AtomicActivity4">
|
||||
<inputPorts>
|
||||
<inputPort name="if2cond" type="boolean"/>
|
||||
<inputPort name="if2value" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="if2valueOut" type="integer"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</then>
|
||||
<outputPorts>
|
||||
<outputPort name="if2valueOut" type="integer"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="DecisionNode2/if2cond" to="AtomicActivity4/if2cond"/>
|
||||
<link from="DecisionNode2/if2value" to="AtomicActivity4/if2value"/>
|
||||
<link from="DecisionNode2/if2value" to="DecisionNode2/if2valueOut"/>
|
||||
<link from="AtomicActivity4/if2valueOut" to="DecisionNode2/if2valueOut"/>
|
||||
</links>
|
||||
</if>
|
||||
<task name="AtomicActivity5" tasktype="AtomicActivity5">
|
||||
<inputPorts>
|
||||
<inputPort name="if3cond" type="boolean"/>
|
||||
<inputPort name="if4cond" type="boolean"/>
|
||||
<inputPort name="if1cond" type="boolean"/>
|
||||
<inputPort name="if2cond" type="boolean"/>
|
||||
<inputPort name="if1valueOrig" type="integer"/>
|
||||
<inputPort name="if1valueOut" type="integer"/>
|
||||
<inputPort name="if2valueOrig" type="integer"/>
|
||||
<inputPort name="if2valueOut" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="if3condOut" type="boolean"/>
|
||||
<outputPort name="if4condOut" type="boolean"/>
|
||||
<outputPort name="isOk" type="boolean"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
<if name="DecisionNode4">
|
||||
<inputPorts>
|
||||
<inputPort name="if4cond" type="boolean"/>
|
||||
<inputPort name="if4value" type="integer"/>
|
||||
</inputPorts>
|
||||
<condition>if4cond = true</condition>
|
||||
<then>
|
||||
<task name="AtomicActivity7" tasktype="AtomicActivity7">
|
||||
<inputPorts>
|
||||
<inputPort name="if4cond" type="boolean"/>
|
||||
<inputPort name="if4value" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="if4valueOut" type="integer"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</then>
|
||||
<outputPorts>
|
||||
<outputPort name="if4valueOut" type="integer"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="DecisionNode4/if4value" to="AtomicActivity7/if4value"/>
|
||||
<link from="DecisionNode4/if4cond" to="AtomicActivity7/if4cond"/>
|
||||
<link from="AtomicActivity7/if4valueOut" to="DecisionNode4/if4valueOut"/>
|
||||
<link from="DecisionNode4/if4value" to="DecisionNode4/if4valueOut"/>
|
||||
</links>
|
||||
</if>
|
||||
<if name="DecisionNode3">
|
||||
<inputPorts>
|
||||
<inputPort name="if3cond" type="boolean"/>
|
||||
<inputPort name="if3value" type="integer"/>
|
||||
</inputPorts>
|
||||
<condition>if3cond = true</condition>
|
||||
<then/>
|
||||
<else>
|
||||
<task name="AtomicActivity6" tasktype="AtomicActivity6">
|
||||
<inputPorts>
|
||||
<inputPort name="if3cond" type="boolean"/>
|
||||
<inputPort name="if3value" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="if3valueOut" type="integer"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</else>
|
||||
<outputPorts>
|
||||
<outputPort name="if3valueOut" type="integer"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="DecisionNode3/if3cond" to="AtomicActivity6/if3cond"/>
|
||||
<link from="DecisionNode3/if3value" to="AtomicActivity6/if3value"/>
|
||||
<link from="DecisionNode3/if3value" to="DecisionNode3/if3valueOut"/>
|
||||
<link from="AtomicActivity6/if3valueOut" to="DecisionNode3/if3valueOut"/>
|
||||
</links>
|
||||
</if>
|
||||
<task name="AtomicActivity8" tasktype="AtomicActivity8">
|
||||
<inputPorts>
|
||||
<inputPort name="if3cond" type="boolean"/>
|
||||
<inputPort name="if4cond" type="boolean"/>
|
||||
<inputPort name="if3valueOrig" type="integer"/>
|
||||
<inputPort name="if3valueOut" type="integer"/>
|
||||
<inputPort name="if4valueOrig" type="integer"/>
|
||||
<inputPort name="if4ValueOut" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="isOk" type="boolean">
|
||||
<properties>
|
||||
<property name="agwl-saveto" value=""/>
|
||||
</properties>
|
||||
</outputPort>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="isOk1" type="boolean"/>
|
||||
<outputPort name="isOk2" type="boolean"/>
|
||||
<outputPort name="if1valueOut" type="integer"/>
|
||||
<outputPort name="if2ValueOut" type="integer"/>
|
||||
<outputPort name="if3ValueOut" type="integer"/>
|
||||
<outputPort name="if4ValueOut" type="integer"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="toplevel/if1Value" to="AtomicActivity1/if1Value"/>
|
||||
<link from="toplevel/if1cond" to="AtomicActivity1/if1cond"/>
|
||||
<link from="AtomicActivity1/if1condOut" to="DecisionNode1/if1cond"/>
|
||||
<link from="AtomicActivity1/if1ValueOut" to="DecisionNode1/if1Value"/>
|
||||
<link from="toplevel/if2cond" to="DecisionNode2/if2cond"/>
|
||||
<link from="toplevel/if2Value" to="DecisionNode2/if2value"/>
|
||||
<link from="toplevel/if1cond" to="AtomicActivity5/if1cond"/>
|
||||
<link from="toplevel/if2cond" to="AtomicActivity5/if2cond"/>
|
||||
<link from="DecisionNode2/if2valueOut" to="AtomicActivity5/if2valueOut"/>
|
||||
<link from="toplevel/if2Value" to="AtomicActivity5/if2valueOrig"/>
|
||||
<link from="DecisionNode1/if1ValueOut" to="AtomicActivity5/if1valueOut"/>
|
||||
<link from="toplevel/if3cond" to="AtomicActivity5/if3cond"/>
|
||||
<link from="toplevel/if1Value" to="AtomicActivity5/if1valueOrig"/>
|
||||
<link from="toplevel/if4cond" to="AtomicActivity5/if4cond"/>
|
||||
<link from="toplevel/if4Value" to="DecisionNode4/if4value"/>
|
||||
<link from="AtomicActivity5/if4condOut" to="DecisionNode4/if4cond"/>
|
||||
<link from="toplevel/if3Value" to="DecisionNode3/if3value"/>
|
||||
<link from="AtomicActivity5/if3condOut" to="DecisionNode3/if3cond"/>
|
||||
<link from="toplevel/if4Value" to="AtomicActivity8/if4valueOrig"/>
|
||||
<link from="toplevel/if3Value" to="AtomicActivity8/if3valueOrig"/>
|
||||
<link from="AtomicActivity5/if3condOut" to="AtomicActivity8/if3cond"/>
|
||||
<link from="DecisionNode4/if4valueOut" to="AtomicActivity8/if4ValueOut"/>
|
||||
<link from="AtomicActivity5/if4condOut" to="AtomicActivity8/if4cond"/>
|
||||
<link from="DecisionNode3/if3valueOut" to="AtomicActivity8/if3valueOut"/>
|
||||
<link from="DecisionNode2/if2valueOut" to="toplevel/if2ValueOut"/>
|
||||
<link from="DecisionNode4/if4valueOut" to="toplevel/if4ValueOut"/>
|
||||
<link from="DecisionNode3/if3valueOut" to="toplevel/if3ValueOut"/>
|
||||
<link from="DecisionNode1/if1ValueOut" to="toplevel/if1valueOut"/>
|
||||
<link from="AtomicActivity8/isOk" to="toplevel/isOk2"/>
|
||||
<link from="AtomicActivity5/isOk" to="toplevel/isOk1"/>
|
||||
</links>
|
||||
<properties>
|
||||
<property name="version" value="1.0.0"/>
|
||||
<property name="author" value="matthias"/>
|
||||
<property name="domain" value="Generic"/>
|
||||
</properties>
|
||||
</blockScope>
|
||||
</IWIR>
|
||||
Executable
+84
@@ -0,0 +1,84 @@
|
||||
<IWIR version="1.1" wfname="UTest_If2" xmlns="http://shiwa-workflow.eu/IWIR">
|
||||
<blockScope name="toplevel">
|
||||
<inputPorts>
|
||||
<inputPort name="gIn1" type="collection/boolean"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<parallelForEach name="For_1">
|
||||
<inputPorts>
|
||||
<loopElements>
|
||||
<loopElement name="elements" type="collection/boolean"/>
|
||||
</loopElements>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<if name="DecisionNode_1">
|
||||
<inputPorts>
|
||||
<inputPort name="input" type="boolean"/>
|
||||
</inputPorts>
|
||||
<condition>input = true</condition>
|
||||
<then>
|
||||
<task name="AtomicActivity1" tasktype="AtomicActivity1">
|
||||
<inputPorts>
|
||||
<inputPort name="input" type="boolean"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="output" type="integer"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</then>
|
||||
<else>
|
||||
<task name="AtomicActivity2" tasktype="AtomicActivity2">
|
||||
<inputPorts>
|
||||
<inputPort name="input" type="boolean"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="output" type="integer"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</else>
|
||||
<outputPorts>
|
||||
<outputPort name="output" type="integer"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="DecisionNode_1/input" to="AtomicActivity1/input"/>
|
||||
<link from="DecisionNode_1/input" to="AtomicActivity2/input"/>
|
||||
<link from="AtomicActivity2/output" to="DecisionNode_1/output"/>
|
||||
<link from="AtomicActivity1/output" to="DecisionNode_1/output"/>
|
||||
</links>
|
||||
</if>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="results" type="collection/integer"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="For_1/elements" to="DecisionNode_1/input"/>
|
||||
<link from="DecisionNode_1/output" to="For_1/results"/>
|
||||
</links>
|
||||
</parallelForEach>
|
||||
<task name="AtomicActivity3" tasktype="AtomicActivity3">
|
||||
<inputPorts>
|
||||
<inputPort name="input" type="collection/integer"/>
|
||||
<inputPort name="gIn1" type="collection/boolean"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="isOk" type="boolean"/>
|
||||
<outputPort name="results" type="collection/file"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="isOk" type="boolean"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="toplevel/gIn1" to="For_1/elements"/>
|
||||
<link from="For_1/results" to="AtomicActivity3/input"/>
|
||||
<link from="toplevel/gIn1" to="AtomicActivity3/gIn1"/>
|
||||
<link from="AtomicActivity3/isOk" to="toplevel/isOk"/>
|
||||
</links>
|
||||
<properties>
|
||||
<property name="version" value="1.0.0"/>
|
||||
<property name="author" value="matthias"/>
|
||||
<property name="domain" value="Generic"/>
|
||||
</properties>
|
||||
</blockScope>
|
||||
</IWIR>
|
||||
Executable
+65
@@ -0,0 +1,65 @@
|
||||
<IWIR version="1.1" wfname="UTest_PFor-1" xmlns="http://shiwa-workflow.eu/IWIR">
|
||||
<blockScope name="toplevel">
|
||||
<inputPorts>
|
||||
<inputPort name="iterationCount" type="integer">
|
||||
<properties>
|
||||
<property name="agwl-source" value="8"/>
|
||||
</properties>
|
||||
</inputPort>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<parallelFor name="ParallelFor_1">
|
||||
<inputPorts>
|
||||
<inputPort name="in2" type="integer"/>
|
||||
<loopCounter name="forCounter" from="1" to="" step="1"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<task name="AtomicActivity1" tasktype="AtomicActivity1">
|
||||
<inputPorts>
|
||||
<inputPort name="in1" type="integer"/>
|
||||
<inputPort name="in2" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="out1" type="integer"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="forOut1" type="collection/integer"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="ParallelFor_1/forCounter" to="AtomicActivity1/in1"/>
|
||||
<link from="ParallelFor_1/in2" to="AtomicActivity1/in2"/>
|
||||
<link from="AtomicActivity1/out1" to="ParallelFor_1/forOut1"/>
|
||||
</links>
|
||||
</parallelFor>
|
||||
<task name="AtomicActivity2" tasktype="AtomicActivity2">
|
||||
<inputPorts>
|
||||
<inputPort name="in1" type="integer"/>
|
||||
<inputPort name="in2" type="collection/integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="out1" type="collection/integer"/>
|
||||
<outputPort name="isOk" type="boolean"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="globalOut1" type="boolean"/>
|
||||
<outputPort name="globalOut2" type="collection/integer"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="toplevel/iterationCount" to="ParallelFor_1/in2"/>
|
||||
<link from="toplevel/iterationCount" to="ParallelFor_1/forCounter/to"/>
|
||||
<link from="toplevel/iterationCount" to="AtomicActivity2/in1"/>
|
||||
<link from="ParallelFor_1/forOut1" to="AtomicActivity2/in2"/>
|
||||
<link from="AtomicActivity2/isOk" to="toplevel/globalOut1"/>
|
||||
<link from="AtomicActivity2/out1" to="toplevel/globalOut2"/>
|
||||
</links>
|
||||
<properties>
|
||||
<property name="version" value="1.0.0"/>
|
||||
<property name="author" value="matthias"/>
|
||||
<property name="domain" value="Generic"/>
|
||||
</properties>
|
||||
</blockScope>
|
||||
</IWIR>
|
||||
Executable
+64
@@ -0,0 +1,64 @@
|
||||
<IWIR version="1.1" wfname="UTest_PForEach-1" xmlns="http://shiwa-workflow.eu/IWIR">
|
||||
<blockScope name="toplevel">
|
||||
<inputPorts>
|
||||
<inputPort name="globalIn1" type="collection/integer"/>
|
||||
<inputPort name="globalIn2" type="integer"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<parallelForEach name="ParallelForEach_1">
|
||||
<inputPorts>
|
||||
<inputPort name="in2" type="integer"/>
|
||||
<loopElements>
|
||||
<loopElement name="forElements1" type="collection/integer"/>
|
||||
</loopElements>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<task name="AtomicActivity1" tasktype="AtomicActivity1">
|
||||
<inputPorts>
|
||||
<inputPort name="in1" type="integer"/>
|
||||
<inputPort name="in2" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="out1" type="integer"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="forOut1" type="collection/integer"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="ParallelForEach_1/in2" to="AtomicActivity1/in2"/>
|
||||
<link from="ParallelForEach_1/forElements1" to="AtomicActivity1/in1"/>
|
||||
<link from="AtomicActivity1/out1" to="ParallelForEach_1/forOut1"/>
|
||||
</links>
|
||||
</parallelForEach>
|
||||
<task name="AtomicActivity2" tasktype="AtomicActivity2">
|
||||
<inputPorts>
|
||||
<inputPort name="in1" type="collection/integer"/>
|
||||
<inputPort name="in2" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="out1" type="collection/integer"/>
|
||||
<outputPort name="isOk" type="boolean"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="globalOut1" type="collection/integer"/>
|
||||
<outputPort name="isOK" type="boolean"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="toplevel/globalIn2" to="ParallelForEach_1/in2"/>
|
||||
<link from="toplevel/globalIn1" to="ParallelForEach_1/forElements1"/>
|
||||
<link from="ParallelForEach_1/forOut1" to="AtomicActivity2/in1"/>
|
||||
<link from="toplevel/globalIn2" to="AtomicActivity2/in2"/>
|
||||
<link from="AtomicActivity2/isOk" to="toplevel/isOK"/>
|
||||
<link from="AtomicActivity2/out1" to="toplevel/globalOut1"/>
|
||||
</links>
|
||||
<properties>
|
||||
<property name="version" value="1.0.0"/>
|
||||
<property name="author" value="matthias"/>
|
||||
<property name="domain" value="Generic"/>
|
||||
</properties>
|
||||
</blockScope>
|
||||
</IWIR>
|
||||
Executable
+176
@@ -0,0 +1,176 @@
|
||||
<IWIR version="1.1" wfname="SparseluFor" xmlns="http://shiwa-workflow.eu/IWIR">
|
||||
<blockScope name="toplevel">
|
||||
<inputPorts>
|
||||
<inputPort name="bots_arg_size" type="integer"/>
|
||||
<inputPort name="toplevelForCounterMax" type="integer"/>
|
||||
<inputPort name="tmax" type="integer"/>
|
||||
<inputPort name="BENCH" type="float**"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<for name="TopLevelFor">
|
||||
<inputPorts>
|
||||
<inputPort name="bots_arg_size" type="integer"/>
|
||||
<inputPort name="BENCH" type="float**"/>
|
||||
<inputPort name="tmax" type="integer"/>
|
||||
<loopPorts/>
|
||||
<loopCounter name="TopLevelCounter" from="0" to="" step="1"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<task name="lu0" tasktype="lu0">
|
||||
<inputPorts>
|
||||
<inputPort name="bots_arg_size" type="integer"/>
|
||||
<inputPort name="kk" type="integer"/>
|
||||
<inputPort name="BENCH" type="float**"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="BENCHout" type="float**"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
<parallelFor name="PFor1">
|
||||
<inputPorts>
|
||||
<inputPort name="BENCH" type="float**"/>
|
||||
<inputPort name="kk" type="integer"/>
|
||||
<inputPort name="tmax" type="integer"/>
|
||||
<inputPort name="bots_arg_size" type="integer"/>
|
||||
<loopCounter name="PFor1Counter" from="0" to="" step="1"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<task name="fwd" tasktype="fwd">
|
||||
<inputPorts>
|
||||
<inputPort name="tindex" type="integer"/>
|
||||
<inputPort name="tmax" type="integer"/>
|
||||
<inputPort name="kk" type="integer"/>
|
||||
<inputPort name="bots_arg_size" type="integer"/>
|
||||
<inputPort name="BENCH" type="float**"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="BENCHout" type="float**"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="BENCHouts" type="collection/float**"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="PFor1/PFor1Counter" to="fwd/tindex"/>
|
||||
<link from="PFor1/kk" to="fwd/kk"/>
|
||||
<link from="PFor1/tmax" to="fwd/tmax"/>
|
||||
<link from="PFor1/BENCH" to="fwd/BENCH"/>
|
||||
<link from="PFor1/bots_arg_size" to="fwd/bots_arg_size"/>
|
||||
<link from="fwd/BENCHout" to="PFor1/BENCHouts"/>
|
||||
</links>
|
||||
</parallelFor>
|
||||
<parallelFor name="PFor2">
|
||||
<inputPorts>
|
||||
<inputPort name="BENCH" type="collection/float**"/>
|
||||
<inputPort name="bots_arg_size" type="integer"/>
|
||||
<inputPort name="tmax" type="integer"/>
|
||||
<inputPort name="kk" type="integer"/>
|
||||
<loopCounter name="PFor2Counter" from="0" to="" step="1"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<task name="bdiv" tasktype="bdiv">
|
||||
<inputPorts>
|
||||
<inputPort name="tindex" type="integer"/>
|
||||
<inputPort name="tmax" type="integer"/>
|
||||
<inputPort name="kk" type="integer"/>
|
||||
<inputPort name="bots_arg_size" type="integer"/>
|
||||
<inputPort name="BENCH" type="collection/float**"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="BENCHout" type="float**"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="BENCHouts" type="collection/float**"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="PFor2/bots_arg_size" to="bdiv/bots_arg_size"/>
|
||||
<link from="PFor2/PFor2Counter" to="bdiv/tindex"/>
|
||||
<link from="PFor2/BENCH" to="bdiv/BENCH"/>
|
||||
<link from="PFor2/tmax" to="bdiv/tmax"/>
|
||||
<link from="PFor2/kk" to="bdiv/kk"/>
|
||||
<link from="bdiv/BENCHout" to="PFor2/BENCHouts"/>
|
||||
</links>
|
||||
</parallelFor>
|
||||
<parallelFor name="PFor3">
|
||||
<inputPorts>
|
||||
<inputPort name="BENCH" type="collection/float**"/>
|
||||
<inputPort name="tmax" type="integer"/>
|
||||
<inputPort name="bots_arg_size" type="integer"/>
|
||||
<inputPort name="kk" type="integer"/>
|
||||
<loopCounter name="PFor3Counter" from="0" to="" step="1"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<task name="bmod" tasktype="bmod">
|
||||
<inputPorts>
|
||||
<inputPort name="tindex" type="integer"/>
|
||||
<inputPort name="tmax" type="integer"/>
|
||||
<inputPort name="kk" type="integer"/>
|
||||
<inputPort name="bots_arg_size" type="integer"/>
|
||||
<inputPort name="BENCH" type="collection/float**"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="BENCHout" type="float**"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="BENCHouts" type="collection/float**"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="PFor3/PFor3Counter" to="bmod/tindex"/>
|
||||
<link from="PFor3/tmax" to="bmod/tmax"/>
|
||||
<link from="PFor3/bots_arg_size" to="bmod/bots_arg_size"/>
|
||||
<link from="PFor3/kk" to="bmod/kk"/>
|
||||
<link from="PFor3/BENCH" to="bmod/BENCH"/>
|
||||
<link from="bmod/BENCHout" to="PFor3/BENCHouts"/>
|
||||
</links>
|
||||
</parallelFor>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<unionPorts>
|
||||
<unionPort name="BENCHouts" type="collection/collection/float**"/>
|
||||
</unionPorts>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="TopLevelFor/bots_arg_size" to="lu0/bots_arg_size"/>
|
||||
<link from="TopLevelFor/TopLevelCounter" to="lu0/kk"/>
|
||||
<link from="TopLevelFor/BENCH" to="lu0/BENCH"/>
|
||||
<link from="lu0/BENCHout" to="PFor1/BENCH"/>
|
||||
<link from="TopLevelFor/TopLevelCounter" to="PFor1/kk"/>
|
||||
<link from="TopLevelFor/tmax" to="PFor1/tmax"/>
|
||||
<link from="TopLevelFor/bots_arg_size" to="PFor1/bots_arg_size"/>
|
||||
<link from="TopLevelFor/tmax" to="PFor1/PFor1Counter/to"/>
|
||||
<link from="PFor1/BENCHouts" to="PFor2/BENCH"/>
|
||||
<link from="TopLevelFor/tmax" to="PFor2/tmax"/>
|
||||
<link from="TopLevelFor/bots_arg_size" to="PFor2/bots_arg_size"/>
|
||||
<link from="TopLevelFor/TopLevelCounter" to="PFor2/kk"/>
|
||||
<link from="TopLevelFor/tmax" to="PFor2/PFor2Counter/to"/>
|
||||
<link from="TopLevelFor/TopLevelCounter" to="PFor3/kk"/>
|
||||
<link from="TopLevelFor/tmax" to="PFor3/PFor3Counter/to"/>
|
||||
<link from="TopLevelFor/tmax" to="PFor3/tmax"/>
|
||||
<link from="TopLevelFor/bots_arg_size" to="PFor3/bots_arg_size"/>
|
||||
<link from="PFor2/BENCHouts" to="PFor3/BENCH"/>
|
||||
<link from="PFor3/BENCHouts" to="TopLevelFor/BENCHouts"/>
|
||||
</links>
|
||||
</for>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="BENCHouts" type="collection/collection/float**"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="toplevel/bots_arg_size" to="TopLevelFor/bots_arg_size"/>
|
||||
<link from="toplevel/BENCH" to="TopLevelFor/BENCH"/>
|
||||
<link from="toplevel/tmax" to="TopLevelFor/tmax"/>
|
||||
<link from="toplevel/toplevelForCounterMax" to="TopLevelFor/TopLevelCounter/to"/>
|
||||
<link from="TopLevelFor/BENCHouts" to="toplevel/BENCHouts"/>
|
||||
</links>
|
||||
<properties>
|
||||
<property name="version" value="1.0.0"/>
|
||||
<property name="author" value="matthias"/>
|
||||
<property name="domain" value="Generic"/>
|
||||
</properties>
|
||||
</blockScope>
|
||||
</IWIR>
|
||||
Executable
+87
@@ -0,0 +1,87 @@
|
||||
<IWIR version="1.1" wfname="wavefront" xmlns="http://shiwa-workflow.eu/IWIR">
|
||||
<blockScope name="toplevel">
|
||||
<inputPorts>
|
||||
<inputPort name="iterMax" type="integer"/>
|
||||
<inputPort name="N" type="integer"/>
|
||||
<inputPort name="chunksize" type="integer"/>
|
||||
<inputPort name="_2N2" type="integer"/>
|
||||
<inputPort name="mat_a" type="double*"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<for name="toplevelFor">
|
||||
<inputPorts>
|
||||
<inputPort name="N" type="integer"/>
|
||||
<inputPort name="chunksize" type="integer"/>
|
||||
<inputPort name="_2N2" type="integer"/>
|
||||
<inputPort name="mat_a" type="double*"/>
|
||||
<loopPorts/>
|
||||
<loopCounter name="iterCounter" from="0" to="" step="1"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<parallelFor name="ParallelFor">
|
||||
<inputPorts>
|
||||
<inputPort name="N" type="integer"/>
|
||||
<inputPort name="_2N2" type="integer"/>
|
||||
<inputPort name="chunksize" type="integer"/>
|
||||
<inputPort name="mat_a" type="double*"/>
|
||||
<loopCounter name="pforCounter" from="1" to="" step=""/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<task name="AtomicActivity" tasktype="AtomicActivity">
|
||||
<inputPorts>
|
||||
<inputPort name="i" type="integer"/>
|
||||
<inputPort name="N" type="integer"/>
|
||||
<inputPort name="_2N2" type="integer"/>
|
||||
<inputPort name="chunksize" type="integer"/>
|
||||
<inputPort name="mat_a" type="double*"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="result" type="double*"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="result" type="collection/double*"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="ParallelFor/chunksize" to="AtomicActivity/chunksize"/>
|
||||
<link from="ParallelFor/mat_a" to="AtomicActivity/mat_a"/>
|
||||
<link from="ParallelFor/pforCounter" to="AtomicActivity/i"/>
|
||||
<link from="ParallelFor/N" to="AtomicActivity/N"/>
|
||||
<link from="ParallelFor/_2N2" to="AtomicActivity/_2N2"/>
|
||||
<link from="AtomicActivity/result" to="ParallelFor/result"/>
|
||||
</links>
|
||||
</parallelFor>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="result" type="collection/double*"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="toplevelFor/_2N2" to="ParallelFor/pforCounter/to"/>
|
||||
<link from="toplevelFor/_2N2" to="ParallelFor/_2N2"/>
|
||||
<link from="toplevelFor/chunksize" to="ParallelFor/pforCounter/step"/>
|
||||
<link from="toplevelFor/chunksize" to="ParallelFor/chunksize"/>
|
||||
<link from="toplevelFor/mat_a" to="ParallelFor/mat_a"/>
|
||||
<link from="toplevelFor/N" to="ParallelFor/N"/>
|
||||
<link from="ParallelFor/result" to="toplevelFor/result"/>
|
||||
</links>
|
||||
</for>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="result" type="collection/double*"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="toplevel/N" to="toplevelFor/N"/>
|
||||
<link from="toplevel/chunksize" to="toplevelFor/chunksize"/>
|
||||
<link from="toplevel/_2N2" to="toplevelFor/_2N2"/>
|
||||
<link from="toplevel/iterMax" to="toplevelFor/iterCounter/to"/>
|
||||
<link from="toplevel/mat_a" to="toplevelFor/mat_a"/>
|
||||
<link from="toplevelFor/result" to="toplevel/result"/>
|
||||
</links>
|
||||
<properties>
|
||||
<property name="version" value="1.0.0"/>
|
||||
<property name="author" value="matthias"/>
|
||||
<property name="domain" value="Generic"/>
|
||||
</properties>
|
||||
</blockScope>
|
||||
</IWIR>
|
||||
Executable
+81
@@ -0,0 +1,81 @@
|
||||
<IWIR version="1.1" wfname="UTest_While-1" xmlns="http://shiwa-workflow.eu/IWIR">
|
||||
<blockScope name="toplevel">
|
||||
<inputPorts>
|
||||
<inputPort name="iterationCount" type="integer"/>
|
||||
<inputPort name="iterationStart" type="integer"/>
|
||||
</inputPorts>
|
||||
<body>
|
||||
<while name="While_1">
|
||||
<inputPorts>
|
||||
<inputPort name="iterCount" type="integer"/>
|
||||
<loopPorts>
|
||||
<loopPort name="whileLoopPort1" type="integer"/>
|
||||
</loopPorts>
|
||||
</inputPorts>
|
||||
<condition>whileLoopPort1 <= iterCount</condition>
|
||||
<body>
|
||||
<task name="AtomicActivity1" tasktype="AtomicActivity1">
|
||||
<inputPorts>
|
||||
<inputPort name="iterCount" type="integer"/>
|
||||
<inputPort name="loopPortIn1" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="taskOut1" type="integer"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="whileOut1" type="integer"/>
|
||||
<outputPort name="whileOut2" type="integer"/>
|
||||
<unionPorts>
|
||||
<unionPort name="whileOutUnion1" type="collection/integer"/>
|
||||
</unionPorts>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="While_1/whileLoopPort1" to="AtomicActivity1/loopPortIn1"/>
|
||||
<link from="While_1/whileLoopPort1" to="While_1/whileOut2"/>
|
||||
<link from="While_1/iterCount" to="AtomicActivity1/iterCount"/>
|
||||
<link from="AtomicActivity1/taskOut1" to="While_1/whileOutUnion1"/>
|
||||
<link from="AtomicActivity1/taskOut1" to="While_1/whileOut1"/>
|
||||
<link from="AtomicActivity1/taskOut1" to="While_1/whileLoopPort1"/>
|
||||
</links>
|
||||
</while>
|
||||
<task name="AtomicActivity2" tasktype="AtomicActivity2">
|
||||
<inputPorts>
|
||||
<inputPort name="iterCount" type="integer"/>
|
||||
<inputPort name="in1" type="integer"/>
|
||||
<inputPort name="in2" type="collection/integer"/>
|
||||
<inputPort name="in3" type="integer"/>
|
||||
<inputPort name="in4" type="integer"/>
|
||||
</inputPorts>
|
||||
<outputPorts>
|
||||
<outputPort name="out1" type="integer"/>
|
||||
<outputPort name="out2" type="collection/integer"/>
|
||||
<outputPort name="isOK" type="boolean"/>
|
||||
</outputPorts>
|
||||
</task>
|
||||
</body>
|
||||
<outputPorts>
|
||||
<outputPort name="globalOut1" type="integer"/>
|
||||
<outputPort name="globalOut2" type="collection/integer"/>
|
||||
<outputPort name="isOK" type="boolean"/>
|
||||
</outputPorts>
|
||||
<links>
|
||||
<link from="toplevel/iterationCount" to="While_1/iterCount"/>
|
||||
<link from="toplevel/iterationStart" to="While_1/whileLoopPort1"/>
|
||||
<link from="toplevel/iterationCount" to="AtomicActivity2/iterCount"/>
|
||||
<link from="While_1/whileOut1" to="AtomicActivity2/in1"/>
|
||||
<link from="While_1/whileOutUnion1" to="AtomicActivity2/in2"/>
|
||||
<link from="While_1/whileOut2" to="AtomicActivity2/in3"/>
|
||||
<link from="While_1/whileLoopPort1" to="AtomicActivity2/in4"/>
|
||||
<link from="AtomicActivity2/isOK" to="toplevel/isOK"/>
|
||||
<link from="AtomicActivity2/out1" to="toplevel/globalOut1"/>
|
||||
<link from="AtomicActivity2/out2" to="toplevel/globalOut2"/>
|
||||
</links>
|
||||
<properties>
|
||||
<property name="version" value="1.0.0"/>
|
||||
<property name="author" value="matthias"/>
|
||||
<property name="domain" value="Generic"/>
|
||||
</properties>
|
||||
</blockScope>
|
||||
</IWIR>
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
[Dolphin]
|
||||
Timestamp=2015,3,24,17,3,20
|
||||
Version=3
|
||||
ViewMode=1
|
||||
Executable
+53
@@ -0,0 +1,53 @@
|
||||
/**********************************************************************************************/
|
||||
/* This program is part of the Barcelona OpenMP Tasks Suite */
|
||||
/* Copyright (C) 2009 Barcelona Supercomputing Center - Centro Nacional de Supercomputacion */
|
||||
/* Copyright (C) 2009 Universitat Politecnica de Catalunya */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 2 of the License, or */
|
||||
/* (at your option) any later version. */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program; if not, write to the Free Software */
|
||||
/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
/**********************************************************************************************/
|
||||
|
||||
#include "omp-tasks-app.h"
|
||||
|
||||
#define BOTS_APP_NAME "SparseLU (For version)"
|
||||
#define BOTS_APP_PARAMETERS_DESC "S1=%dx%d, S2=%dx%d"
|
||||
#define BOTS_APP_PARAMETERS_LIST ,bots_arg_size,bots_arg_size,bots_arg_size_1,bots_arg_size_1
|
||||
|
||||
#define BOTS_APP_USES_ARG_SIZE
|
||||
#define BOTS_APP_DEF_ARG_SIZE 50
|
||||
#define BOTS_APP_DESC_ARG_SIZE "Matrix Size"
|
||||
|
||||
#define BOTS_APP_USES_ARG_SIZE_1
|
||||
#define BOTS_APP_DEF_ARG_SIZE_1 100
|
||||
#define BOTS_APP_DESC_ARG_SIZE_1 "Submatrix Size"
|
||||
|
||||
#define BOTS_APP_INIT float **SEQ,**BENCH;
|
||||
|
||||
void sparselu_init(float ***pM, char *pass);
|
||||
void sparselu_fini(float **M, char *pass);
|
||||
void sparselu_seq_call(float **SEQ);
|
||||
void sparselu_par_call(float **BENCH, int argc, char* argv[]);
|
||||
int sparselu_check(float **SEQ, float **BENCH);
|
||||
|
||||
#define KERNEL_INIT sparselu_init(&BENCH,"benchmark");
|
||||
#define KERNEL_CALL sparselu_par_call(BENCH, argc, argv);
|
||||
#define KERNEL_FINI sparselu_fini(BENCH,"benchmark");
|
||||
|
||||
#define KERNEL_SEQ_INIT sparselu_init(&SEQ,"serial");
|
||||
#define KERNEL_SEQ_CALL sparselu_seq_call(SEQ);
|
||||
#define KERNEL_SEQ_FINI sparselu_fini(SEQ,"serial");
|
||||
|
||||
#define BOTS_APP_CHECK_USES_SEQ_RESULT
|
||||
#define KERNEL_CHECK sparselu_check(SEQ,BENCH);
|
||||
|
||||
Executable
+113
@@ -0,0 +1,113 @@
|
||||
/**********************************************************************************************/
|
||||
/* This program is part of the Barcelona OpenMP Tasks Suite */
|
||||
/* Copyright (C) 2009 Barcelona Supercomputing Center - Centro Nacional de Supercomputacion */
|
||||
/* Copyright (C) 2009 Universitat Politecnica de Catalunya */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 2 of the License, or */
|
||||
/* (at your option) any later version. */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program; if not, write to the Free Software */
|
||||
/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
/**********************************************************************************************/
|
||||
|
||||
#ifndef _BOTS_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* common flags */
|
||||
extern int bots_sequential_flag;
|
||||
extern int bots_benchmark_flag;
|
||||
extern int bots_check_flag;
|
||||
extern int bots_result;
|
||||
extern int bots_output_format;
|
||||
extern int bots_print_header;
|
||||
extern int bots_print_times;
|
||||
/* common variables */
|
||||
extern char bots_name[];
|
||||
extern char bots_parameters[];
|
||||
extern char bots_model[];
|
||||
extern char bots_resources[];
|
||||
/* compile and execution information */
|
||||
extern char bots_exec_date[];
|
||||
extern char bots_exec_message[];
|
||||
extern char bots_comp_date[];
|
||||
extern char bots_comp_message[];
|
||||
extern char bots_cc[];
|
||||
extern char bots_cflags[];
|
||||
extern char bots_ld[];
|
||||
extern char bots_ldflags[];
|
||||
/* time variables */
|
||||
extern double bots_time_program;
|
||||
extern double bots_time_sequential;
|
||||
|
||||
/* number of tasks variable */
|
||||
extern unsigned long long bots_number_of_tasks; /* forcing 8 bytes size on -m32 and -m64 */
|
||||
|
||||
extern char bots_cutoff[];
|
||||
extern int bots_cutoff_value;
|
||||
|
||||
extern int bots_app_cutoff_value;
|
||||
extern int bots_app_cutoff_value_1;
|
||||
extern int bots_app_cutoff_value_2;
|
||||
|
||||
extern int bots_arg_size;
|
||||
extern int bots_arg_size_1;
|
||||
extern int bots_arg_size_2;
|
||||
|
||||
/* function could be used in app. code but are implemented in bots_common.c */
|
||||
long bots_usecs();
|
||||
void bots_error(int error, char *message);
|
||||
void bots_warning(int warning, char *message);
|
||||
|
||||
#define BOTS_RESULT_NA 0
|
||||
#define BOTS_RESULT_SUCCESSFUL 1
|
||||
#define BOTS_RESULT_UNSUCCESSFUL 2
|
||||
#define BOTS_RESULT_NOT_REQUESTED 3
|
||||
|
||||
|
||||
typedef enum { BOTS_VERBOSE_NONE=0,
|
||||
BOTS_VERBOSE_DEFAULT,
|
||||
BOTS_VERBOSE_DEBUG } bots_verbose_mode_t;
|
||||
|
||||
extern bots_verbose_mode_t bots_verbose_mode;
|
||||
|
||||
#define bots_message(msg, ...) \
|
||||
{\
|
||||
if ( bots_verbose_mode >= BOTS_VERBOSE_DEFAULT ) {\
|
||||
fprintf(stdout, msg , ##__VA_ARGS__);\
|
||||
}\
|
||||
}
|
||||
|
||||
#ifdef BOTS_DEBUG
|
||||
#define bots_debug(msg, ...) \
|
||||
{\
|
||||
if ( bots_verbose_mode >= BOTS_VERBOSE_DEBUG ) {\
|
||||
fprintf(stdout, msg , ##__VA_ARGS__);\
|
||||
}\
|
||||
}
|
||||
#define bots_debug_with_location_info(msg, ...) \
|
||||
{\
|
||||
if ( bots_verbose_mode >= BOTS_VERBOSE_DEBUG ) {\
|
||||
fprintf(stdout, "%s:%d:%s:" msg ,__FILE__, __LINE__,__func__,##__VA_ARGS__);\
|
||||
}\
|
||||
}
|
||||
#else
|
||||
#define bots_debug(msg, ...)
|
||||
#define bots_debug_with_location_info(msg, ...)
|
||||
#endif
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Executable
+346
@@ -0,0 +1,346 @@
|
||||
/**********************************************************************************************/
|
||||
/* This program is part of the Barcelona OpenMP Tasks Suite */
|
||||
/* Copyright (C) 2009 Barcelona Supercomputing Center - Centro Nacional de Supercomputacion */
|
||||
/* Copyright (C) 2009 Universitat Politecnica de Catalunya */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 2 of the License, or */
|
||||
/* (at your option) any later version. */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program; if not, write to the Free Software */
|
||||
/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
/**********************************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#ifndef _WIN32
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "bots_common.h"
|
||||
#include "bots_main.h"
|
||||
#include "bots.h"
|
||||
|
||||
void
|
||||
bots_error(int error, char *message)
|
||||
{
|
||||
if (message == NULL)
|
||||
{
|
||||
switch(error)
|
||||
{
|
||||
case BOTS_ERROR:
|
||||
fprintf(stderr, "Error (%d): %s\n",error,"Unspecified error.");
|
||||
break;
|
||||
case BOTS_ERROR_NOT_ENOUGH_MEMORY:
|
||||
fprintf(stderr, "Error (%d): %s\n",error,"Not enough memory.");
|
||||
break;
|
||||
case BOTS_ERROR_UNRECOGNIZED_PARAMETER:
|
||||
fprintf(stderr, "Error (%d): %s\n",error,"Unrecognized parameter.");
|
||||
bots_print_usage();
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Error (%d): %s\n",error,"Invalid error code.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else fprintf(stderr, "Error (%d): %s\n",error,message);
|
||||
exit(100+error);
|
||||
}
|
||||
|
||||
void
|
||||
bots_warning(int warning, char *message)
|
||||
{
|
||||
if (message == NULL)
|
||||
{
|
||||
switch(warning)
|
||||
{
|
||||
case BOTS_WARNING:
|
||||
fprintf(stderr, "Warning (%d): %s\n",warning,"Unspecified warning.");
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Warning (%d): %s\n",warning,"Invalid warning code.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else fprintf(stderr, "Warning (%d): %s\n",warning,message);
|
||||
}
|
||||
|
||||
long bots_usecs (void)
|
||||
{
|
||||
struct timeval t;
|
||||
gettimeofday(&t,NULL);
|
||||
return t.tv_sec*1000000+t.tv_usec;
|
||||
}
|
||||
|
||||
void
|
||||
bots_get_date(char *str)
|
||||
{
|
||||
time_t now;
|
||||
time(&now);
|
||||
strftime(str, 32, "%Y/%m/%d;%H:%M", gmtime(&now));
|
||||
}
|
||||
|
||||
void bots_get_architecture(char *str)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
str = "Win32";
|
||||
#else
|
||||
int ncpus = sysconf(_SC_NPROCESSORS_CONF);
|
||||
struct utsname architecture;
|
||||
uname(&architecture);
|
||||
snprintf(str, BOTS_TMP_STR_SZ, "%s-%s;%d" ,architecture.sysname, architecture.machine, ncpus);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined (DISABLED_FOR_INSIEME_TEST)
|
||||
//#if defined (__linux)
|
||||
/* ****************************************************************** */
|
||||
void bots_get_load_average(char *str)
|
||||
{
|
||||
double loadavg[3];
|
||||
getloadavg (loadavg, 3);
|
||||
snprintf(str, BOTS_TMP_STR_SZ, "%.2f;%.2f;%.2f",loadavg[0],loadavg[1],loadavg[2]);
|
||||
}
|
||||
#else
|
||||
/* ****************************************************************** */
|
||||
void bots_get_load_average(char *str) { sprintf(str,";;"); }
|
||||
#endif
|
||||
|
||||
void bots_print_results()
|
||||
{
|
||||
char str_name[BOTS_TMP_STR_SZ];
|
||||
char str_parameters[BOTS_TMP_STR_SZ];
|
||||
char str_model[BOTS_TMP_STR_SZ];
|
||||
char str_resources[BOTS_TMP_STR_SZ];
|
||||
char str_result[15];
|
||||
char str_time_program[15];
|
||||
char str_time_sequential[15];
|
||||
char str_speed_up[15];
|
||||
char str_number_of_tasks[15];
|
||||
char str_number_of_tasks_per_second[15];
|
||||
char str_exec_date[BOTS_TMP_STR_SZ];
|
||||
char str_exec_message[BOTS_TMP_STR_SZ];
|
||||
char str_architecture[BOTS_TMP_STR_SZ];
|
||||
char str_load_avg[BOTS_TMP_STR_SZ];
|
||||
char str_comp_date[BOTS_TMP_STR_SZ];
|
||||
char str_comp_message[BOTS_TMP_STR_SZ];
|
||||
char str_cc[BOTS_TMP_STR_SZ];
|
||||
char str_cflags[BOTS_TMP_STR_SZ];
|
||||
char str_ld[BOTS_TMP_STR_SZ];
|
||||
char str_ldflags[BOTS_TMP_STR_SZ];
|
||||
char str_cutoff[BOTS_TMP_STR_SZ];
|
||||
|
||||
/* compute output strings */
|
||||
sprintf(str_name, "%s", bots_name);
|
||||
sprintf(str_parameters, "%s", bots_parameters);
|
||||
sprintf(str_model, "%s", bots_model);
|
||||
sprintf(str_cutoff, "%s", bots_cutoff);
|
||||
sprintf(str_resources, "%s", bots_resources);
|
||||
switch(bots_result)
|
||||
{
|
||||
case BOTS_RESULT_NA:
|
||||
sprintf(str_result, "n/a");
|
||||
break;
|
||||
case BOTS_RESULT_SUCCESSFUL:
|
||||
sprintf(str_result, "successful");
|
||||
break;
|
||||
case BOTS_RESULT_UNSUCCESSFUL:
|
||||
sprintf(str_result, "UNSUCCESSFUL");
|
||||
break;
|
||||
case BOTS_RESULT_NOT_REQUESTED:
|
||||
sprintf(str_result, "Not requested");
|
||||
break;
|
||||
default:
|
||||
sprintf(str_result, "error");
|
||||
break;
|
||||
}
|
||||
sprintf(str_time_program, "%f", bots_time_program);
|
||||
if (bots_sequential_flag) sprintf(str_time_sequential, "%f", bots_time_sequential);
|
||||
else sprintf(str_time_sequential, "n/a");
|
||||
if (bots_sequential_flag)
|
||||
sprintf(str_speed_up, "%3.2f", bots_time_sequential/bots_time_program);
|
||||
else sprintf(str_speed_up, "n/a");
|
||||
|
||||
sprintf(str_number_of_tasks, "%3.2f", (float) bots_number_of_tasks);
|
||||
sprintf(str_number_of_tasks_per_second, "%3.2f", (float) bots_number_of_tasks/bots_time_program);
|
||||
|
||||
sprintf(str_exec_date, "%s", bots_exec_date);
|
||||
sprintf(str_exec_message, "%s", bots_exec_message);
|
||||
bots_get_architecture(str_architecture);
|
||||
bots_get_load_average(str_load_avg);
|
||||
sprintf(str_comp_date, "%s", bots_comp_date);
|
||||
sprintf(str_comp_message, "%s", bots_comp_message);
|
||||
sprintf(str_cc, "%s", bots_cc);
|
||||
sprintf(str_cflags, "%s", bots_cflags);
|
||||
sprintf(str_ld, "%s", bots_ld);
|
||||
sprintf(str_ldflags, "%s", bots_ldflags);
|
||||
|
||||
if(bots_print_header)
|
||||
{
|
||||
switch(bots_output_format)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
fprintf(stdout,
|
||||
"Benchmark;Parameters;Model;Cutoff;Resources;Result;\
|
||||
Time;Sequential;Speed-up;\
|
||||
Nodes;Nodes/Sec;\
|
||||
Exec Date;Exec Time;Exec Message;\
|
||||
Architecture;Processors;Load Avg-1;Load Avg-5;Load Avg-15;\
|
||||
Comp Date;Comp Time;Comp Message;CC;CFLAGS;LD;LDFLAGS\n");
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
case 4:
|
||||
fprintf(stdout,
|
||||
"Benchmark;Parameters;Model;Cutoff;Resources;Result;\
|
||||
Time;Sequential;Speed-up;\
|
||||
Nodes;Nodes/Sec;\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* print results */
|
||||
switch(bots_output_format)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
fprintf(stdout, "\n");
|
||||
fprintf(stdout, "Program = %s\n", str_name); /*fix*/
|
||||
fprintf(stdout, "Parameters = %s\n", str_parameters); /*fix*/
|
||||
fprintf(stdout, "Model = %s\n", str_model);
|
||||
fprintf(stdout, "Embedded cut-off = %s\n", str_cutoff);
|
||||
// fprintf(stdout, "# of Threads = %s\n", str_resources);
|
||||
fprintf(stdout, "Verification = %s\n", str_result);
|
||||
|
||||
if (bots_print_times) {
|
||||
fprintf(stdout, "Time Program = %s seconds\n", str_time_program);
|
||||
if (bots_sequential_flag) {
|
||||
fprintf(stdout, "Time Sequential = %s seconds\n", str_time_sequential);
|
||||
fprintf(stdout, "Speed-up = %s\n", str_speed_up);
|
||||
}
|
||||
}
|
||||
|
||||
if ( bots_number_of_tasks > 0 ) {
|
||||
fprintf(stdout, "Nodes = %s\n", str_number_of_tasks);
|
||||
fprintf(stdout, "Nodes/Sec = %s\n", str_number_of_tasks_per_second);
|
||||
}
|
||||
|
||||
// fprintf(stdout, "Execution Date = %s\n", str_exec_date);
|
||||
fprintf(stdout, "Execution Message = %s\n", str_exec_message);
|
||||
|
||||
fprintf(stdout, "Architecture = %s\n", str_architecture);
|
||||
// fprintf(stdout, "Load Avg [1:5:15] = %s\n", str_load_avg);
|
||||
|
||||
fprintf(stdout, "Compilation Date = %s\n", str_comp_date);
|
||||
fprintf(stdout, "Compilation Message = %s\n", str_comp_message);
|
||||
|
||||
fprintf(stdout, "Compiler = %s\n", str_cc);
|
||||
fprintf(stdout, "Compiler Flags = %s\n", str_cflags);
|
||||
fprintf(stdout, "Linker = %s\n", str_ld);
|
||||
fprintf(stdout, "Linker Flags = %s\n", str_ldflags);
|
||||
fflush(stdout);
|
||||
break;
|
||||
case 2:
|
||||
fprintf(stdout,"%s;%s;%s;%s;%s;%s;",
|
||||
str_name,
|
||||
str_parameters,
|
||||
str_model,
|
||||
str_cutoff,
|
||||
str_resources,
|
||||
str_result
|
||||
);
|
||||
fprintf(stdout,"%s;%s;%s;",
|
||||
str_time_program,
|
||||
str_time_sequential,
|
||||
str_speed_up
|
||||
);
|
||||
fprintf(stdout,"%s;%s;",
|
||||
str_number_of_tasks,
|
||||
str_number_of_tasks_per_second
|
||||
);
|
||||
fprintf(stdout,"%s;%s;",
|
||||
str_exec_date,
|
||||
str_exec_message
|
||||
);
|
||||
fprintf(stdout,"%s;%s;",
|
||||
str_architecture,
|
||||
str_load_avg
|
||||
);
|
||||
fprintf(stdout,"%s;%s;",
|
||||
str_comp_date,
|
||||
str_comp_message
|
||||
);
|
||||
fprintf(stdout,"%s;%s;%s;%s;",
|
||||
str_cc,
|
||||
str_cflags,
|
||||
str_ld,
|
||||
str_ldflags
|
||||
);
|
||||
fprintf(stdout,"\n");
|
||||
break;
|
||||
case 3:
|
||||
fprintf(stdout, "\n");
|
||||
fprintf(stdout, "Program = %s\n", str_name); /*fix*/
|
||||
fprintf(stdout, "Parameters = %s\n", str_parameters); /*fix*/
|
||||
fprintf(stdout, "Model = %s\n", str_model);
|
||||
fprintf(stdout, "Embedded cut-off = %s\n", str_cutoff);
|
||||
fprintf(stdout, "# of Threads = %s\n", str_resources);
|
||||
fprintf(stdout, "Verification = %s\n", str_result);
|
||||
|
||||
fprintf(stdout, "Time Program = %s seconds\n", str_time_program);
|
||||
if (bots_sequential_flag) {
|
||||
fprintf(stdout, "Time Sequential = %s seconds\n", str_time_sequential);
|
||||
fprintf(stdout, "Speed-up = %s\n", str_speed_up);
|
||||
}
|
||||
|
||||
if ( bots_number_of_tasks > 0 ) {
|
||||
fprintf(stdout, "Nodes = %s\n", str_number_of_tasks);
|
||||
fprintf(stdout, "Nodes/Sec = %s\n", str_number_of_tasks_per_second);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
fprintf(stdout,"%s;%s;%s;%s;%s;%s;",
|
||||
str_name,
|
||||
str_parameters,
|
||||
str_model,
|
||||
str_cutoff,
|
||||
str_resources,
|
||||
str_result
|
||||
);
|
||||
fprintf(stdout,"%s;%s;%s;",
|
||||
str_time_program,
|
||||
str_time_sequential,
|
||||
str_speed_up
|
||||
);
|
||||
fprintf(stdout,"%s;%s;",
|
||||
str_number_of_tasks,
|
||||
str_number_of_tasks_per_second
|
||||
);
|
||||
fprintf(stdout,"\n");
|
||||
break;
|
||||
default:
|
||||
bots_error(BOTS_ERROR, (char*)"No valid output format\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Executable
+56
@@ -0,0 +1,56 @@
|
||||
/**********************************************************************************************/
|
||||
/* This program is part of the Barcelona OpenMP Tasks Suite */
|
||||
/* Copyright (C) 2009 Barcelona Supercomputing Center - Centro Nacional de Supercomputacion */
|
||||
/* Copyright (C) 2009 Universitat Politecnica de Catalunya */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 2 of the License, or */
|
||||
/* (at your option) any later version. */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program; if not, write to the Free Software */
|
||||
/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
/**********************************************************************************************/
|
||||
|
||||
#ifndef _COMMON_H
|
||||
#define _COMMON_H
|
||||
|
||||
#ifndef CC
|
||||
#define CC ""
|
||||
#endif
|
||||
#ifndef CFLAGS
|
||||
#define CFLAGS ""
|
||||
#endif
|
||||
#ifndef LD
|
||||
#define LD ""
|
||||
#endif
|
||||
#ifndef LDFLAGS
|
||||
#define LDFLAGS ""
|
||||
#endif
|
||||
#ifndef CDATE
|
||||
#define CDATE ""
|
||||
#endif
|
||||
#ifndef CMESSAGE
|
||||
#define CMESSAGE ""
|
||||
#endif
|
||||
|
||||
#define BOTS_ERROR 0
|
||||
#define BOTS_ERROR_NOT_ENOUGH_MEMORY 1
|
||||
#define BOTS_ERROR_UNRECOGNIZED_PARAMETER 2
|
||||
|
||||
#define BOTS_WARNING 0
|
||||
|
||||
void bots_get_date(char *str);
|
||||
void bots_get_architecture(char *str);
|
||||
void bots_get_load_average(char *str);
|
||||
void bots_print_results(void);
|
||||
|
||||
#define BOTS_TMP_STR_SZ 256
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user