To flush cache

sync
echo 3 > /proc/sys/vm/drop_caches 

To set readahead (in 512-byte sectors)
blockdev --setra 16384 /dev/sdb
To run hdparm disk throughput benchmark
hdparm -Tt /dev/sdb 

To set kernel request queue size (better to be at least twice higher than queue_depth)
echo 512 > /sys/block/sdb/queue/nr_requests
To set hardware requests queue size (limit 254)
echo 128 > /sys/block/sda/device/queue_depth
To merge files
TChain * chain = new TChain("esdTree");
chain->SetMaxTreeSize(3400000000);
chain->Add("/data.local2/0000/AliESDs.root");
chain->Add("/data.local2/0001/AliESDs.root");
chain->Merge("big.root");

To read a file to memory with C++ code
#include<iostream>
#include<fstream>
int read_cache(const char* a) {
        const size_t BMAX = 1024;
        char buffer[BMAX];
        std::ifstream f(a);
        int i = 0;
        while(f) {
           f.read(buffer,BMAX);
           ++i;
        }
        return i;
}

To cache a file into memory inside ROOT analysis code put the following inside Notify() function in TSelector
int h = read_cache(fChain->GetCurrentFile()->GetName());
or the following inside Notify() in AliAnalysisManager.cxx
int h = read_cache(fTree->GetCurrentFile()->GetName());
-- MishaZ - 05 Mar 2008
Topic revision: r1 - 2008-03-05, MishaZ - This page was cached on 2021-10-19 - 14:05.

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Imprint (german) | Privacy Policy (german)