Skip to content

Commit

Permalink
final commit before deadline
Browse files Browse the repository at this point in the history
  • Loading branch information
Learus committed Jan 20, 2019
1 parent 8f43791 commit 92d4668
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 16 deletions.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# Application-Development-for-Information-Systems

## TODO:
1. Read the damn pdf already
## Contributors:

## NOTICE:
1. TLB misses on build and probe phase
* Vasileios Sioros - 1115201500144
* Ioannis Maliaras - 1115201500084
* Ioannis Cheilaris - 1115201500176

---

## Usage:

./harness.sh
or

./harness.sh {number_of_threads}

---

## More information

For more information look into ./harness.sh and ./inc and ./src folders.
The test program is ./test/executioner_unit.cpp
20 changes: 20 additions & 0 deletions harness.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
yes "yes" | ./cpp-build --makefile;
if [ -z "$1" ]; then
./cpp-build -q;
else
./cpp-build -q -t=$1;
fi


yes "yes" | ./igenerate.sh workload/small/small.work input.txt workload/small/r*;

cd ./workload/small;

echo;
echo;
echo "Harness completed in (ms):";
../../bin/harness.exe small.init small.work small.result ../../bin/executioner_unit.exe;

cd ../../;

3 changes: 3 additions & 0 deletions inc/executioner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ namespace RHJ

};

// Intermediate Results is a list of map of vectors
// each vector represents a relation and contains rowIDs.
// so we need a map of vectors to address our relation by name.
struct IntermediateResults : public utility::list<Entity> {

IntermediateResults();
Expand Down
9 changes: 0 additions & 9 deletions result
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
26468015 32533054
5446 1009 1009
31831879 99876596 96864400
27314139 10766320
901496306
NULL NULL NULL
281654532 282357938 841559324
187822 1036243 187822
1771710026
22766314 22766314
4634779503 627329747 627329747
41316024 267394881 9912745
Expand Down
10 changes: 8 additions & 2 deletions src/executioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,11 @@ std::vector<std::string> RHJ::Executioner::execute(const Query& query) {

bool RHJ::Executioner::executeFilter(const Query& query, Query::Predicate pred) {


std::size_t relation = pred.left.rel;
std::size_t column = pred.left.col;
tuple_payload_t immediate = pred.right.constraint;
Query::Predicate::Type op = pred.type;


IntermediateResults::iterator node = inteResults.find(pred.left.rel);

#if !defined (__QUIET__)
Expand Down Expand Up @@ -266,6 +264,14 @@ bool RHJ::Executioner::executeFilter(const Query& query, Query::Predicate pred)

bool RHJ::Executioner::executeJoin(const Query& query, Query::Predicate pred) {

// External Join: 2 relations that do not exist in intermediate results
// Internal Join: 2 relations that BOTH exist in intermediate results
// Semi-Internal Join: 1 relation in intermediate results. 1 relation not in intermediate results.
// Internal Self Join: 1 relation self join that exists in intermediate results
// External Self Join: 1 relation self join that does not exist in intermediate results
//
// Practically, the only difference here is the source of the data used for joins.

#if !defined (__QUIET__)
std::cerr << "\tExecuting Join.. " << pred << std::endl;
#endif
Expand Down
6 changes: 5 additions & 1 deletion src/histhash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#include <fstream>
#endif

#if !defined(__THREADS__)
#define __THREADS__ (4UL)
#endif

#define HASH(value, radix) (value & ((1UL << radix) - 1UL))

#if defined (__PSUM_DEBUG__)
Expand Down Expand Up @@ -133,7 +137,7 @@ RHJ::PsumTable::PsumTable(const Relation& rel, radix_t _radix, std::size_t _psum
// std::size_t *hashes = new std::size_t[rel.size];
// </SINGLE THREAD IMPLEMENTATION> //

std::size_t num_threads = 4;
std::size_t num_threads = __THREADS__;
thread_pool::create(num_threads);

std::size_t curOffset = 0;
Expand Down

0 comments on commit 92d4668

Please sign in to comment.