Skip to content

User power of 10 units in the code

I have identified several places where units of power of 2 (1024) are used to multiply various values while the code is talking about unit of power of 10:

pcvlado /home/vlado/git/CTA/CTA-main > grep -Fri '1024 * 1024' *
disk/RadosStriperPool.cpp:    newStriper->set_object_layout_stripe_unit(32 * 1024 * 1024); // 32 MB
disk/RadosStriperPool.cpp:    newStriper->set_object_layout_object_size(32 * 1024 * 1024); // 32 MB
frontend/common/FrontendService.cpp:    std::optional<size_t>(schedulerThreadStackSize.value() * 1024 * 1024) : std::nullopt;
frontend/common/FrontendService.cpp:  m_archiveFileMaxSize = archiveFileMaxSize.has_value() ?  static_cast<uint64_t>(archiveFileMaxSize.value()) * 1024 * 1024 * 1024 : 0;
tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjector.cpp:  uint64_t reqSize = 1024L * 1024 * 1024 * 1024 * 1024;
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024 * 1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024 * 1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024 * 1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024 * 1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024 * 1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024 * 1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024 * 1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024 * 1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024 * 1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024 * 1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024 * 1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024 * 1024; // 1 MB memory buffers
tapeserver/readtp/ReadtpCmd.cpp:  const size_t buffer_size = 1 * 1024 * 1024 * 1024;  // 1Gb
pcvlado /home/vlado/git/CTA/CTA-main > grep -Fri '1024*1024' *
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024*1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024*1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024*1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp:  castorConf.bufsz = 1024*1024; // 1 MB memory buffers
tapeserver/castor/tape/tapeserver/file/EnstoreFileReader.cpp:  setBlockSize(1024*1024);  // Enstore used 1M size blocks for T10K, M8, and LTO-8 tapes
tapeserver/daemon/TapedConfiguration.hpp:    "taped", "BufferSizeBytes", 5*1024*1024, "Compile time default"};

We should decide what units should be CTA using and stick to that.

There is a difference between using the units with power of 10 and 2. See these articles:

Please do not mix this with other values, where we decided that BYTES should be used.

Edited by Vladimir Bahyl