27 void sample(std::string file_pt, std::string file_wt,
32 std::fstream input_pt, input_wt;
33 input_pt.open(file_pt.c_str(),std::ios::in);
34 input_wt.open(file_wt.c_str(),std::ios::in);
35 if ( !input_pt.is_open() || !input_wt.is_open() ) {
36 if ( !input_pt.is_open() ) {
37 if ( bman->batchID() == 0 ) {
38 std::cout <<
"CANNOT OPEN " << file_pt.c_str() << std::endl;
41 if ( !input_wt.is_open() ) {
42 if ( bman->batchID() == 0 ) {
43 std::cout <<
"CANNOT OPEN " << file_wt.c_str() << std::endl;
48 std::vector<std::vector<Real>> pt(n);
49 std::vector<Real> wt(n,0.0);
50 std::vector<Real> point(
dim,0.0);;
51 for (
int i = 0; i < n; i++) {
52 for (
int j = 0; j <
dim; j++) {
59 int rank = bman->batchID();
60 int nProc = bman->numBatches();
65 if ( rank < rem ) N++;
66 std::vector<std::vector<Real>> my_pt(N);
67 std::vector<Real> my_wt(N,0.0);
69 for (
int i = 0; i < N; i++) {
70 index = i*nProc + rank;