[med-svn] [seqan2] 01/01: New upstream version 2.3.2.000platform-issues2-206d1f7+dfsg
Michael Crusoe
misterc-guest at moszumanska.debian.org
Fri Oct 27 06:39:08 UTC 2017
This is an automated email from the git hooks/post-receive script.
misterc-guest pushed a commit to annotated tag upstream/2.3.2.000platform-issues2-206d1f7+dfsg
in repository seqan2.
commit 23692a211728258172b126325c1e883fc58bd71b
Author: Michael R. Crusoe <michael.crusoe at gmail.com>
Date: Thu Oct 26 05:13:29 2017 -0700
New upstream version 2.3.2.000platform-issues2-206d1f7+dfsg
---
apps/yara/tests/run_tests.py | 12 +++++++++---
include/seqan/parallel/parallel_lock.h | 2 ++
include/seqan/platform.h | 11 ++++++++++-
include/seqan/stream/file_stream.h | 2 +-
include/seqan/stream/stream_compressor.h | 22 ++++++++++++++--------
5 files changed, 36 insertions(+), 13 deletions(-)
diff --git a/apps/yara/tests/run_tests.py b/apps/yara/tests/run_tests.py
index ba87e82..5dc3e5d 100644
--- a/apps/yara/tests/run_tests.py
+++ b/apps/yara/tests/run_tests.py
@@ -69,12 +69,18 @@ def main(source_base, binary_base):
exts = [os.path.basename(fname).split('.', 1)[-1]
for fname in glob.glob(ph.inFile('gold/%s-genome.*' % organism))]
+ # gold standard binary files created on little endian
+ if sys.byteorder != 'little':
+ td = []
+ else:
+ td = [(ph.inFile('gold/%s-genome.%s' % (organism, ext)),
+ ph.outFile('%s-genome.%s' % (organism, ext)), 'md5') for ext in exts]
+
conf = app_tests.TestConf(
program=path_to_indexer,
args=[ph.inFile('input/%s-genome.fa' % organism),
- '-o', ph.outFile('%s-genome' % organism)],
- to_diff=[(ph.inFile('gold/%s-genome.%s' % (organism, ext)),
- ph.outFile('%s-genome.%s' % (organism, ext)), 'md5') for ext in exts])
+ '-o', ph.outFile('%s-genome' % organism)],
+ to_diff=td)
conf_list.append(conf)
# ============================================================
diff --git a/include/seqan/parallel/parallel_lock.h b/include/seqan/parallel/parallel_lock.h
index 54f6a44..92126bf 100644
--- a/include/seqan/parallel/parallel_lock.h
+++ b/include/seqan/parallel/parallel_lock.h
@@ -215,6 +215,8 @@ yieldProcessor()
{
#if defined(STDLIB_VS) // Visual Studio - all platforms.
YieldProcessor();
+#elif defined(__armel__) || defined(__ARMEL__) // arm, but broken
+ asm volatile ("nop" ::: "memory"); // default operation - does nothing => Might lead to passive spinning.
#elif defined(__arm__) || defined(__aarch64__) // ARM.
__asm__ __volatile__ ("yield" ::: "memory");
#elif defined(__sparc) // SPARC
diff --git a/include/seqan/platform.h b/include/seqan/platform.h
index 365f5de..accaeab 100644
--- a/include/seqan/platform.h
+++ b/include/seqan/platform.h
@@ -488,7 +488,7 @@ template <typename T>
constexpr void ensure_little_endian(T &)
{}
-#if !SEQAN_BIG_ENDIAN
+#if SEQAN_BIG_ENDIAN
inline void ensure_little_endian(int16_t & in)
{
in = htole16(in);
@@ -527,4 +527,13 @@ inline void ensure_little_endian(double & in)
}
#endif // SEQAN_BIG_ENDIAN
+// DEFAULT PAGESIZE FOR MMAP
+#ifndef SEQAN_DEFAULT_PAGESIZE
+ #if SEQAN_IS_64_BIT
+ #define SEQAN_DEFAULT_PAGESIZE 64 * 1024
+ #else
+ #define SEQAN_DEFAULT_PAGESIZE 4 * 1024
+ #endif
+#endif
+
#endif // HEADER GUARD
diff --git a/include/seqan/stream/file_stream.h b/include/seqan/stream/file_stream.h
index 1cd43f7..e640086 100644
--- a/include/seqan/stream/file_stream.h
+++ b/include/seqan/stream/file_stream.h
@@ -178,7 +178,7 @@ clear(FilePage<TValue, TSpec> & me)
// Class FilePager
// ----------------------------------------------------------------------------
-template <unsigned SEQAN_PAGESIZE = 4 * 1024>
+template <unsigned SEQAN_PAGESIZE = SEQAN_DEFAULT_PAGESIZE>
struct FixedPagingScheme
{
enum { pageSize = SEQAN_PAGESIZE };
diff --git a/include/seqan/stream/stream_compressor.h b/include/seqan/stream/stream_compressor.h
index e39e9ce..e820b4b 100644
--- a/include/seqan/stream/stream_compressor.h
+++ b/include/seqan/stream/stream_compressor.h
@@ -276,16 +276,20 @@ compress(TTarget & target, TSourceIterator & source, CompressionContext<BgzfFile
// Helper Function _bgzfUnpackXX()
// ----------------------------------------------------------------------------
-inline unsigned short
+inline uint16_t
_bgzfUnpack16(char const * buffer)
{
- return *reinterpret_cast<unsigned short const *>(buffer);
+ uint16_t tmp = *reinterpret_cast<uint16_t const *>(buffer);
+ ensure_little_endian(tmp);
+ return tmp;
}
-inline unsigned
+inline uint32_t
_bgzfUnpack32(char const * buffer)
{
- return *reinterpret_cast<unsigned const *>(buffer);
+ uint32_t tmp = *reinterpret_cast<uint32_t const *>(buffer);
+ ensure_little_endian(tmp);
+ return tmp;
}
// ----------------------------------------------------------------------------
@@ -293,15 +297,17 @@ _bgzfUnpack32(char const * buffer)
// ----------------------------------------------------------------------------
inline void
-_bgzfPack16(char * buffer, unsigned short value)
+_bgzfPack16(char * buffer, uint16_t value)
{
- *reinterpret_cast<unsigned short *>(buffer) = value;
+ ensure_little_endian(value);
+ *reinterpret_cast<uint16_t *>(buffer) = value;
}
inline void
-_bgzfPack32(char * buffer, unsigned value)
+_bgzfPack32(char * buffer, uint32_t value)
{
- *reinterpret_cast<unsigned *>(buffer) = value;
+ ensure_little_endian(value);
+ *reinterpret_cast<uint32_t *>(buffer) = value;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/seqan2.git
More information about the debian-med-commit
mailing list