Révision | 1b3d28b6f186d9249e3fc410ae2d16c4f93e61cd (tree) |
---|---|
l'heure | 2013-11-01 17:35:40 |
Auteur | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
schedule(auto) in openMP is changed to dynamical schedule. #32381
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1560 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -28,6 +28,7 @@ | ||
28 | 28 | #include<stdexcept> |
29 | 29 | #include<omp.h> |
30 | 30 | #include<boost/format.hpp> |
31 | +#include"../../config.h" | |
31 | 32 | #include"../Enums.h" |
32 | 33 | #include"../Uncopyable.h" |
33 | 34 | #include"../PrintController.h" |
@@ -106,7 +107,7 @@ void DensityLogger::DrawDensity(vector<int> elecStateIndeces) const{ | ||
106 | 107 | |
107 | 108 | // density output |
108 | 109 | stringstream ompErrors; |
109 | -#pragma omp parallel for schedule(auto) | |
110 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
110 | 111 | for(int n=0; n<elecStateIndeces.size(); n++){ |
111 | 112 | try{ |
112 | 113 | // validate electronic state |
@@ -28,6 +28,7 @@ | ||
28 | 28 | #include<stdexcept> |
29 | 29 | #include<omp.h> |
30 | 30 | #include<boost/format.hpp> |
31 | +#include"../../config.h" | |
31 | 32 | #include"../Enums.h" |
32 | 33 | #include"../Uncopyable.h" |
33 | 34 | #include"../PrintController.h" |
@@ -91,7 +92,7 @@ void MOLogger::DrawMO(vector<int> moIndeces){ | ||
91 | 92 | |
92 | 93 | // MO output |
93 | 94 | stringstream ompErrors; |
94 | -#pragma omp parallel for schedule(auto) | |
95 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
95 | 96 | for(int i=0; i<moIndeces.size(); i++){ |
96 | 97 | try{ |
97 | 98 | // validate mo number |
@@ -28,6 +28,7 @@ | ||
28 | 28 | #include<stdexcept> |
29 | 29 | #include<omp.h> |
30 | 30 | #include<boost/format.hpp> |
31 | +#include"../config.h" | |
31 | 32 | #include"../base/Enums.h" |
32 | 33 | #include"../base/Uncopyable.h" |
33 | 34 | #include"../base/PrintController.h" |
@@ -871,7 +872,7 @@ void Cndo2::DoDIIS(double** orbitalElectronPopulation, | ||
871 | 872 | &diisStoredErrorVect[diisNumErrorVect-1][0][0], |
872 | 873 | &diisErrorProducts[diisNumErrorVect-1][0]); |
873 | 874 | |
874 | -#pragma omp parallel for schedule(auto) | |
875 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
875 | 876 | for(int mi=0; mi<diisNumErrorVect; mi++){ |
876 | 877 | diisErrorProducts[mi][diisNumErrorVect-1] = diisErrorProducts[diisNumErrorVect-1][mi]; |
877 | 878 | diisErrorProducts[mi][diisNumErrorVect] = -1.0; |
@@ -889,7 +890,7 @@ void Cndo2::DoDIIS(double** orbitalElectronPopulation, | ||
889 | 890 | if(diisNumErrorVect <= step && diisEndError<diisError && diisError<diisStartError){ |
890 | 891 | hasAppliedDIIS = true; |
891 | 892 | try{ |
892 | -#pragma omp parallel for schedule(auto) | |
893 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
893 | 894 | for(int i=0; i<diisNumErrorVect+1; i++){ |
894 | 895 | for(int j=0; j<diisNumErrorVect+1; j++){ |
895 | 896 | tmpDiisErrorProducts[i][j] = diisErrorProducts[i][j]; |
@@ -937,7 +938,7 @@ void Cndo2::DoDamp(double rmsDensity, | ||
937 | 938 | if(0.0 < dampingWeight && dampingThresh < rmsDensity){ |
938 | 939 | hasAppliedDamping = true; |
939 | 940 | stringstream ompErrors; |
940 | -#pragma omp parallel for schedule(auto) | |
941 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
941 | 942 | for(int j=0; j<totalNumberAOs; j++){ |
942 | 943 | try{ |
943 | 944 | for(int k=0; k<totalNumberAOs; k++){ |
@@ -1317,7 +1318,7 @@ double Cndo2::GetMolecularIntegralElement(int moI, int moJ, int moK, int moL, | ||
1317 | 1318 | void Cndo2::UpdateOldOrbitalElectronPopulation(double** oldOrbitalElectronPopulation, |
1318 | 1319 | double const* const* orbitalElectronPopulation, |
1319 | 1320 | int numberAOs) const{ |
1320 | -#pragma omp parallel for schedule(auto) | |
1321 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1321 | 1322 | for(int i=0; i<numberAOs; i++){ |
1322 | 1323 | for(int j=0; j<numberAOs; j++){ |
1323 | 1324 | oldOrbitalElectronPopulation[i][j] = orbitalElectronPopulation[i][j]; |
@@ -1336,7 +1337,7 @@ bool Cndo2::SatisfyConvergenceCriterion(double const* const * oldOrbitalElectron | ||
1336 | 1337 | bool satisfy = false; |
1337 | 1338 | double change = 0.0; |
1338 | 1339 | stringstream ompErrors; |
1339 | -#pragma omp parallel for schedule(auto) reduction(+:change) | |
1340 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) reduction(+:change) | |
1340 | 1341 | for(int i=0; i<numberAOs; i++){ |
1341 | 1342 | try{ |
1342 | 1343 | for(int j=0; j<numberAOs; j++){ |
@@ -1406,7 +1407,7 @@ void Cndo2::CalcFockMatrix(double** fockMatrix, | ||
1406 | 1407 | for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){ |
1407 | 1408 | int calcRank = mu%mpiSize; |
1408 | 1409 | if(mpiRank == calcRank){ |
1409 | -#pragma omp parallel for schedule(auto) | |
1410 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1410 | 1411 | for(int B=A; B<totalNumberAtoms; B++){ |
1411 | 1412 | try{ |
1412 | 1413 | const Atom& atomB = *molecule.GetAtom(B); |
@@ -1587,7 +1588,7 @@ void Cndo2::CalcAtomicElectronPopulation(double* atomicElectronPopulation, | ||
1587 | 1588 | const Molecule& molecule) const{ |
1588 | 1589 | int totalNumberAtoms = molecule.GetNumberAtoms(); |
1589 | 1590 | MallocerFreer::GetInstance()->Initialize<double>(atomicElectronPopulation, totalNumberAtoms); |
1590 | -#pragma omp parallel for schedule(auto) | |
1591 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1591 | 1592 | for(int A=0; A<totalNumberAtoms; A++){ |
1592 | 1593 | int firstAOIndex = molecule.GetAtom(A)->GetFirstAOIndex(); |
1593 | 1594 | int numberAOs = molecule.GetAtom(A)->GetValenceSize(); |
@@ -1617,7 +1618,7 @@ void Cndo2::CalcGammaAB(double** gammaAB, const Molecule& molecule) const{ | ||
1617 | 1618 | int na = atomA.GetValenceShellType() + 1; |
1618 | 1619 | double orbitalExponentA = atomA.GetOrbitalExponent( |
1619 | 1620 | atomA.GetValenceShellType(), s, this->theory); |
1620 | -#pragma omp parallel for schedule(auto) | |
1621 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1621 | 1622 | for(int B=A; B<totalAtomNumber; B++){ |
1622 | 1623 | try{ |
1623 | 1624 | const Atom& atomB = *molecule.GetAtom(B); |
@@ -1697,7 +1698,7 @@ void Cndo2::CalcGammaAB(double** gammaAB, const Molecule& molecule) const{ | ||
1697 | 1698 | MolDS_mpi::molds_mpi_int num = totalAtomNumber*totalAtomNumber; |
1698 | 1699 | MolDS_mpi::MpiProcess::GetInstance()->Broadcast(buff, num, mpiHeadRank); |
1699 | 1700 | |
1700 | -#pragma omp parallel for schedule(auto) | |
1701 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1701 | 1702 | for(int A=0; A<totalAtomNumber; A++){ |
1702 | 1703 | for(int B=0; B<A; B++){ |
1703 | 1704 | gammaAB[A][B] = gammaAB[B][A]; |
@@ -1813,7 +1814,7 @@ void Cndo2::CalcCartesianMatrixByGTOExpansion(double*** cartesianMatrix, | ||
1813 | 1814 | if(mpiRank == calcRank){ |
1814 | 1815 | for(int a=0; a<numValenceAOsA; a++){ |
1815 | 1816 | int mu = firstAOIndexA + a; |
1816 | -#pragma omp parallel for schedule(auto) | |
1817 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1817 | 1818 | for(int B=0; B<totalAtomNumber; B++){ |
1818 | 1819 | try{ |
1819 | 1820 | const Atom& atomB = *molecule.GetAtom(B); |
@@ -3793,7 +3794,7 @@ void Cndo2::CalcOverlapAOsWithAnotherConfiguration(double** overlapAOs, | ||
3793 | 3794 | overlapAOs[mu][mu] = 1.0; |
3794 | 3795 | } |
3795 | 3796 | bool isSymmetricOverlapAOs = false; |
3796 | -#pragma omp for schedule(auto) | |
3797 | +#pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3797 | 3798 | for(int A=0; A<totalAtomNumber; A++){ |
3798 | 3799 | const Atom& lhsAtom = *lhsMolecule.GetAtom(A); |
3799 | 3800 | const Atom& rhsAtom = *rhsMolecule->GetAtom(A); |
@@ -3937,7 +3938,7 @@ void Cndo2::CalcOverlapAOs(double** overlapAOs, const Molecule& molecule) const{ | ||
3937 | 3938 | MallocerFreer::GetInstance()->Malloc<double>(&tmpVectorBC, |
3938 | 3939 | OrbitalType_end*OrbitalType_end); |
3939 | 3940 | bool symmetrize = false; |
3940 | -#pragma omp for schedule(auto) | |
3941 | +#pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3941 | 3942 | for(int B=A+1; B<totalAtomNumber; B++){ |
3942 | 3943 | const Atom& atomB = *molecule.GetAtom(B); |
3943 | 3944 | this->CalcDiatomicOverlapAOsInDiatomicFrame(diatomicOverlapAOs, atomA, atomB); |
@@ -3986,7 +3987,7 @@ void Cndo2::CalcOverlapAOs(double** overlapAOs, const Molecule& molecule) const{ | ||
3986 | 3987 | MolDS_mpi::molds_mpi_int num = totalAONumber*totalAONumber; |
3987 | 3988 | MolDS_mpi::MpiProcess::GetInstance()->Broadcast(buff, num, mpiHeadRank); |
3988 | 3989 | |
3989 | - #pragma omp parallel for schedule(auto) | |
3990 | + #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3990 | 3991 | for(int mu=0; mu<totalAONumber; mu++){ |
3991 | 3992 | overlapAOs[mu][mu] = 1.0; |
3992 | 3993 | for(int nu=mu+1; nu<totalAONumber; nu++){ |
@@ -4321,7 +4322,7 @@ void Cndo2::CalcOverlapAOsByGTOExpansion(double** overlapAOs, | ||
4321 | 4322 | } |
4322 | 4323 | |
4323 | 4324 | stringstream ompErrors; |
4324 | -#pragma omp parallel for schedule(auto) | |
4325 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
4325 | 4326 | for(int A=0; A<totalAtomNumber; A++){ |
4326 | 4327 | try{ |
4327 | 4328 | const Atom& atomA = *molecule.GetAtom(A); |
@@ -0,0 +1,27 @@ | ||
1 | +//************************************************************************// | |
2 | +// Copyright (C) 2011-2013 Mikiya Fujii // | |
3 | +// // | |
4 | +// This file is part of MolDS. // | |
5 | +// // | |
6 | +// MolDS is free software: you can redistribute it and/or modify // | |
7 | +// it under the terms of the GNU General Public License as published by // | |
8 | +// the Free Software Foundation, either version 3 of the License, or // | |
9 | +// (at your option) any later version. // | |
10 | +// // | |
11 | +// MolDS is distributed in the hope that it will be useful, // | |
12 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of // | |
13 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // | |
14 | +// GNU General Public License for more details. // | |
15 | +// // | |
16 | +// You should have received a copy of the GNU General Public License // | |
17 | +// along with MolDS. If not, see <http://www.gnu.org/licenses/>. // | |
18 | +//************************************************************************// | |
19 | +#ifndef INCLUDED_CONFIG | |
20 | +#define INCLUDED_CONFIG | |
21 | +namespace MolDS_base{ | |
22 | +#define MOLDS_OMP_DYNAMIC_CHUNK_SIZE 3 | |
23 | +} | |
24 | +#endif | |
25 | + | |
26 | + | |
27 | + |
@@ -25,6 +25,7 @@ | ||
25 | 25 | #include<vector> |
26 | 26 | #include<stdexcept> |
27 | 27 | #include<boost/format.hpp> |
28 | +#include"../config.h" | |
28 | 29 | #include"../base/Enums.h" |
29 | 30 | #include"../base/Uncopyable.h" |
30 | 31 | #include"../base/PrintController.h" |
@@ -26,6 +26,7 @@ | ||
26 | 26 | #include<stdexcept> |
27 | 27 | #include<boost/shared_ptr.hpp> |
28 | 28 | #include<boost/format.hpp> |
29 | +#include"../config.h" | |
29 | 30 | #include"../base/Enums.h" |
30 | 31 | #include"../base/Uncopyable.h" |
31 | 32 | #include"../base/PrintController.h" |
@@ -136,7 +137,7 @@ void MD::DoMD(){ | ||
136 | 137 | } |
137 | 138 | |
138 | 139 | void MD::UpdateMomenta(const Molecule& molecule, double const* const* matrixForce, double dt) const{ |
139 | -#pragma omp parallel for schedule(auto) | |
140 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
140 | 141 | for(int a=0; a<molecule.GetNumberAtoms(); a++){ |
141 | 142 | Atom* atom = molecule.GetAtom(a); |
142 | 143 | for(int i=0; i<CartesianType_end; i++){ |
@@ -146,7 +147,7 @@ void MD::UpdateMomenta(const Molecule& molecule, double const* const* matrixForc | ||
146 | 147 | } |
147 | 148 | |
148 | 149 | void MD::UpdateCoordinates(Molecule& molecule, double dt) const{ |
149 | -#pragma omp parallel for schedule(auto) | |
150 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
150 | 151 | for(int a=0; a<molecule.GetNumberAtoms(); a++){ |
151 | 152 | Atom* atom = molecule.GetAtom(a); |
152 | 153 | double coreMass = atom->GetAtomicMass() - static_cast<double>(atom->GetNumberValenceElectrons()); |
@@ -26,6 +26,7 @@ | ||
26 | 26 | #include<stdexcept> |
27 | 27 | #include<omp.h> |
28 | 28 | #include<boost/format.hpp> |
29 | +#include"../config.h" | |
29 | 30 | #include"../base/Enums.h" |
30 | 31 | #include"../base/Uncopyable.h" |
31 | 32 | #include"../base/PrintController.h" |
@@ -761,7 +762,7 @@ void Mndo::CalcCISMatrix(double** matrixCIS) const{ | ||
761 | 762 | int moI = this->GetActiveOccIndex(*this->molecule, k); |
762 | 763 | int moA = this->GetActiveVirIndex(*this->molecule, k); |
763 | 764 | stringstream ompErrors; |
764 | -#pragma omp parallel for schedule(auto) | |
765 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
765 | 766 | for(int l=k; l<this->matrixCISdimension; l++){ |
766 | 767 | try{ |
767 | 768 | // single excitation from J-th (occupied)MO to B-th (virtual)MO |
@@ -1770,7 +1771,7 @@ void Mndo::CalcHessianSCF(double** hessianSCF, bool isMassWeighted) const{ | ||
1770 | 1771 | &tmpRotatedDiatomicOverlapVec, |
1771 | 1772 | &tmpMatrixBC, |
1772 | 1773 | &tmpVectorBC); |
1773 | -#pragma omp for schedule(auto) | |
1774 | +#pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1774 | 1775 | for(int indexAtomA=0; indexAtomA<this->molecule->GetNumberAtoms(); indexAtomA++){ |
1775 | 1776 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
1776 | 1777 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -1945,7 +1946,7 @@ void Mndo::CalcOrbitalElectronPopulation1stDerivatives(double**** orbitalElectro | ||
1945 | 1946 | this->SolveCPHF(solutionsCPHF, nonRedundantQIndeces, redundantQIndeces); |
1946 | 1947 | this->TransposeFockMatrixMatrix(transposedFockMatrix); |
1947 | 1948 | stringstream ompErrors; |
1948 | -#pragma omp parallel for schedule(auto) | |
1949 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1949 | 1950 | for(int mu=0; mu<totalNumberAOs; mu++){ |
1950 | 1951 | try{ |
1951 | 1952 | for(int nu=0; nu<totalNumberAOs; nu++){ |
@@ -2036,7 +2037,7 @@ void Mndo::CalcStaticFirstOrderFocks(double** staticFirstOrderFocks, | ||
2036 | 2037 | const vector<MoIndexPair>& nonRedundantQIndeces, |
2037 | 2038 | const vector<MoIndexPair>& redundantQIndeces) const{ |
2038 | 2039 | stringstream ompErrors; |
2039 | -#pragma omp parallel for schedule(auto) | |
2040 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
2040 | 2041 | for(int indexAtomA=0; indexAtomA<this->molecule->GetNumberAtoms(); indexAtomA++){ |
2041 | 2042 | try{ |
2042 | 2043 | for(int axisA=XAxis; axisA<CartesianType_end; axisA++){ |
@@ -2325,7 +2326,7 @@ void Mndo::CalcMatrixCPHF(double** matrixCPHF, | ||
2325 | 2326 | { |
2326 | 2327 | try{ |
2327 | 2328 | // calc diagonal part of N |
2328 | -#pragma omp for schedule(auto) | |
2329 | +#pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
2329 | 2330 | for(int i=0; i<dimensionCPHF; i++){ |
2330 | 2331 | if(i<nonRedundantQIndeces.size()){ |
2331 | 2332 | int moI = nonRedundantQIndeces[i].moI; |
@@ -2340,7 +2341,7 @@ void Mndo::CalcMatrixCPHF(double** matrixCPHF, | ||
2340 | 2341 | } |
2341 | 2342 | |
2342 | 2343 | // calc (\Gamma - K)N |
2343 | -#pragma omp for schedule(auto) | |
2344 | +#pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
2344 | 2345 | for(int i=0; i<nonRedundantQIndeces.size(); i++){ |
2345 | 2346 | int moI = nonRedundantQIndeces[i].moI; |
2346 | 2347 | int moJ = nonRedundantQIndeces[i].moJ; |
@@ -2352,7 +2353,7 @@ void Mndo::CalcMatrixCPHF(double** matrixCPHF, | ||
2352 | 2353 | } |
2353 | 2354 | } |
2354 | 2355 | |
2355 | -#pragma omp for schedule(auto) | |
2356 | +#pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
2356 | 2357 | for(int i=nonRedundantQIndeces.size(); i<dimensionCPHF; i++){ |
2357 | 2358 | int moI = redundantQIndeces[i-nonRedundantQIndeces.size()].moI; |
2358 | 2359 | int moJ = redundantQIndeces[i-nonRedundantQIndeces.size()].moJ; |
@@ -2363,7 +2364,7 @@ void Mndo::CalcMatrixCPHF(double** matrixCPHF, | ||
2363 | 2364 | } |
2364 | 2365 | } |
2365 | 2366 | |
2366 | -#pragma omp for schedule(auto) | |
2367 | +#pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
2367 | 2368 | for(int i=nonRedundantQIndeces.size(); i<dimensionCPHF; i++){ |
2368 | 2369 | int moI = redundantQIndeces[i-nonRedundantQIndeces.size()].moI; |
2369 | 2370 | int moJ = redundantQIndeces[i-nonRedundantQIndeces.size()].moJ; |
@@ -2633,7 +2634,7 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2633 | 2634 | &tmpVectorBC, |
2634 | 2635 | &tmpDiatomicTwoElecTwoCore); |
2635 | 2636 | |
2636 | -#pragma omp for schedule(auto) | |
2637 | +#pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
2637 | 2638 | for(int b=0; b<this->molecule->GetNumberAtoms(); b++){ |
2638 | 2639 | if(a == b){continue;} |
2639 | 2640 | const Atom& atomB = *molecule->GetAtom(b); |
@@ -3523,7 +3524,7 @@ void Mndo::CalcTwoElecTwoCore(double****** twoElecTwoCore, | ||
3523 | 3524 | MallocerFreer::GetInstance()->Malloc<double>(&tmpMatrixBC, dxy*dxy, dxy*dxy); |
3524 | 3525 | MallocerFreer::GetInstance()->Malloc<double>(&tmpVectorBC, dxy*dxy*dxy*dxy); |
3525 | 3526 | // note that terms with condition a==b are not needed to calculate. |
3526 | -#pragma omp for schedule(auto) | |
3527 | +#pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3527 | 3528 | for(int b=a+1; b<totalNumberAtoms; b++){ |
3528 | 3529 | this->CalcDiatomicTwoElecTwoCore(diatomicTwoElecTwoCore, |
3529 | 3530 | tmpDiatomicTwoElecTwoCore, |
@@ -3574,7 +3575,7 @@ void Mndo::CalcTwoElecTwoCore(double****** twoElecTwoCore, | ||
3574 | 3575 | throw MolDSException::Deserialize(errorStream); |
3575 | 3576 | } |
3576 | 3577 | |
3577 | -#pragma omp parallel for schedule(auto) | |
3578 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3578 | 3579 | for(int a=0; a<totalNumberAtoms; a++){ |
3579 | 3580 | for(int b=a+1; b<totalNumberAtoms; b++){ |
3580 | 3581 | int i=0; |
@@ -29,6 +29,7 @@ | ||
29 | 29 | #include<stdexcept> |
30 | 30 | #include<boost/shared_ptr.hpp> |
31 | 31 | #include<boost/format.hpp> |
32 | +#include"../config.h" | |
32 | 33 | #include"../base/Enums.h" |
33 | 34 | #include"../base/Uncopyable.h" |
34 | 35 | #include"../base/PrintController.h" |
@@ -381,7 +382,7 @@ void BFGS::ShiftHessianRedundantMode(double** matrixHessian, | ||
381 | 382 | vectorsRedundantModes[c] = &matrixesRedundantModes[c][0][0]; |
382 | 383 | } |
383 | 384 | for(int c=0; c<numTranslationalModes;c++){ |
384 | -#pragma omp parallel for schedule(auto) | |
385 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
385 | 386 | for(int n=0;n<numAtoms;n++){ |
386 | 387 | for(int d=0;d<CartesianType_end;d++){ |
387 | 388 | matrixesRedundantModes[c][n][d] = c==d? 1.0 : 0.0; |
@@ -394,7 +395,7 @@ void BFGS::ShiftHessianRedundantMode(double** matrixHessian, | ||
394 | 395 | vectorsRedundantModes[c+numTranslationalModes] = &matrixesRedundantModes[c+numTranslationalModes][0][0]; |
395 | 396 | } |
396 | 397 | for(int c=0; c<numRotationalModes;c++){ |
397 | -#pragma omp parallel for schedule(auto) | |
398 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
398 | 399 | for(int n=0;n<numAtoms;n++){ |
399 | 400 | const double* xyz = molecule.GetAtom(n)->GetXyz(); |
400 | 401 | for(int d=0;d<CartesianType_end;d++){ |
@@ -28,6 +28,7 @@ | ||
28 | 28 | #include<stdexcept> |
29 | 29 | #include<boost/shared_ptr.hpp> |
30 | 30 | #include<boost/format.hpp> |
31 | +#include"../config.h" | |
31 | 32 | #include"../base/Enums.h" |
32 | 33 | #include"../base/Uncopyable.h" |
33 | 34 | #include"../base/PrintController.h" |
@@ -289,7 +290,7 @@ GEDIIS::GEDIISHistory::Entry::Entry(double energy, | ||
289 | 290 | energy(energy),numAtoms(molecule.GetNumberAtoms()),matrixCoordinate(NULL),matrixForce(NULL) { |
290 | 291 | MallocerFreer::GetInstance()->Malloc(&this->matrixCoordinate, this->numAtoms, CartesianType_end); |
291 | 292 | MallocerFreer::GetInstance()->Malloc(&this->matrixForce, this->numAtoms, CartesianType_end); |
292 | -#pragma omp parallel for schedule(auto) | |
293 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
293 | 294 | for(int i = 0; i < this->numAtoms; i++){ |
294 | 295 | const Atom* atom = molecule.GetAtom(i); |
295 | 296 | const double* xyz = atom->GetXyz(); |
@@ -27,6 +27,7 @@ | ||
27 | 27 | #include<stdexcept> |
28 | 28 | #include<boost/shared_ptr.hpp> |
29 | 29 | #include<boost/format.hpp> |
30 | +#include"../config.h" | |
30 | 31 | #include"../base/Enums.h" |
31 | 32 | #include"../base/Uncopyable.h" |
32 | 33 | #include"../base/PrintController.h" |
@@ -129,7 +130,7 @@ void Optimizer::CheckEnableTheoryType(TheoryType theoryType) const{ | ||
129 | 130 | } |
130 | 131 | |
131 | 132 | void Optimizer::ClearMolecularMomenta(Molecule& molecule) const{ |
132 | -#pragma omp parallel for schedule(auto) | |
133 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
133 | 134 | for(int a=0; a<molecule.GetNumberAtoms(); a++){ |
134 | 135 | const Atom* atom = molecule.GetAtom(a); |
135 | 136 | atom->SetPxyz(0.0, 0.0, 0.0); |
@@ -137,7 +138,7 @@ void Optimizer::ClearMolecularMomenta(Molecule& molecule) const{ | ||
137 | 138 | } |
138 | 139 | |
139 | 140 | void Optimizer::UpdateMolecularCoordinates(Molecule& molecule, double const* const* matrixForce, double dt) const{ |
140 | -#pragma omp parallel for schedule(auto) | |
141 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
141 | 142 | for(int a=0; a<molecule.GetNumberAtoms(); a++){ |
142 | 143 | const Atom* atom = molecule.GetAtom(a); |
143 | 144 | double coreMass = atom->GetAtomicMass() - static_cast<double>(atom->GetNumberValenceElectrons()); |
@@ -149,7 +150,7 @@ void Optimizer::UpdateMolecularCoordinates(Molecule& molecule, double const* con | ||
149 | 150 | } |
150 | 151 | |
151 | 152 | void Optimizer::UpdateMolecularCoordinates(Molecule& molecule, double const* const* matrixForce) const{ |
152 | -#pragma omp parallel for schedule(auto) | |
153 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
153 | 154 | for(int a=0; a<molecule.GetNumberAtoms(); a++){ |
154 | 155 | const Atom* atom = molecule.GetAtom(a); |
155 | 156 | for(int i=0; i<CartesianType_end; i++){ |
@@ -25,6 +25,7 @@ | ||
25 | 25 | #include<string> |
26 | 26 | #include<stdexcept> |
27 | 27 | #include<boost/format.hpp> |
28 | +#include"../config.h" | |
28 | 29 | #include"../base/Uncopyable.h" |
29 | 30 | #include"../base/PrintController.h" |
30 | 31 | #include"../base/MolDSException.h" |
@@ -239,7 +240,7 @@ void Blas::Dsyr(molds_blas_int n, double alpha, | ||
239 | 240 | CBLAS_UPLO uploA=CblasUpper; |
240 | 241 | molds_blas_int lda = n; |
241 | 242 | cblas_dsyr(CblasRowMajor, uploA, n, alpha, x, incrementX, a, lda); |
242 | -#pragma omp parallel for schedule(auto) | |
243 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
243 | 244 | for(molds_blas_int i=0;i<n;i++){ |
244 | 245 | for(molds_blas_int j=i+1;j<n;j++){ |
245 | 246 | matrixA[j][i] = matrixA[i][j]; // Note that output matrixA is row-major(C/C++ stype) |
@@ -542,7 +543,7 @@ void Blas::Dsyrk(molds_blas_int n, molds_blas_int k, | ||
542 | 543 | molds_blas_int lda = &matrixA[1][0] - &matrixA[0][0]; |
543 | 544 | molds_blas_int ldc = &matrixC[1][0] - &matrixC[0][0]; |
544 | 545 | cblas_dsyrk(orderA, uploC, transA, n, k, alpha, a, lda, beta, c, ldc); |
545 | -#pragma omp parallel for schedule(auto) | |
546 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
546 | 547 | for(molds_blas_int i=0;i<n;i++){ |
547 | 548 | for(molds_blas_int j=i+1;j<n;j++){ |
548 | 549 | if(isLowerTriangularPartMatrixCUsed){ |
@@ -28,6 +28,7 @@ | ||
28 | 28 | #include<algorithm> |
29 | 29 | #include<omp.h> |
30 | 30 | #include<boost/format.hpp> |
31 | +#include"../config.h" | |
31 | 32 | #include"../base/Enums.h" |
32 | 33 | #include"../base/Uncopyable.h" |
33 | 34 | #include"../base/PrintController.h" |
@@ -732,7 +733,7 @@ double ZindoS::GetNishimotoMatagaTwoEleInt1stDerivative(const Atom& atomA, | ||
732 | 733 | void ZindoS::CalcNishimotoMatagaMatrix(double**** nishimotoMatagaMatrix, const Molecule& molecule) const{ |
733 | 734 | int totalNumberAtoms = molecule.GetNumberAtoms(); |
734 | 735 | stringstream ompErrors; |
735 | -#pragma omp parallel for schedule(auto) | |
736 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
736 | 737 | for(int A=0; A<totalNumberAtoms; A++){ |
737 | 738 | try{ |
738 | 739 | const Atom& atomA = *molecule.GetAtom(A); |
@@ -1170,7 +1171,7 @@ void ZindoS::CalcCISProperties(){ | ||
1170 | 1171 | this->electronicTransitionDipoleMoments[excitedState][excitedState][YAxis] = this->electronicTransitionDipoleMoments[groundState][groundState][YAxis]; |
1171 | 1172 | this->electronicTransitionDipoleMoments[excitedState][excitedState][ZAxis] = this->electronicTransitionDipoleMoments[groundState][groundState][ZAxis]; |
1172 | 1173 | double tmpX=0.0, tmpY=0.0, tmpZ=0.0; |
1173 | -#pragma omp parallel for reduction(+:tmpX,tmpY,tmpZ) schedule(auto) | |
1174 | +#pragma omp parallel for reduction(+:tmpX,tmpY,tmpZ) schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1174 | 1175 | for(int l=0; l<this->matrixCISdimension; l++){ |
1175 | 1176 | // single excitation from I-th (occupied)MO to A-th (virtual)MO |
1176 | 1177 | int moI = this->GetActiveOccIndex(*this->molecule, l); |
@@ -1201,7 +1202,7 @@ void ZindoS::CalcCISProperties(){ | ||
1201 | 1202 | this->electronicTransitionDipoleMoments[excitedState][groundState][YAxis] = 0.0; |
1202 | 1203 | this->electronicTransitionDipoleMoments[excitedState][groundState][ZAxis] = 0.0; |
1203 | 1204 | double tmpX=0.0, tmpY=0.0, tmpZ=0.0; |
1204 | -#pragma omp parallel for reduction(+:tmpX,tmpY,tmpZ) schedule(auto) | |
1205 | +#pragma omp parallel for reduction(+:tmpX,tmpY,tmpZ) schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1205 | 1206 | for(int l=0; l<this->matrixCISdimension; l++){ |
1206 | 1207 | // single excitation from I-th (occupied)MO to A-th (virtual)MO |
1207 | 1208 | int moI = this->GetActiveOccIndex(*this->molecule, l); |
@@ -1226,7 +1227,7 @@ void ZindoS::CalcCISProperties(){ | ||
1226 | 1227 | this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][YAxis] = 0.0; |
1227 | 1228 | this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][ZAxis] = 0.0; |
1228 | 1229 | double tmpX=0.0, tmpY=0.0, tmpZ=0.0; |
1229 | -#pragma omp parallel for reduction(+:tmpX,tmpY,tmpZ) schedule(auto) | |
1230 | +#pragma omp parallel for reduction(+:tmpX,tmpY,tmpZ) schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1230 | 1231 | for(int l=0; l<this->matrixCISdimension; l++){ |
1231 | 1232 | // single excitation from I-th (occupied)MO to A-th (virtual)MO |
1232 | 1233 | int moI = this->GetActiveOccIndex(*this->molecule, l); |
@@ -1424,7 +1425,7 @@ void ZindoS::CalcElectronicTransitionDipoleMoment(double* transitionDipoleMoment | ||
1424 | 1425 | if(from != to){ |
1425 | 1426 | if(from != groundState && to != groundState){ |
1426 | 1427 | // transition dipole moment between different excited states |
1427 | -#pragma omp parallel for reduction(+:valueX,valueY,valueZ) schedule(auto) | |
1428 | +#pragma omp parallel for reduction(+:valueX,valueY,valueZ) schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1428 | 1429 | for(int l=0; l<this->matrixCISdimension; l++){ |
1429 | 1430 | try{ |
1430 | 1431 | double temp = 0.0; |
@@ -1462,7 +1463,7 @@ void ZindoS::CalcElectronicTransitionDipoleMoment(double* transitionDipoleMoment | ||
1462 | 1463 | } |
1463 | 1464 | else if(from == groundState && to != groundState){ |
1464 | 1465 | // transition dipole moment from the ground to excited states |
1465 | -#pragma omp parallel for reduction(+:valueX,valueY,valueZ) schedule(auto) | |
1466 | +#pragma omp parallel for reduction(+:valueX,valueY,valueZ) schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1466 | 1467 | for(int l=0; l<this->matrixCISdimension; l++){ |
1467 | 1468 | try{ |
1468 | 1469 | double temp = 0.0; |
@@ -1500,7 +1501,7 @@ void ZindoS::CalcElectronicTransitionDipoleMoment(double* transitionDipoleMoment | ||
1500 | 1501 | } |
1501 | 1502 | else if(from != groundState && to == groundState){ |
1502 | 1503 | // transition dipole moment from the excited to ground states |
1503 | -#pragma omp parallel for reduction(+:valueX,valueY,valueZ) schedule(auto) | |
1504 | +#pragma omp parallel for reduction(+:valueX,valueY,valueZ) schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1504 | 1505 | for(int l=0; l<this->matrixCISdimension; l++){ |
1505 | 1506 | try{ |
1506 | 1507 | double temp = 0.0; |
@@ -1540,7 +1541,7 @@ void ZindoS::CalcElectronicTransitionDipoleMoment(double* transitionDipoleMoment | ||
1540 | 1541 | else{ |
1541 | 1542 | if(from != groundState){ |
1542 | 1543 | // dipole moment of the excited state. It is needed that the dipole of ground state has been already calculated!! |
1543 | -#pragma omp parallel for reduction(+:valueX,valueY,valueZ) schedule(auto) | |
1544 | +#pragma omp parallel for reduction(+:valueX,valueY,valueZ) schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1544 | 1545 | for(int l=0; l<this->matrixCISdimension; l++){ |
1545 | 1546 | try{ |
1546 | 1547 | double temp = 0.0; |
@@ -1650,7 +1651,7 @@ void ZindoS::CalcOrbitalElectronPopulationCIS(double**** orbitalElectronPopulati | ||
1650 | 1651 | for(int k=0; k<elecStates->size(); k++){ |
1651 | 1652 | int excitedStateIndex = (*elecStates)[k]-1; |
1652 | 1653 | stringstream ompErrors; |
1653 | -#pragma omp parallel for schedule(auto) | |
1654 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1654 | 1655 | for(int mu=0; mu<molecule.GetTotalNumberAOs(); mu++){ |
1655 | 1656 | try{ |
1656 | 1657 | for(int nu=0; nu<molecule.GetTotalNumberAOs(); nu++){ |
@@ -1714,7 +1715,7 @@ void ZindoS::CalcAtomicElectronPopulationCIS(double*** atomicElectronPopulationC | ||
1714 | 1715 | // clac atomic electron population |
1715 | 1716 | for(int k=0; k<elecStates->size(); k++){ |
1716 | 1717 | stringstream ompErrors; |
1717 | -#pragma omp parallel for schedule(auto) | |
1718 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1718 | 1719 | for(int a=0; a<totalNumberAtoms; a++){ |
1719 | 1720 | try{ |
1720 | 1721 | int firstAOIndex = molecule.GetAtom(a)->GetFirstAOIndex(); |
@@ -1760,7 +1761,7 @@ void ZindoS::CalcAtomicUnpairedPopulationCIS(double*** atomicUnpairedPopulationC | ||
1760 | 1761 | // calc atomic electron population |
1761 | 1762 | for(int k=0; k<elecStates->size(); k++){ |
1762 | 1763 | stringstream ompErrors; |
1763 | -#pragma omp parallel for schedule(auto) | |
1764 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
1764 | 1765 | for(int a=0; a<totalNumberAtoms; a++){ |
1765 | 1766 | try{ |
1766 | 1767 | int firstAOIndex = molecule.GetAtom(a)->GetFirstAOIndex(); |
@@ -2099,7 +2100,7 @@ void ZindoS::CalcInteractionMatrix(double** interactionMatrix, | ||
2099 | 2100 | double const* const* expansionVectors, |
2100 | 2101 | int interactionMatrixDimension) const{ |
2101 | 2102 | stringstream ompErrors; |
2102 | -#pragma omp parallel for schedule(auto) | |
2103 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
2103 | 2104 | for(int k=0; k<interactionMatrixDimension*interactionMatrixDimension; k++){ |
2104 | 2105 | try{ |
2105 | 2106 | int i = k/interactionMatrixDimension; |
@@ -2363,7 +2364,7 @@ void ZindoS::CalcCISMatrix(double** matrixCIS) const{ | ||
2363 | 2364 | // single excitation from I-th (occupied)MO to A-th (virtual)MO |
2364 | 2365 | int moI = this->GetActiveOccIndex(*this->molecule, k); |
2365 | 2366 | int moA = this->GetActiveVirIndex(*this->molecule, k); |
2366 | -#pragma omp parallel for schedule(auto) | |
2367 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
2367 | 2368 | for(int l=k; l<this->matrixCISdimension; l++){ |
2368 | 2369 | try{ |
2369 | 2370 | // single excitation from J-th (occupied)MO to B-th (virtual)MO |
@@ -2731,7 +2732,7 @@ void ZindoS::CalcEtaMatrixForce(const vector<int>& elecStates){ | ||
2731 | 2732 | |
2732 | 2733 | // calc each element |
2733 | 2734 | stringstream ompErrors; |
2734 | -#pragma omp parallel for schedule(auto) | |
2735 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
2735 | 2736 | for(int mu=0; mu<numberAOs; mu++){ |
2736 | 2737 | try{ |
2737 | 2738 | for(int nu=0; nu<numberAOs; nu++){ |
@@ -2828,7 +2829,7 @@ void ZindoS::CalcZMatrixForce(const vector<int>& elecStates){ | ||
2828 | 2829 | nonRedundantQIndeces.size()); |
2829 | 2830 | // calculate each element of Z matrix. |
2830 | 2831 | stringstream ompErrors; |
2831 | -#pragma omp parallel for schedule(auto) | |
2832 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
2832 | 2833 | for(int mu=0; mu<this->molecule->GetTotalNumberAOs(); mu++){ |
2833 | 2834 | try{ |
2834 | 2835 | for(int nu=0; nu<this->molecule->GetTotalNumberAOs(); nu++){ |
@@ -2963,7 +2964,7 @@ void ZindoS::CalcDeltaVector(double* delta, int exciteState) const{ | ||
2963 | 2964 | int numberActiveMO = numberActiveOcc + numberActiveVir; |
2964 | 2965 | MallocerFreer::GetInstance()->Initialize<double>(delta, numberActiveMO); |
2965 | 2966 | stringstream ompErrors; |
2966 | -#pragma omp parallel for schedule(auto) | |
2967 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
2967 | 2968 | for(int r=0; r<numberActiveMO; r++){ |
2968 | 2969 | try{ |
2969 | 2970 | double value = 0.0; |
@@ -3044,7 +3045,7 @@ void ZindoS::CalcQVector(double* q, | ||
3044 | 3045 | int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2; |
3045 | 3046 | int numberActiveOcc = Parameters::GetInstance()->GetActiveOccCIS(); |
3046 | 3047 | stringstream ompErrors; |
3047 | -#pragma omp parallel for schedule(auto) | |
3048 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3048 | 3049 | for(int i=0; i<nonRedundantQIndeces.size(); i++){ |
3049 | 3050 | try{ |
3050 | 3051 | int moI = nonRedundantQIndeces[i].moI; |
@@ -3074,7 +3075,7 @@ void ZindoS::CalcQVector(double* q, | ||
3074 | 3075 | if(!ompErrors.str().empty()){ |
3075 | 3076 | throw MolDSException::Deserialize(ompErrors); |
3076 | 3077 | } |
3077 | -#pragma omp parallel for schedule(auto) | |
3078 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3078 | 3079 | for(int i=0; i<redundantQIndeces.size(); i++){ |
3079 | 3080 | try{ |
3080 | 3081 | int r = nonRedundantQIndeces.size() + i; |
@@ -3229,7 +3230,7 @@ void ZindoS::CalcXiMatrices(double** xiOcc, | ||
3229 | 3230 | xiVir, numberActiveVir, numberAOs); |
3230 | 3231 | stringstream ompErrors; |
3231 | 3232 | // xiOcc |
3232 | -#pragma omp parallel for schedule(auto) | |
3233 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3233 | 3234 | for(int p=0; p<numberActiveOcc; p++){ |
3234 | 3235 | try{ |
3235 | 3236 | for(int mu=0; mu<numberAOs; mu++){ |
@@ -3251,7 +3252,7 @@ void ZindoS::CalcXiMatrices(double** xiOcc, | ||
3251 | 3252 | throw MolDSException::Deserialize(ompErrors); |
3252 | 3253 | } |
3253 | 3254 | // xiVir |
3254 | -#pragma omp parallel for schedule(auto) | |
3255 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3255 | 3256 | for(int p=0; p<numberActiveVir; p++){ |
3256 | 3257 | try{ |
3257 | 3258 | for(int mu=0; mu<numberAOs; mu++){ |
@@ -3329,7 +3330,7 @@ void ZindoS::CalcGammaNRMinusKNRMatrix(double** gammaNRMinusKNR, const vector<Mo | ||
3329 | 3330 | if(mpiRank == calcRank){ |
3330 | 3331 | int moI = nonRedundantQIndeces[i].moI; |
3331 | 3332 | int moJ = nonRedundantQIndeces[i].moJ; |
3332 | -#pragma omp parallel for schedule(auto) | |
3333 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3333 | 3334 | for(int j=i; j<nonRedundantQIndecesSize; j++){ |
3334 | 3335 | try{ |
3335 | 3336 | int moK = nonRedundantQIndeces[j].moI; |
@@ -3390,7 +3391,7 @@ void ZindoS::CalcKRDagerGammaRInvMatrix(double** kRDagerGammaRInv, | ||
3390 | 3391 | if(mpiRank == calcRank){ |
3391 | 3392 | int moI = nonRedundantQIndeces[i].moI; |
3392 | 3393 | int moJ = nonRedundantQIndeces[i].moJ; |
3393 | -#pragma omp parallel for schedule(auto) | |
3394 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3394 | 3395 | for(int j=0; j<redundantQIndecesSize; j++){ |
3395 | 3396 | try{ |
3396 | 3397 | int moK = redundantQIndeces[j].moI; |
@@ -3686,7 +3687,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3686 | 3687 | &tmpRotatedDiatomicOverlapVec, |
3687 | 3688 | &tmpMatrixBC, |
3688 | 3689 | &tmpVectorBC); |
3689 | -#pragma omp for schedule(auto) | |
3690 | +#pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3690 | 3691 | for(int b=0; b<this->molecule->GetNumberAtoms(); b++){ |
3691 | 3692 | if(a == b){continue;} |
3692 | 3693 | const Atom& atomB = *molecule->GetAtom(b); |
@@ -3845,7 +3846,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3845 | 3846 | // First derivative of overlapAOs integral is |
3846 | 3847 | // calculated with GTO expansion technique. |
3847 | 3848 | stringstream ompErrors; |
3848 | -#pragma omp parallel for schedule(auto) | |
3849 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3849 | 3850 | for(int a=0; a<this->molecule->GetNumberAtoms(); a++){ |
3850 | 3851 | try{ |
3851 | 3852 | const Atom& atomA = *molecule->GetAtom(a); |