Commit ddd54356 authored by Valentina Fioretti's avatar Valentina Fioretti
Browse files

flag to remove compression

parent f7643dab
Loading
Loading
Loading
Loading
+10 −11
Original line number Diff line number Diff line
@@ -112,8 +112,6 @@ CRunAction::~CRunAction() { }
void CRunAction::BeginOfRunAction(const G4Run* aRun) {
// 	G4RunManager::GetRunManager()->SetRandomNumberStore(true);
    G4int runN = aRun->GetRunID();
    if ( runN % 1000 == 0 )
        G4cout << "### Run : " << runN << G4endl;

    if (IsMaster())
        gm.InitFiles();
@@ -134,16 +132,17 @@ void CRunAction::EndOfRunAction(const G4Run* ) {
    if (IsMaster()){
        if(gm.enableWriteFITS && gm.enableWriteXYZ) {
            gm.fits_xyz->close();
            if (gm.GetFITSCompressionStatus()){
                char* filename = (char*)gm.outputXYZFileNameFITS.data();
                char* basename = (char*)gm.outputXYZFileNameFITS_base.data();
                gm.CopyFileFits(filename, basename);
                G4String ss;
                ss = "gzip -9 ";
            //ss += gm.outputStepBoundaryFileNameFITS;
                ss += basename;
                G4cout << ss << G4endl;
                system(ss);
            }
        }
        
        
        #ifdef SQLITE3
+8 −0
Original line number Diff line number Diff line
@@ -66,6 +66,8 @@ THELGlobalMemory::THELGlobalMemory() {
    //scrivi i file di output in formato FITS
    enableWriteFITS = false;
    
    enableFITSCompression= true;

    enableWriteFITSEnd = false;

    //scrivi i file di output in formato TXT
@@ -97,6 +99,7 @@ THELGlobalMemory::~THELGlobalMemory() {
void THELGlobalMemory::OpenConfigFile() {
    config = new ConfigFile(gm.configFileName);
    config->readInto(enableWriteFITS, "IO.FILETYPE.FITS");
    config->readInto(enableFITSCompression, "IO.FILETYPE.FITS.COMPRESS");
    config->readInto(enableWriteFITSEnd, "IO.FILETYPE.FITSEND");
    config->readInto(enableWriteSQlite3, "IO.FILETYPE.SQLITE3");
    config->readInto(enableWriteMONGODB, "IO.FILETYPE.MONGODB");
@@ -202,6 +205,11 @@ G4String THELGlobalMemory::GetMongoUri() {
    return uri_address;
}

bool THELGlobalMemory::GetFITSCompressionStatus(){
    return enableFITSCompression;
}


int THELGlobalMemory::CopyFileFits(char* in, char* out) {
    G4String ins;
    ins = in;
+4 −0
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ public:

    G4String GetOutputXYZFileNameFITS();
    
    bool GetFITSCompressionStatus();
    
    G4String GetOutputSQLliteXYZFileName();
    
    G4String GetOutputMongoXYZCollectionName();
@@ -124,6 +126,8 @@ public:

    G4bool enableWriteFITS;

    G4bool enableFITSCompression;
    
    G4bool enableWriteFITSEnd;
    
    G4bool enableWriteSQlite3;
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ using namespace std;
int main( int argc, char** argv ) {


    G4cout << "/n#######################################################" << G4endl;
    G4cout << "#######################################################" << G4endl;
    G4cout << "                     BoGEMMS-HPC" << G4endl;
    G4cout << "#######################################################" << G4endl;