Skip to content

Commit

Permalink
Fixed a bug which was causing a seg fault when using the comp tool wi…
Browse files Browse the repository at this point in the history
…th bin sizes larger than the default value.
  • Loading branch information
Daniel Mapleson committed Apr 7, 2017
1 parent 46288b8 commit 17a8ec1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Autoconf initialistion. Sets package name version and contact details
AC_PREREQ([2.68])
AC_INIT([kat],[2.3.2],[https://github.com/TGAC/KAT/issues],[kat],[https://github.com/TGAC/KAT])
AC_INIT([kat],[2.3.3],[https://github.com/TGAC/KAT/issues],[kat],[https://github.com/TGAC/KAT])
AC_CONFIG_SRCDIR([src/kat.cc])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
# built documents.
#
# The short X.Y version.
version = '2.3.2'
version = '2.3.3'
# The full version, including alpha/beta/rc tags.
release = '2.3.2'
release = '2.3.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 4 additions & 0 deletions lib/include/kat/comp_counters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class CompCounters {
path hash3_path;

CompCounters();

CompCounters(const size_t _dm_size);

CompCounters(const path& _hash1_path, const path& _hash2_path, const path& _hash3_path, const size_t _dm_size);

Expand Down Expand Up @@ -92,6 +94,8 @@ class ThreadedCompCounters {
public:

ThreadedCompCounters();

ThreadedCompCounters(const size_t _dm_size);

ThreadedCompCounters(const path& _hash1_path, const path& _hash2_path, const path& _hash3_path, const size_t _dm_size);

Expand Down
2 changes: 1 addition & 1 deletion lib/include/kat/sparse_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ class ThreadedSparseMatrix {
}

const SM64& mergeThreadedMatricies() {
// Merge matrix
// Merge matrix
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
for (int k = 0; k < threads; k++) {
Expand Down
4 changes: 4 additions & 0 deletions lib/src/comp_counters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ using kat::DistanceMetric;

kat::CompCounters::CompCounters() : CompCounters("", "", "", DEFAULT_NB_BINS) {}

kat::CompCounters::CompCounters(const size_t _dm_size) : CompCounters("", "", "", _dm_size) {}

kat::CompCounters::CompCounters(const path& _hash1_path, const path& _hash2_path, const path& _hash3_path, const size_t _dm_size) :
hash1_path(_hash1_path), hash2_path(_hash2_path), hash3_path(_hash3_path) {

Expand Down Expand Up @@ -208,6 +210,8 @@ void kat::CompCounters::printCounts(ostream &out) {

kat::ThreadedCompCounters::ThreadedCompCounters() : ThreadedCompCounters("", "", "", DEFAULT_NB_BINS) {}

kat::ThreadedCompCounters::ThreadedCompCounters(const size_t _dm_size) : ThreadedCompCounters("", "", "", _dm_size) {}

kat::ThreadedCompCounters::ThreadedCompCounters(const path& _hash1_path, const path& _hash2_path, const path& _hash3_path, const size_t _dm_size) {
final_matrix = CompCounters(_hash1_path, _hash2_path, _hash3_path, _dm_size);
}
Expand Down
3 changes: 1 addition & 2 deletions src/comp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ void kat::Comp::merge() {

cout << "Merging results ...";
cout.flush();

// Merge results from the threads
main_matrix.mergeThreadedMatricies();
if (doThirdHash()) {
Expand Down Expand Up @@ -390,7 +389,7 @@ void kat::Comp::compare() {

void kat::Comp::compareSlice(int th_id) {

shared_ptr<CompCounters> cc = make_shared<CompCounters>();
shared_ptr<CompCounters> cc = make_shared<CompCounters>(std::min(this->d1Bins, this->d2Bins));

// Setup iterator for this thread's chunk of hash1
LargeHashArray::eager_iterator hash1Iterator = input[0].hash->eager_slice(th_id, threads);
Expand Down

0 comments on commit 17a8ec1

Please sign in to comment.