Changeset 17239 for trunk/Mars/mcore/zofits.h
- Timestamp:
- 10/17/13 15:33:53 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/zofits.h
r17237 r17239 61 61 /// @param rowPerTile how many rows will be grouped together in a single tile 62 62 /// @param maxUsableMem how many bytes of memory can be used by the compression buffers 63 zofits(uint32_t numTiles =1000,64 uint32_t rowPerTile =100,65 uint64_t maxUsableMem= 0) : ofits(),66 fMemPool(0, maxUsableMem),67 fWriteToDiskQueue(bind(&zofits::WriteBufferToDisk, this, placeholders::_1), false)63 zofits(uint32_t numTiles = fgNumTiles, 64 uint32_t rowPerTile = fgRowPerTile, 65 uint64_t maxUsableMem= fgMaxUsableMem) : ofits(), 66 fMemPool(0, maxUsableMem), 67 fWriteToDiskQueue(bind(&zofits::WriteBufferToDisk, this, placeholders::_1), false) 68 68 { 69 69 InitMemberVariables(numTiles, rowPerTile, maxUsableMem); … … 76 76 /// @param maxUsableMem how many bytes of memory can be used by the compression buffers 77 77 zofits(const char* fname, 78 uint32_t numTiles =1000,79 uint32_t rowPerTile =100,80 uint64_t maxUsableMem= 0) : ofits(fname),81 fMemPool(0, maxUsableMem),82 fWriteToDiskQueue(bind(&zofits::WriteBufferToDisk, this, placeholders::_1), false)78 uint32_t numTiles = fgNumTiles, 79 uint32_t rowPerTile = fgRowPerTile, 80 uint64_t maxUsableMem= fgMaxUsableMem) : ofits(fname), 81 fMemPool(0, maxUsableMem), 82 fWriteToDiskQueue(bind(&zofits::WriteBufferToDisk, this, placeholders::_1), false) 83 83 { 84 84 InitMemberVariables(numTiles, rowPerTile, maxUsableMem); … … 578 578 579 579 /// static setter for the default number of threads to use. -1 means all available physical cores 580 static void SetDefaultNumThreads(int32_t num) { fgNumQueues = num;} 581 static int32_t GetDefaultNumThreads() { return fgNumQueues;} 580 static void SetDefaultNumThreads (int32_t num) { fgNumQueues = num;} 581 static void SetDefaultNumTiles (uint32_t num) { fgNumTiles = num;} 582 static void SetDefaultNumRowPerTile(uint32_t num) { fgRowPerTile = num;} 583 static void SetDefaultMaxUsableMem (uint64_t size) { fgMaxUsableMem = size;} 584 585 static int32_t GetDefaultNumThreads() { return fgNumQueues;} 586 static uint32_t GetDefaultNumTiles() { return fgNumTiles;} 587 static uint32_t GetDefaultNumRowPerTile() { return fgRowPerTile;} 588 static uint64_t GetDefaulMaxUsableMem() { return fgMaxUsableMem;} 582 589 583 590 /// Get and set the actual number of threads for this object … … 984 991 985 992 //thread related stuff 986 MemoryManager fMemPool; ///< Actual memory manager, providing memory for the compression buffers 987 static int32_t fgNumQueues; ///< Default number of threads to be used by the objects 988 int32_t fNumQueues; ///< Current number of threads that will be used by this object 989 uint64_t fMaxUsableMem; ///< Maximum number of bytes that can be allocated by the memory manager 990 int32_t fLatestWrittenTile; ///< Index of the last tile written to disk (for correct ordering while using several threads) 993 MemoryManager fMemPool; ///< Actual memory manager, providing memory for the compression buffers 994 static int32_t fgNumQueues; ///< Default number of threads to be used by the objects 995 static uint32_t fgNumTiles; ///< Default number of reserved tiles 996 static uint32_t fgRowPerTile; ///< Default number of rows per tile 997 static uint64_t fgMaxUsableMem; ///< Default usable memory PER OBJECT 998 int32_t fNumQueues; ///< Current number of threads that will be used by this object 999 uint64_t fMaxUsableMem; ///< Maximum number of bytes that can be allocated by the memory manager 1000 int32_t fLatestWrittenTile; ///< Index of the last tile written to disk (for correct ordering while using several threads) 991 1001 992 1002 vector<Queue<CompressionTarget>> fCompressionQueues; ///< Processing queues (=threads) … … 1002 1012 1003 1013 typedef vector<CatalogEntry> CatalogRow; 1004 typedef vector<CatalogRow> CatalogType; 1005 CatalogType fCatalog; ///< Catalog for this file 1006 uint32_t fNumTiles; ///< Number of pre-reserved tiles 1007 uint32_t fNumRowsPerTile; ///< Number of rows per tile 1008 off_t fCatalogOffset; ///< Offset of the catalog from the beginning of the file 1009 uint32_t fCatalogExtraRows; ///< Number of extra rows written on top of the initial capacity of the file 1014 typedef vector<CatalogRow> CatalogType; 1015 CatalogType fCatalog; ///< Catalog for this file 1016 // uint32_t fCatalogSize; ///< Actual catalog size (.size() is slow on large lists) 1017 uint32_t fNumTiles; ///< Number of pre-reserved tiles 1018 uint32_t fNumRowsPerTile; ///< Number of rows per tile 1019 off_t fCatalogOffset; ///< Offset of the catalog from the beginning of the file 1020 uint32_t fCatalogExtraRows; ///< Number of extra rows written on top of the initial capacity of the file 1010 1021 1011 1022 // checksum related stuff … … 1036 1047 }; 1037 1048 1038 int32_t zofits::fgNumQueues = 0; 1049 int32_t zofits::fgNumQueues = 0; 1050 uint32_t zofits::fgNumTiles = 1000; 1051 uint32_t zofits::fgRowPerTile = 100; 1052 uint64_t zofits::fgMaxUsableMem = 1073741824; // one gigabyte 1039 1053 1040 1054 #ifndef __MARS__
Note:
See TracChangeset
for help on using the changeset viewer.