Ignore:
Timestamp:
04/14/14 12:36:01 (10 years ago)
Author:
lyard
Message:
fixed uint32 bug for max available memory
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mcore/zofits.h

    r17302 r17667  
    8181        /// static setter for the default number of threads to use. -1 means all available physical cores
    8282        static uint32_t DefaultNumThreads(const uint32_t &_n=-2) { static uint32_t n=0; if (int32_t(_n)<-1) n=_n; return n; }
    83         static uint32_t DefaultMaxMemory(const uint32_t &_n=0) { static uint32_t n=1000000; if (_n>0) n=_n; return n; }
     83        static uint64_t DefaultMaxMemory(const uint64_t &_n=0) { static uint64_t n=1000000; if (_n>0) n=_n; return n; }
    8484        static uint32_t DefaultMaxNumTiles(const uint32_t &_n=0) { static uint32_t n=1000; if (_n>0) n=_n; return n; }
    8585        static uint32_t DefaultNumRowsPerTile(const uint32_t &_n=0) { static uint32_t n=100; if (_n>0) n=_n; return n; }
     
    9191        zofits(uint32_t numTiles    = DefaultMaxNumTiles(),
    9292               uint32_t rowPerTile  = DefaultNumRowsPerTile(),
    93                uint32_t maxUsableMem= DefaultMaxMemory()) : ofits(),
     93               uint64_t maxUsableMem= DefaultMaxMemory()) : ofits(),
    9494            fMemPool(0, maxUsableMem*1000),
    9595            fWriteToDiskQueue(std::bind(&zofits::WriteBufferToDisk, this, std::placeholders::_1), false)
     
    106106               uint32_t numTiles    = DefaultMaxNumTiles(),
    107107               uint32_t rowPerTile  = DefaultNumRowsPerTile(),
    108                uint32_t maxUsableMem= DefaultMaxMemory()) : ofits(fname),
     108               uint64_t maxUsableMem= DefaultMaxMemory()) : ofits(fname),
    109109                   fMemPool(0, maxUsableMem*1000),
    110110                   fWriteToDiskQueue(std::bind(&zofits::WriteBufferToDisk, this, std::placeholders::_1), false)
     
    155155                //start the compression queues
    156156                for (auto it=fCompressionQueues.begin(); it!= fCompressionQueues.end(); it++)
     157                {
    157158                    it->start();
    158 
     159                }
    159160                //start the disk writer
    160161                fWriteToDiskQueue.start();
     
    535536
    536537        /// Overload of the ofits method. Just calls the zofits specific one with default, uncompressed options for this column
    537         bool AddColumn(uint32_t cnt, char typechar, const std::string& name, const std::string& unit,
    538                        const std::string& comment="", bool addHeaderKeys=true)
     538        bool AddColumn(uint32_t cnt,
     539                       char typechar,
     540                       const std::string& name,
     541                       const std::string& unit,
     542                       const std::string& comment="",
     543                       bool addHeaderKeys=true)
    539544        {
    540545            return AddColumn(FITS::kFactRaw, cnt, typechar, name, unit, comment, addHeaderKeys);
Note: See TracChangeset for help on using the changeset viewer.