/// /// @primary authors: S.Gorbunov; I.Kisel /// @ authors: H.Pabst et al. (Intel); M.Zyzak; I.Kulakov /// #include #include "util.h" #include "fit.h" #define DELTA 1.E-1 #define MACRO 1000000 //#define CPP_SOA_FIT #define CT_FIT using namespace std; bool fit_use_range; // use 'range' based interfaces for copyout FieldRegion magField; Stations vStations; Tracks vTracks; MCTracks vMCTracks[maxNTracks]; int main(int argc, char *argv[]){ int nThreads = 1; for( int i=1; i < argc; i++ ){ if ( !std::strcmp( argv[i], "-nThreads" ) && ++i < argc ) { nThreads = atoi( argv[i] ); } } try { ULONG64 starttime, stoptime, ctTime, CPUTime; char *ev = getenv("FIT_USE_RANGE"); if (ev && (atoi(ev) == 1)) { fit_use_range = true; } else { fit_use_range = false; } int i; readInput(nThreads, nTracksPerThread); ftype (*T1)[6] = new ftype[vTracks.nTracks][6]; //for each track, T[6] = x, y, tx, ty, qp, z ftype (*C1)[15] = new ftype[vTracks.nTracks][15]; //for each track, C[15] is the covariance matrix ftype (*T2)[6] = new ftype[vTracks.nTracks][6]; //for Ct version. ftype (*C2)[15] = new ftype[vTracks.nTracks][15]; #ifdef CPP_SOA_FIT fitTracks( T1, C1 ); // warm up starttime = readTime(); for(i=0; i DELTA ){ // errs ++; // //printf("Error: C[%d][%d] %12.8f ===> %12.8f\n", i, j, C2[i][j], C1[i][j]); // break; // } // if( j < 6 ){ // if( fabs( T2[i][j] - T1[i][j] ) > DELTA ){ // errs ++; // //printf("Error: T[%d][%d] %12.8f ===> %12.8f\n", i, j, T2[i][j], T1[i][j]); // break; // } // } // } // } // printf( "===> Errors: %d/%d\n", errs, vTracks.nTracks ); // printf( "----------------------------------------\n" ); // printf( "%10s %12s %-s\n", "Version", "Time(s)", "Speed Up" ); // printf( "%10s %12.6f %-16.3f\n", "C", (double)cTime / MICRO , (double)cTime/cTime ); // printf( "%10s %12.6f %-16.3f\n", "ArBB", (double)ctTime / MICRO , (double)cTime/ctTime ); // printf( "----------------------------------------\n" ); cout<<"Prep[us], CPU fit/tr[us], Real fit/tr[us], CPU[sec], Real[sec] = "<<-1<<"\t"; cout<< (double)ctTime / vTracks.nTracks / Ntimes <<"\t"; cout<< (double)ctTime / vTracks.nTracks / Ntimes <<"\t"; cout<< (double)ctTime / MICRO <<"\t"; cout<< (double)ctTime / MICRO <" << std::endl; exit(1); } return 0; }