Skip to content

Commit

Permalink
bump fqfeeder and phmap
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Patro committed Jan 21, 2022
1 parent 5166707 commit 575a2fe
Show file tree
Hide file tree
Showing 17 changed files with 5,960 additions and 449 deletions.
31 changes: 13 additions & 18 deletions include/FastxParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
#include <thread>
#include <vector>

extern "C" {
#include "kseq.h"
}
#include "kseq++.hpp"

#include "concurrentqueue.h"

Expand Down Expand Up @@ -59,27 +57,24 @@ typename _Unique_if<T>::_Known_bound make_unique(Args&&...) = delete;
#endif //__FASTX_PARSER_PRECXX14_MAKE_UNIQUE__

namespace fastx_parser {
struct ReadSeq {
std::string seq;
std::string name;
~ReadSeq() {}
};

struct ReadQual {
std::string seq;
std::string name;
std::string qual;
~ReadQual() {}
};
using ReadSeq = klibpp::KSeq;
using ReadQual = klibpp::KSeq;

// The ReadPair and ReadQualPair are obviously
// redundant. But, having them as separate types
// here would allow us to say something at compile
// time about if we expect to be able to look
// at qualities etc. Think more about if we
// really want to keep both of these.
struct ReadPair {
ReadSeq first;
ReadSeq second;
klibpp::KSeq first;
klibpp::KSeq second;
};

struct ReadQualPair {
ReadQual first;
ReadQual second;
klibpp::KSeq first;
klibpp::KSeq second;
};

template <typename T> class ReadChunk {
Expand Down
13 changes: 11 additions & 2 deletions include/FastxParserThreadUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
#include <pthread.h>
#include <random>
#include <thread>

#if defined(__SSE2__)
#include "simde/x86/sse2.h"
#if defined(HAVE_SIMDE)
#include "simde/x86/sse2.h"
#else
#include <emmintrin.h>
#endif
#endif

// Most of this code is taken directly from
Expand All @@ -23,7 +28,11 @@ static const size_t MAX_BACKOFF_ITERS = 1024;

ALWAYS_INLINE static void cpuRelax() {
#if defined(__SSE2__) // AMD and Intel
simde_mm_pause();
#if defined(HAVE_SIMDE)
simde_mm_pause();
#else
_mm_pause();
#endif
#elif defined(__i386__) || defined(__x86_64__)
asm volatile("pause");
#elif defined(__aarch64__)
Expand Down
8 changes: 8 additions & 0 deletions include/SalmonUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ inline void incLoop(std::atomic<double>& val, double inc) {

std::string getCurrentTimeAsString();

// encodes the heuristic for guessing how threads should
// be allocated based on the available reads
// returns true if input was modified and false otherwise.
bool configure_parsing(size_t nfiles, // input param
size_t& worker_threads, // input/output param
uint32_t& parse_threads // input/output param
);

bool validateOptionsAlignment_(SalmonOpts& sopt);
bool validateOptionsMapping_(SalmonOpts& sopt);

Expand Down

0 comments on commit 575a2fe

Please sign in to comment.