Changeset 17244
- Timestamp:
- 10/17/13 16:50:07 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/fadctrl.cc
r16979 r17244 18 18 #include "EventBuilderWrapper.h" 19 19 20 #include "../externals/zofits.h" 21 20 22 namespace ba = boost::asio; 21 23 namespace bs = boost::system; … … 843 845 case FAD::kDebug: 844 846 case FAD::kFits: 847 case FAD::kZFits: 845 848 case FAD::kCfitsio: 846 849 case FAD::kRaw: … … 1302 1305 return T::GetCurrentState(); 1303 1306 } 1307 1308 // ============================================================================ 1309 1310 int SetupZFits(const EventImp &evt, const std::function<void(int32_t)> &func) 1311 { 1312 if (!CheckEventSize(evt.GetSize(), "SetupZFits", 2)) 1313 return T::kSM_FatalError; 1314 1315 func(evt.GetShort()); 1316 return T::GetCurrentState(); 1317 } 1318 1304 1319 1305 1320 // ============================================================================ … … 1909 1924 1910 1925 1926 // --------- Setup compression of FITS files ----------- 1927 T::AddEvent("SET_ZFITS_DEFAULT_NUM_THREADS", "S") 1928 (bind(&StateMachineFAD::SetupZFits, this, placeholders::_1, zofits::DefaultNumThreads)) 1929 ("Set the number of compression threads to use (+1 for writing)" 1930 "|num[int]:Number of threads"); 1931 T::AddEvent("SET_ZFITS_DEFAULT_MAX_MEMORY", "S") 1932 (bind(&StateMachineFAD::SetupZFits, this, placeholders::_1, zofits::DefaultMaxMemory)) 1933 ("Set the maximum amount of memory zfits will use for compression" 1934 "|mem[int]:Memory in MB"); 1935 T::AddEvent("SET_ZFITS_DEFAULT_NUM_TILES", "S") 1936 (bind(&StateMachineFAD::SetupZFits, this, placeholders::_1, zofits::DefaultMaxNumTiles)) 1937 ("Set the number of tiles with which the catalog is initialized" 1938 "|num[int]:Number of tiles"); 1939 T::AddEvent("SET_ZFITS_DEFAULT_ROWS_PER_TILE", "S") 1940 (bind(&StateMachineFAD::SetupZFits, this, placeholders::_1, zofits::DefaultNumRowsPerTile)) 1941 ("Set the number of rows which are compressed into one tile" 1942 "|num[int]:Number of rows per tile"); 1943 1944 1911 1945 T::AddEvent("ADD_ADDRESS", "C", FAD::State::kOffline) 1912 1946 (bind(&StateMachineFAD::AddAddress, this, placeholders::_1)) … … 1990 2024 fDebugTx = conf.Get<bool>("debug-tx"); 1991 2025 2026 // --------- Setup compression of FITS files ----------- 2027 if (conf.Has("zfits.num-threads")) 2028 zofits::DefaultNumThreads(conf.Get<int16_t>("zfits.num-threads")); 2029 if (conf.Has("zfits.max-mem")) 2030 zofits::DefaultMaxMemory(conf.Get<uint16_t>("zfits.max-mem")*1000); 2031 if (conf.Has("zfits.num-tiles")) 2032 zofits::DefaultMaxNumTiles(conf.Get<uint16_t>("zfits.num-tiles")); 2033 if (conf.Has("zfits.num-rows")) 2034 zofits::DefaultNumRowsPerTile(conf.Get<uint16_t>("zfits.num-rows")); 2035 1992 2036 // ---------- Setup event builder --------- 1993 2037 SetMaxMemory(conf.Get<unsigned int>("max-mem")); … … 2177 2221 po::options_description builder("Event builder options"); 2178 2222 builder.add_options() 2179 ("max-mem ,m",var<unsigned int>(100), "Maximum memory the event builder thread is allowed to consume for its event buffer")2223 ("max-mem", var<unsigned int>(100), "Maximum memory the event builder thread is allowed to consume for its event buffer") 2180 2224 ("event-timeout", var<uint16_t>(30), "After how many seconds is an event considered to be timed out? (<=0: disabled)") 2181 2225 ("destination-folder", var<string>(""), "Destination folder (base folder) for the event builder binary data files.") 2226 ; 2227 2228 po::options_description zfits("FITS compression options"); 2229 zfits.add_options() 2230 ("zfits.num-threads", var<int16_t>(), "Number of threads to spawn writing compressed FITS files") 2231 ("zfits.max-mem", var<uint16_t>(), "Maximum amount of memory to be allocated by FITS compression in MB") 2232 ("zfits.num-tiles", var<uint16_t>(), "Maximum number of tiles in the catalog") 2233 ("zfits.num-rows", var<uint16_t>(), "Maximum number of rows per tile") 2182 2234 ; 2183 2235 … … 2216 2268 conf.AddOptions(connect); 2217 2269 conf.AddOptions(builder); 2270 conf.AddOptions(zfits); 2218 2271 conf.AddOptions(runtype); 2219 2272 }
Note:
See TracChangeset
for help on using the changeset viewer.