// Gathering mcint results from files and summarizing results // usage: ./mcint_fromfile.x // where n_procs are the number of processors used in mcint simulation using namespace std; #include #include // std io #include // std io #include // file io #include // string io #include // to get size of file // find mean of values in vals double mean(double *vals, int n_vals){ double m=0; for(int i=0; i 4) { n_procs = atoi(args[1]); min_block_size = atoi(args[2]); max_block_size = atoi(args[3]); n_block_samples = atoi(args[4]); } else{ cerr << "usage: ./mcint_blocking.x " << " " << endl; exit(1); } // get file size using stat struct stat result; int local_n,n; if(stat("blocks_rank0.dat", &result) == 0){ local_n = result.st_size/sizeof(double); n = local_n*n_procs; } else{ cerr << "error in getting file size" << endl; exit(1); } // get all mc results from files double* mc_results = new double[n]; for(int i=0; i