Skip to content

Commit

Permalink
enables concurrency in psufsort
Browse files Browse the repository at this point in the history
  • Loading branch information
kloetzl committed Feb 11, 2015
1 parent 0cbd62f commit 0c98b73
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion opt/psufsort/Makefile.am
@@ -1,2 +1,4 @@
noinst_LIBRARIES = libpsufsort.a
libpsufsort_a_SOURCES = psufsort.cxx
libpsufsort_a_SOURCES = psufsort.cxx ../src/global.h
libpsufsort_a_CXXFLAGS = $(OPENMP_CXXFLAGS) -W -Wall
libpsufsort_a_CPPFLAGS = $(OPENMP_CXXFLAGS) -I$(top_srcdir)/src
4 changes: 2 additions & 2 deletions opt/psufsort/psufsort.cxx
Expand Up @@ -5,8 +5,8 @@
#include <algorithm>
#include <iostream>
#include <cassert>
//#include <flags.h>
#include <cmath>
#include <global.h>

void mk_sort (std::vector<int>& SA, const std::string& T, size_t l, size_t r, size_t depth);
void insertion_sort (std::vector<int>& SA, const std::string& T, size_t l, size_t r, size_t depth);
Expand Down Expand Up @@ -124,7 +124,7 @@ std::vector<int> psufsort(const std::string& T){
}

// sort all S* suffixes
//#pragma omp parallel for shared(SA,T) schedule(dynamic, 1) num_threads(THREADS)
#pragma omp parallel for shared(SA,T) schedule(dynamic, 1) num_threads( (FLAGS & F_LOW_MEMORY) ? THREADS : 1)
for(i=0; i<256*256; i++){
const auto buc = bucket_SS[i];
if( buc.size > 1){
Expand Down
4 changes: 2 additions & 2 deletions test/Makefile.am
Expand Up @@ -11,8 +11,8 @@ test_seq_CXXFLAGS = -W -Wall $(GLIB_CFLAGS)
test_seq_LDADD = $(GLIB_LIBS)

test_esa_SOURCES = test_esa.cxx ../src/esa.cpp ../src/sequence.cpp $(top_srcdir)/src/esa.h
test_esa_CPPFLAGS = -I$(top_srcdir)/libs -I$(top_srcdir)/libs/RMQ -I$(top_srcdir)/src -DDEBUG
test_esa_CXXFLAGS = -W -Wall $(GLIB_CFLAGS)
test_esa_CPPFLAGS = $(OPENMP_CXXFLAGS) -I$(top_srcdir)/libs -I$(top_srcdir)/libs/RMQ -I$(top_srcdir)/src -DDEBUG
test_esa_CXXFLAGS = $(OPENMP_CXXFLAGS) -W -Wall $(GLIB_CFLAGS)
test_esa_LDADD = $(top_builddir)/libs/RMQ/libRMQ_improved.a $(GLIB_LIBS) $(PSUFSORT)

test_fasta_SOURCES = test_fasta.cxx
Expand Down
1 change: 1 addition & 0 deletions test/test_esa.cxx
Expand Up @@ -5,6 +5,7 @@
#include <string.h>

int FLAGS = F_NONE;
int THREADS = 1;

extern const int CACHE_LENGTH;

Expand Down

0 comments on commit 0c98b73

Please sign in to comment.