// ************************************************************************** // This file is property of and copyright by the ALICE HLT Project * // ALICE Experiment at CERN, All rights reserved. * // * // Primary Authors: Sergey Gorbunov * // Ivan Kisel * // for The ALICE HLT Project. * // * // Developed by: Igor Kulakov * // Maksym Zyzak * // * // Permission to use, copy, modify and distribute this software and its * // documentation strictly for non-commercial purposes is hereby granted * // without fee, provided that the above copyright notice appears in all * // copies and that both the copyright notice and this permission notice * // appear in the supporting documentation. The authors make no claims * // about the suitability of this software for any purpose. It is * // provided "as is" without express or implied warranty. * // * //*************************************************************************** #include #include "KFParticleTopoReconstructor.h" #include "KFParticle.h" #include "KFParticleSIMD.h" #include "KFPHistogram/KFPHistogram.h" #ifdef MAIN_DRAW #include "AliHLTTPCCADisplay.h" #endif #include #include #include #include #include using namespace std; #ifndef NVALGRIND #include #endif #include #ifndef HLTCA_STANDALONE #include "TStopwatch.h" typedef TStopwatch Stopwatch; #else #include "Stopwatch.h" #endif #include "pthread.h" #include static bool SAVE = false; extern bool SINGLE_THREADED; extern bool DRAW_EVERY_LINK; static bool file_exists( const char *filename ) { FILE *f = 0; if ( ( f = std::fopen( filename, "r" ) ) != NULL ) { std::fclose( f ); return true; } return false; } int main(int argc, char **argv) { bool fullTiming = false; int firstEvent = 0; int lastEvent = 1000000; int nThreads = 1; int Step=1; int nRuns=1; int repetitions = 1; string filePrefix = "./Events/"; for( int i=1; i < argc; i++ ){ if ( !std::strcmp( argv[i], "-h" ) || !std::strcmp( argv[i], "--help" ) || !std::strcmp( argv[i], "-help" ) ) { std::cout << "Please look in readme.txt" << std::endl; return 0; } else if ( !std::strcmp( argv[i], "-time" ) ) { fullTiming = true; } else if ( !std::strcmp( argv[i], "-dir" ) && ++i < argc ) { filePrefix = argv[i]; } else if ( !std::strcmp( argv[i], "-nThreads" ) && ++i < argc ) { nThreads = atoi( argv[i] ); } else if ( !std::strcmp( argv[i], "-Step" ) && ++i < argc ) { Step = atoi( argv[i] ); } else if ( !std::strcmp( argv[i], "-nRuns" ) && ++i < argc ) { nRuns = atoi( argv[i] ); } else if ( !std::strcmp( argv[i], "-ev" ) && ++i < argc ) { firstEvent = atoi( argv[i] ); if (++i < argc){ lastEvent = atoi( argv[i] ); // std::cout << "Only process events " << firstEvent << ",..," << lastEvent << std::endl; } else{ lastEvent = firstEvent; // std::cout << "Only process event " << lastEvent << std::endl; } } else { firstEvent = atoi( argv[i] ); lastEvent = firstEvent; // std::cout << "Only process event " << lastEvent << std::endl; } } const int NEventsPerThread = lastEvent - firstEvent + 1; fstream OutTime; OutTime.open( "outtime.dat", ios::out ); KFPInputDataArray InputDataPerThread; { std::string LocalfilePrefix = filePrefix; LocalfilePrefix += "/"; const int NEvLocal = NEventsPerThread; InputDataPerThread.fInput = new KFPInputData[NEvLocal]; for ( int kEvents = firstEvent; kEvents <= lastEvent; kEvents++ ) { char buf[6]; sprintf( buf, "%d", kEvents ); const std::string fileName = LocalfilePrefix + "event" + std::string(buf) + "_KFPTracks.data"; if (!InputDataPerThread.fInput[kEvents - firstEvent].ReadDataFromFile(fileName)) { cout << "Data for Event " << kEvents << " can't be read." << std::endl; break; } } } std::cout << nThreads << " " << Step << " " << 1/*nRuns*/ << " " << NEventsPerThread << std::endl; std::cout << std::endl << std::endl; std::cout << " --- tbb ---"< fitSpeedCPU(iThreads); vector fitSpeedReal(iThreads); { timer.Start(); for(int iTimes = 0; iTimes