From: Aaron M. Ucko Date: Mon, 7 Sep 2020 03:01:40 +0000 (-0400) Subject: tune_32bit_lmdb_defaults (new): Conditionalize dflt map sz (#969608). X-Git-Tag: archive/raspbian/2.16.0+ds-7+rpi1~1^2~103 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ac5160f55a9c67d165103a5b26408b1572035bc1;p=ncbi-blast%2B.git tune_32bit_lmdb_defaults (new): Conditionalize dflt map sz (#969608). Patch to avoid allocation failures on 32-bit platforms. --- diff --git a/debian/changelog b/debian/changelog index 3c201483..16c8bc4c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,11 @@ ncbi-blast+ (2.10.0-2) UNRELEASED; urgency=medium * NOT RELEASED YET. * debian/patches/support_gcc10: Additionally tweak ncbifile.cpp to avoid narrowing errors on some platforms (i386, for one). + * debian/patches/tune_32bit_lmdb_defaults (new): Conditionalize default + map size to avoid allocation failures on 32-bit platforms. + (Closes: #969608.) - -- Aaron M. Ucko Sun, 06 Sep 2020 22:57:35 -0400 + -- Aaron M. Ucko Sun, 06 Sep 2020 23:01:38 -0400 ncbi-blast+ (2.10.0-1) unstable; urgency=medium diff --git a/debian/patches/series b/debian/patches/series index 419fdd9f..f6a3d5d7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -15,3 +15,4 @@ reprobuild spelling support_gcc10 run_perl_directly +tune_32bit_lmdb_defaults diff --git a/debian/patches/tune_32bit_lmdb_defaults b/debian/patches/tune_32bit_lmdb_defaults new file mode 100644 index 00000000..9786c7d5 --- /dev/null +++ b/debian/patches/tune_32bit_lmdb_defaults @@ -0,0 +1,36 @@ +Index: b/c++/include/objtools/blast/seqdb_writer/writedb_lmdb.hpp +=================================================================== +--- a/c++/include/objtools/blast/seqdb_writer/writedb_lmdb.hpp ++++ b/c++/include/objtools/blast/seqdb_writer/writedb_lmdb.hpp +@@ -48,6 +48,11 @@ USING_SCOPE(objects); + + BEGIN_NCBI_SCOPE + ++#if NCBI_PLATFORM_BITS >= 64 ++# define NCBI_WRITEDB_DEFAULT_MAP_SIZE 300 * 1000 * 1000 * 1000 ++#else ++# define NCBI_WRITEDB_DEFAULT_MAP_SIZE 1000 * 1000 * 1000 ++#endif + + /// This class supports creation of a string accession to integer OID + /// lmdb database +@@ -59,7 +64,8 @@ public: + + /// Constructor for LMDB write access + /// @param dbname Database name +- CWriteDB_LMDB(const string& dbname, Uint8 map_size = 300000000000, Uint8 capacity = 500000); ++ CWriteDB_LMDB(const string& dbname, Uint8 map_size = NCBI_WRITEDB_DEFAULT_MAP_SIZE, ++ Uint8 capacity = 500000); + + // Destructor + ~CWriteDB_LMDB(); +@@ -130,7 +136,8 @@ public: + + /// Constructor for LMDB write access + /// @param dbname Database name +- CWriteDB_TaxID(const string& dbname, Uint8 map_size = 300000000000, Uint8 capacity = 500000); ++ CWriteDB_TaxID(const string& dbname, Uint8 map_size = NCBI_WRITEDB_DEFAULT_MAP_SIZE, ++ Uint8 capacity = 500000); + + // Destructor + ~CWriteDB_TaxID();