| 281 |  | ndf_local -= nConstraints_; | 
| 282 |  |  | 
| 283 |  | #ifdef IS_MPI | 
| 284 | < | MPI::COMM_WORLD.Allreduce(&ndf_local, &ndf_, 1, MPI::INT,MPI::SUM); | 
| 285 | < | MPI::COMM_WORLD.Allreduce(&nfq_local, &nGlobalFluctuatingCharges_, 1, | 
| 286 | < | MPI::INT, MPI::SUM); | 
| 284 | > | MPI_Allreduce(&ndf_local, &ndf_, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); | 
| 285 | > | MPI_Allreduce(&nfq_local, &nGlobalFluctuatingCharges_, 1, | 
| 286 | > | MPI_INT, MPI_SUM, MPI_COMM_WORLD); | 
| 287 | > | // MPI::COMM_WORLD.Allreduce(&ndf_local, &ndf_, 1, MPI::INT,MPI::SUM); | 
| 288 | > | // MPI::COMM_WORLD.Allreduce(&nfq_local, &nGlobalFluctuatingCharges_, 1, | 
| 289 | > | //                           MPI::INT, MPI::SUM); | 
| 290 |  | #else | 
| 291 |  | ndf_ = ndf_local; | 
| 292 |  | nGlobalFluctuatingCharges_ = nfq_local; | 
| 300 |  |  | 
| 301 |  | int SimInfo::getFdf() { | 
| 302 |  | #ifdef IS_MPI | 
| 303 | < | MPI::COMM_WORLD.Allreduce(&fdf_local, &fdf_, 1, MPI::INT, MPI::SUM); | 
| 303 | > | MPI_Allreduce(&fdf_local, &fdf_, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); | 
| 304 | > | // MPI::COMM_WORLD.Allreduce(&fdf_local, &fdf_, 1, MPI::INT, MPI::SUM); | 
| 305 |  | #else | 
| 306 |  | fdf_ = fdf_local; | 
| 307 |  | #endif | 
| 357 |  | } | 
| 358 |  |  | 
| 359 |  | #ifdef IS_MPI | 
| 360 | < | MPI::COMM_WORLD.Allreduce(&ndfRaw_local, &ndfRaw_, 1, MPI::INT, MPI::SUM); | 
| 360 | > | MPI_Allreduce(&ndfRaw_local, &ndfRaw_, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); | 
| 361 | > | // MPI::COMM_WORLD.Allreduce(&ndfRaw_local, &ndfRaw_, 1, MPI::INT, MPI::SUM); | 
| 362 |  | #else | 
| 363 |  | ndfRaw_ = ndfRaw_local; | 
| 364 |  | #endif | 
| 371 |  |  | 
| 372 |  |  | 
| 373 |  | #ifdef IS_MPI | 
| 374 | < | MPI::COMM_WORLD.Allreduce(&ndfTrans_local, &ndfTrans_, 1, | 
| 375 | < | MPI::INT, MPI::SUM); | 
| 374 | > | MPI_Allreduce(&ndfTrans_local, &ndfTrans_, 1, | 
| 375 | > | MPI_INT, MPI_SUM, MPI_COMM_WORLD); | 
| 376 | > | // MPI::COMM_WORLD.Allreduce(&ndfTrans_local, &ndfTrans_, 1, | 
| 377 | > | //                           MPI::INT, MPI::SUM); | 
| 378 |  | #else | 
| 379 |  | ndfTrans_ = ndfTrans_local; | 
| 380 |  | #endif | 
| 756 |  | // count_local holds the number of found types on this processor | 
| 757 |  | int count_local = foundTypes.size(); | 
| 758 |  |  | 
| 759 | < | int nproc = MPI::COMM_WORLD.Get_size(); | 
| 759 | > | int nproc; | 
| 760 | > | MPI_Comm_size( MPI_COMM_WORLD, &nproc); | 
| 761 | > | // int nproc = MPI::COMM_WORLD.Get_size(); | 
| 762 |  |  | 
| 763 |  | // we need arrays to hold the counts and displacement vectors for | 
| 764 |  | // all processors | 
| 766 |  | vector<int> disps(nproc, 0); | 
| 767 |  |  | 
| 768 |  | // fill the counts array | 
| 769 | < | MPI::COMM_WORLD.Allgather(&count_local, 1, MPI::INT, &counts[0], | 
| 770 | < | 1, MPI::INT); | 
| 769 | > | MPI_Allgather(&count_local, 1, MPI_INT, &counts[0], | 
| 770 | > | 1, MPI_INT, MPI_COMM_WORLD); | 
| 771 | > | // MPI::COMM_WORLD.Allgather(&count_local, 1, MPI::INT, &counts[0], | 
| 772 | > | //                           1, MPI::INT); | 
| 773 |  |  | 
| 774 |  | // use the processor counts to compute the displacement array | 
| 775 |  | disps[0] = 0; | 
| 783 |  | vector<int> ftGlobal(totalCount); | 
| 784 |  |  | 
| 785 |  | // now spray out the foundTypes to all the other processors: | 
| 786 | < | MPI::COMM_WORLD.Allgatherv(&foundTypes[0], count_local, MPI::INT, | 
| 787 | < | &ftGlobal[0], &counts[0], &disps[0], | 
| 788 | < | MPI::INT); | 
| 786 | > | MPI_Allgatherv(&foundTypes[0], count_local, MPI_INT, | 
| 787 | > | &ftGlobal[0], &counts[0], &disps[0], | 
| 788 | > | MPI_INT, MPI_COMM_WORLD); | 
| 789 | > | // MPI::COMM_WORLD.Allgatherv(&foundTypes[0], count_local, MPI::INT, | 
| 790 | > | //                            &ftGlobal[0], &counts[0], &disps[0], | 
| 791 | > | //                            MPI::INT); | 
| 792 |  |  | 
| 793 |  | vector<int>::iterator j; | 
| 794 |  |  | 
| 852 |  | } | 
| 853 |  |  | 
| 854 |  | #ifdef IS_MPI | 
| 855 | < | bool temp; | 
| 855 | > | int temp; | 
| 856 | > |  | 
| 857 |  | temp = usesDirectional; | 
| 858 | < | MPI::COMM_WORLD.Allreduce(&temp, &usesDirectionalAtoms_, 1, MPI::BOOL, | 
| 859 | < | MPI::LOR); | 
| 860 | < |  | 
| 858 | > | MPI_Allreduce(MPI_IN_PLACE, &temp, 1, MPI_INT,  MPI_LOR, MPI_COMM_WORLD); | 
| 859 | > | usesDirectionalAtoms_ = (temp == 0) ? false : true; | 
| 860 | > |  | 
| 861 | > | // MPI::COMM_WORLD.Allreduce(&temp, &usesDirectionalAtoms_, 1, MPI::BOOL, | 
| 862 | > | //                           MPI::LOR); | 
| 863 | > |  | 
| 864 |  | temp = usesMetallic; | 
| 865 | < | MPI::COMM_WORLD.Allreduce(&temp, &usesMetallicAtoms_, 1, MPI::BOOL, | 
| 866 | < | MPI::LOR); | 
| 865 | > | MPI_Allreduce(MPI_IN_PLACE, &temp, 1, MPI_INT,  MPI_LOR, MPI_COMM_WORLD); | 
| 866 | > | usesMetallicAtoms_ = (temp == 0) ? false : true; | 
| 867 | > |  | 
| 868 | > | // MPI::COMM_WORLD.Allreduce(&temp, &usesMetallicAtoms_, 1, MPI::BOOL, | 
| 869 | > | //                           MPI::LOR); | 
| 870 |  |  | 
| 871 |  | temp = usesElectrostatic; | 
| 872 | < | MPI::COMM_WORLD.Allreduce(&temp, &usesElectrostaticAtoms_, 1, MPI::BOOL, | 
| 873 | < | MPI::LOR); | 
| 872 | > | MPI_Allreduce(MPI_IN_PLACE, &temp, 1, MPI_INT,  MPI_LOR, MPI_COMM_WORLD); | 
| 873 | > | usesElectrostaticAtoms_ = (temp == 0) ? false : true; | 
| 874 |  |  | 
| 875 | + | // MPI::COMM_WORLD.Allreduce(&temp, &usesElectrostaticAtoms_, 1, MPI::BOOL, | 
| 876 | + | //                           MPI::LOR); | 
| 877 | + |  | 
| 878 |  | temp = usesFluctuatingCharges; | 
| 879 | < | MPI::COMM_WORLD.Allreduce(&temp, &usesFluctuatingCharges_, 1, MPI::BOOL, | 
| 880 | < | MPI::LOR); | 
| 879 | > | MPI_Allreduce(MPI_IN_PLACE, &temp, 1, MPI_INT,  MPI_LOR, MPI_COMM_WORLD); | 
| 880 | > | usesFluctuatingCharges_ = (temp == 0) ? false : true; | 
| 881 | > |  | 
| 882 | > | // MPI::COMM_WORLD.Allreduce(&temp, &usesFluctuatingCharges_, 1, MPI::BOOL, | 
| 883 | > | //                           MPI::LOR); | 
| 884 | > |  | 
| 885 |  | #else | 
| 886 |  |  | 
| 887 |  | usesDirectionalAtoms_ = usesDirectional; | 
| 1099 |  | int SimInfo::getNGlobalConstraints() { | 
| 1100 |  | int nGlobalConstraints; | 
| 1101 |  | #ifdef IS_MPI | 
| 1102 | < | MPI::COMM_WORLD.Allreduce(&nConstraints_, &nGlobalConstraints, 1, | 
| 1103 | < | MPI::INT, MPI::SUM); | 
| 1102 | > | MPI_Allreduce(&nConstraints_, &nGlobalConstraints, 1, | 
| 1103 | > | MPI_INT, MPI_SUM, MPI_COMM_WORLD); | 
| 1104 | > | // MPI::COMM_WORLD.Allreduce(&nConstraints_, &nGlobalConstraints, 1, | 
| 1105 | > | //                           MPI::INT, MPI::SUM); | 
| 1106 |  | #else | 
| 1107 |  | nGlobalConstraints =  nConstraints_; | 
| 1108 |  | #endif |