61 void sample(std::string file_pt, std::string file_wt,
66 std::fstream input_pt, input_wt;
67 input_pt.open(file_pt.c_str(),std::ios::in);
68 input_wt.open(file_wt.c_str(),std::ios::in);
69 if ( !input_pt.is_open() || !input_wt.is_open() ) {
70 if ( !input_pt.is_open() ) {
71 if ( bman->batchID() == 0 ) {
72 std::cout <<
"CANNOT OPEN " << file_pt.c_str() << std::endl;
75 if ( !input_wt.is_open() ) {
76 if ( bman->batchID() == 0 ) {
77 std::cout <<
"CANNOT OPEN " << file_wt.c_str() << std::endl;
82 std::vector<std::vector<Real>> pt(n);
83 std::vector<Real> wt(n,0.0);
84 std::vector<Real> point(
dim,0.0);;
85 for (
int i = 0; i < n; i++) {
86 for (
int j = 0; j <
dim; j++) {
93 int rank = bman->batchID();
94 int nProc = bman->numBatches();
99 if ( rank < rem ) N++;
100 std::vector<std::vector<Real>> my_pt(N);
101 std::vector<Real> my_wt(N,0.0);
103 for (
int i = 0; i < N; i++) {
104 index = i*nProc + rank;
105 my_pt[i] = pt[index];
106 my_wt[i] = wt[index];