修訂 | 8456332b1b4ea04452b74b02515dbd61ae7a1c66 (tree) |
---|---|
時間 | 2013-11-01 18:27:30 |
作者 | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
trunk.r1561 is merged to branches/fx10. schedule(auto) is removed. #32094 #32381
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/branches/fx10@1562 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -37,9 +37,9 @@ EXENAME = molds | ||
37 | 37 | DEPFILE = obj/objfile.dep |
38 | 38 | LDFLAGS = |
39 | 39 | |
40 | -ALL_CPP_FILES = base/Enums.cpp base/PrintController.cpp base/MolDSException.cpp base/MallocerFreer.cpp mpi/MpiProcess.cpp mpi/AsyncCommunicator.cpp wrappers/Blas.cpp wrappers/Lapack.cpp base/Utilities.cpp base/MathUtilities.cpp base/EularAngle.cpp base/Parameters.cpp base/RealSphericalHarmonicsIndex.cpp base/atoms/Atom.cpp base/atoms/Hatom.cpp base/atoms/Liatom.cpp base/atoms/Catom.cpp base/atoms/Natom.cpp base/atoms/Oatom.cpp base/atoms/Satom.cpp base/factories/AtomFactory.cpp base/Molecule.cpp base/InputParser.cpp base/GTOExpansionSTO.cpp base/loggers/MOLogger.cpp base/loggers/DensityLogger.cpp base/loggers/HoleDensityLogger.cpp base/loggers/ParticleDensityLogger.cpp cndo/Cndo2.cpp indo/Indo.cpp zindo/ZindoS.cpp mndo/Mndo.cpp am1/Am1.cpp am1/Am1D.cpp pm3/Pm3.cpp pm3/Pm3D.cpp pm3/Pm3Pddg.cpp base/factories/ElectronicStructureFactory.cpp md/MD.cpp mc/MC.cpp rpmd/RPMD.cpp nasco/NASCO.cpp optimization/Optimizer.cpp optimization/ConjugateGradient.cpp optimization/SteepestDescent.cpp optimization/BFGS.cpp optimization/GEDIIS.cpp base/factories/OptimizerFactory.cpp base/MolDS.cpp Main.cpp | |
41 | -ALL_HEAD_FILES = base/Enums.h base/Uncopyable.h base/PrintController.h base/MolDSException.h base/containers/ThreadSafeQueue.h base/MallocerFreer.h mpi/MpiInt.h mpi/MpiProcess.h mpi/AsyncCommunicator.h wrappers/Blas.h wrappers/Lapack.h base/Utilities.h base/MathUtilities.h base/EularAngle.h base/Parameters.h base/RealSphericalHarmonicsIndex.h base/atoms/Atom.h base/atoms/Hatom.h base/atoms/Liatom.h base/atoms/Catom.h base/atoms/Natom.h base/atoms/Oatom.h base/atoms/Satom.h base/factories/AtomFactory.h base/Molecule.h base/InputParser.h base/GTOExpansionSTO.h base/loggers/MOLogger.h base/loggers/DensityLogger.h base/loggers/HoleDensityLogger.h base/loggers/ParticleDensityLogger.h base/ElectronicStructure.h cndo/Cndo2.h cndo/ReducedOverlapAOsParameters.h indo/Indo.h zindo/ZindoS.h mndo/Mndo.h am1/Am1.h am1/Am1D.h pm3/Pm3.h pm3/Pm3D.h pm3/Pm3Pddg.h base/factories/ElectronicStructureFactory.h md/MD.h mc/MC.h rpmd/RPMD.h nasco/NASCO.h optimization/Optimizer.h optimization/ConjugateGradient.h optimization/SteepestDescent.h optimization/BFGS.h optimization/GEDIIS.h base/factories/OptimizerFactory.h base/MolDS.h | |
42 | -ALL_OBJ_FILES = obj/Enums.o obj/PrintController.o obj/MolDSException.o obj/MallocerFreer.o obj/MpiProcess.o obj/AsyncCommunicator.o obj/Blas.o obj/Lapack.o obj/Utilities.o obj/MathUtilities.o obj/EularAngle.o obj/Parameters.o obj/RealSphericalHarmonicsIndex.o obj/Atom.o obj/Hatom.o obj/Liatom.o obj/Catom.o obj/Natom.o obj/Oatom.o obj/Satom.o obj/AtomFactory.o obj/Molecule.o obj/InputParser.o obj/GTOExpansionSTO.o obj/MOLogger.o obj/DensityLogger.o obj/HoleDensityLogger.o obj/ParticleDensityLogger.o obj/Cndo2.o obj/Indo.o obj/ZindoS.o obj/Mndo.o obj/Am1.o obj/Am1D.o obj/Pm3.o obj/Pm3D.o obj/Pm3Pddg.o obj/ElectronicStructureFactory.o obj/MD.o obj/MC.o obj/RPMD.o obj/NASCO.o obj/Optimizer.o obj/ConjugateGradient.o obj/SteepestDescent.o obj/BFGS.o obj/GEDIIS.o obj/OptimizerFactory.o obj/MolDS.o obj/Main.o | |
40 | +ALL_CPP_FILES = base/Enums.cpp base/PrintController.cpp base/MolDSException.cpp base/MallocerFreer.cpp mpi/MpiProcess.cpp mpi/AsyncCommunicator.cpp wrappers/Blas.cpp wrappers/Lapack.cpp base/Utilities.cpp base/MathUtilities.cpp base/EularAngle.cpp base/Parameters.cpp base/RealSphericalHarmonicsIndex.cpp base/atoms/Atom.cpp base/atoms/Hatom.cpp base/atoms/Liatom.cpp base/atoms/Catom.cpp base/atoms/Natom.cpp base/atoms/Oatom.cpp base/atoms/Satom.cpp base/factories/AtomFactory.cpp base/Molecule.cpp base/InputParser.cpp base/GTOExpansionSTO.cpp base/loggers/MOLogger.cpp base/loggers/DensityLogger.cpp base/loggers/HoleDensityLogger.cpp base/loggers/ParticleDensityLogger.cpp cndo/Cndo2.cpp indo/Indo.cpp zindo/ZindoS.cpp mndo/Mndo.cpp am1/Am1.cpp am1/Am1D.cpp pm3/Pm3.cpp pm3/Pm3D.cpp pm3/Pm3Pddg.cpp base/factories/ElectronicStructureFactory.cpp md/MD.cpp mc/MC.cpp rpmd/RPMD.cpp nasco/NASCO.cpp optimization/Optimizer.cpp optimization/ConjugateGradient.cpp optimization/SteepestDescent.cpp optimization/BFGS.cpp optimization/GEDIIS.cpp base/factories/OptimizerFactory.cpp base/MolDS.cpp Main.cpp | |
41 | +ALL_HEAD_FILES = config.h base/Enums.h base/Uncopyable.h base/PrintController.h base/MolDSException.h base/containers/ThreadSafeQueue.h base/MallocerFreer.h mpi/MpiInt.h mpi/MpiProcess.h mpi/AsyncCommunicator.h wrappers/Blas.h wrappers/Lapack.h base/Utilities.h base/MathUtilities.h base/EularAngle.h base/Parameters.h base/RealSphericalHarmonicsIndex.h base/atoms/Atom.h base/atoms/Hatom.h base/atoms/Liatom.h base/atoms/Catom.h base/atoms/Natom.h base/atoms/Oatom.h base/atoms/Satom.h base/factories/AtomFactory.h base/Molecule.h base/InputParser.h base/GTOExpansionSTO.h base/loggers/MOLogger.h base/loggers/DensityLogger.h base/loggers/HoleDensityLogger.h base/loggers/ParticleDensityLogger.h base/ElectronicStructure.h cndo/Cndo2.h cndo/ReducedOverlapAOsParameters.h indo/Indo.h zindo/ZindoS.h mndo/Mndo.h am1/Am1.h am1/Am1D.h pm3/Pm3.h pm3/Pm3D.h pm3/Pm3Pddg.h base/factories/ElectronicStructureFactory.h md/MD.h mc/MC.h rpmd/RPMD.h nasco/NASCO.h optimization/Optimizer.h optimization/ConjugateGradient.h optimization/SteepestDescent.h optimization/BFGS.h optimization/GEDIIS.h base/factories/OptimizerFactory.h base/MolDS.h | |
42 | +ALL_OBJ_FILES = obj/Enums.o obj/PrintController.o obj/MolDSException.o obj/MallocerFreer.o obj/MpiProcess.o obj/AsyncCommunicator.o obj/Blas.o obj/Lapack.o obj/Utilities.o obj/MathUtilities.o obj/EularAngle.o obj/Parameters.o obj/RealSphericalHarmonicsIndex.o obj/Atom.o obj/Hatom.o obj/Liatom.o obj/Catom.o obj/Natom.o obj/Oatom.o obj/Satom.o obj/AtomFactory.o obj/Molecule.o obj/InputParser.o obj/GTOExpansionSTO.o obj/MOLogger.o obj/DensityLogger.o obj/HoleDensityLogger.o obj/ParticleDensityLogger.o obj/Cndo2.o obj/Indo.o obj/ZindoS.o obj/Mndo.o obj/Am1.o obj/Am1D.o obj/Pm3.o obj/Pm3D.o obj/Pm3Pddg.o obj/ElectronicStructureFactory.o obj/MD.o obj/MC.o obj/RPMD.o obj/NASCO.o obj/Optimizer.o obj/ConjugateGradient.o obj/SteepestDescent.o obj/BFGS.o obj/GEDIIS.o obj/OptimizerFactory.o obj/MolDS.o obj/Main.o | |
43 | 43 | |
44 | 44 | $(EXENAME): $(ALL_OBJ_FILES) |
45 | 45 | $(CC) -o $@ -Wl,-rpath=$(BOOST_LIB_DIR) -L$(BOOST_LIB_DIR) $(LDFLAGS) $(ALL_OBJ_FILES) $(LIBS) |
@@ -34,9 +34,9 @@ EXENAME = molds | ||
34 | 34 | DEPFILE = obj/objfile.dep |
35 | 35 | LDFLAGS = |
36 | 36 | |
37 | -ALL_CPP_FILES = base/Enums.cpp base/PrintController.cpp base/MolDSException.cpp base/MallocerFreer.cpp mpi/MpiProcess.cpp mpi/AsyncCommunicator.cpp wrappers/Blas.cpp wrappers/Lapack.cpp base/Utilities.cpp base/MathUtilities.cpp base/EularAngle.cpp base/Parameters.cpp base/atoms/Atom.cpp base/atoms/Hatom.cpp base/atoms/Liatom.cpp base/atoms/Catom.cpp base/atoms/Natom.cpp base/atoms/Oatom.cpp base/atoms/Satom.cpp base/factories/AtomFactory.cpp base/Molecule.cpp base/InputParser.cpp base/GTOExpansionSTO.cpp base/RealSphericalHarmonicsIndex.cpp base/loggers/MOLogger.cpp base/loggers/DensityLogger.cpp base/loggers/HoleDensityLogger.cpp base/loggers/ParticleDensityLogger.cpp cndo/Cndo2.cpp indo/Indo.cpp zindo/ZindoS.cpp mndo/Mndo.cpp am1/Am1.cpp am1/Am1D.cpp pm3/Pm3.cpp pm3/Pm3D.cpp pm3/Pm3Pddg.cpp base/factories/ElectronicStructureFactory.cpp md/MD.cpp mc/MC.cpp rpmd/RPMD.cpp nasco/NASCO.cpp optimization/Optimizer.cpp optimization/ConjugateGradient.cpp optimization/SteepestDescent.cpp optimization/BFGS.cpp optimization/GEDIIS.cpp base/factories/OptimizerFactory.cpp base/MolDS.cpp Main.cpp | |
38 | -ALL_HEAD_FILES = base/Enums.h base/Uncopyable.h base/PrintController.h base/MolDSException.h base/containers/ThreadSafeQueue.h base/MallocerFreer.h mpi/MpiInt.h mpi/MpiProcess.h mpi/AsyncCommunicator.h wrappers/Blas.h wrappers/Lapack.h base/Utilities.h base/MathUtilities.h base/EularAngle.h base/Parameters.h base/atoms/Atom.h base/atoms/Hatom.h base/atoms/Liatom.h base/atoms/Catom.h base/atoms/Natom.h base/atoms/Oatom.h base/atoms/Satom.h base/factories/AtomFactory.h base/Molecule.h base/InputParser.h base/GTOExpansionSTO.h base/RealSphericalHarmonicsIndex.h base/loggers/MOLogger.h base/loggers/DensityLogger.h base/loggers/HoleDensityLogger.h base/loggers/ParticleDensityLogger.h base/ElectronicStructure.h cndo/Cndo2.h cndo/ReducedOverlapAOsParameters.h indo/Indo.h zindo/ZindoS.h mndo/Mndo.h am1/Am1.h am1/Am1D.h pm3/Pm3.h pm3/Pm3D.h pm3/Pm3Pddg.h base/factories/ElectronicStructureFactory.h md/MD.h mc/MC.h rpmd/RPMD.h nasco/NASCO.h optimization/Optimizer.h optimization/ConjugateGradient.h optimization/SteepestDescent.h optimization/BFGS.h optimization/GEDIIS.h base/factories/OptimizerFactory.h base/MolDS.h | |
39 | -ALL_OBJ_FILES = obj/Enums.o obj/PrintController.o obj/MolDSException.o obj/MallocerFreer.o obj/MpiProcess.o obj/AsyncCommunicator.o obj/Blas.o obj/Lapack.o obj/Utilities.o obj/MathUtilities.o obj/EularAngle.o obj/Parameters.o obj/Atom.o obj/Hatom.o obj/Liatom.o obj/Catom.o obj/Natom.o obj/Oatom.o obj/Satom.o obj/AtomFactory.o obj/Molecule.o obj/InputParser.o obj/GTOExpansionSTO.o obj/RealSphericalHarmonicsIndex.o obj/MOLogger.o obj/DensityLogger.o obj/HoleDensityLogger.o obj/ParticleDensityLogger.o obj/Cndo2.o obj/Indo.o obj/ZindoS.o obj/Mndo.o obj/Am1.o obj/Am1D.o obj/Pm3.o obj/Pm3D.o obj/Pm3Pddg.o obj/ElectronicStructureFactory.o obj/MD.o obj/MC.o obj/RPMD.o obj/NASCO.o obj/Optimizer.o obj/ConjugateGradient.o obj/SteepestDescent.o obj/BFGS.o obj/GEDIIS.o obj/OptimizerFactory.o obj/MolDS.o obj/Main.o | |
37 | +ALL_CPP_FILES = base/Enums.cpp base/PrintController.cpp base/MolDSException.cpp base/MallocerFreer.cpp mpi/MpiProcess.cpp mpi/AsyncCommunicator.cpp wrappers/Blas.cpp wrappers/Lapack.cpp base/Utilities.cpp base/MathUtilities.cpp base/EularAngle.cpp base/Parameters.cpp base/atoms/Atom.cpp base/atoms/Hatom.cpp base/atoms/Liatom.cpp base/atoms/Catom.cpp base/atoms/Natom.cpp base/atoms/Oatom.cpp base/atoms/Satom.cpp base/factories/AtomFactory.cpp base/Molecule.cpp base/InputParser.cpp base/GTOExpansionSTO.cpp base/RealSphericalHarmonicsIndex.cpp base/loggers/MOLogger.cpp base/loggers/DensityLogger.cpp base/loggers/HoleDensityLogger.cpp base/loggers/ParticleDensityLogger.cpp cndo/Cndo2.cpp indo/Indo.cpp zindo/ZindoS.cpp mndo/Mndo.cpp am1/Am1.cpp am1/Am1D.cpp pm3/Pm3.cpp pm3/Pm3D.cpp pm3/Pm3Pddg.cpp base/factories/ElectronicStructureFactory.cpp md/MD.cpp mc/MC.cpp rpmd/RPMD.cpp nasco/NASCO.cpp optimization/Optimizer.cpp optimization/ConjugateGradient.cpp optimization/SteepestDescent.cpp optimization/BFGS.cpp optimization/GEDIIS.cpp base/factories/OptimizerFactory.cpp base/MolDS.cpp Main.cpp | |
38 | +ALL_HEAD_FILES = config.h base/Enums.h base/Uncopyable.h base/PrintController.h base/MolDSException.h base/containers/ThreadSafeQueue.h base/MallocerFreer.h mpi/MpiInt.h mpi/MpiProcess.h mpi/AsyncCommunicator.h wrappers/Blas.h wrappers/Lapack.h base/Utilities.h base/MathUtilities.h base/EularAngle.h base/Parameters.h base/atoms/Atom.h base/atoms/Hatom.h base/atoms/Liatom.h base/atoms/Catom.h base/atoms/Natom.h base/atoms/Oatom.h base/atoms/Satom.h base/factories/AtomFactory.h base/Molecule.h base/InputParser.h base/GTOExpansionSTO.h base/RealSphericalHarmonicsIndex.h base/loggers/MOLogger.h base/loggers/DensityLogger.h base/loggers/HoleDensityLogger.h base/loggers/ParticleDensityLogger.h base/ElectronicStructure.h cndo/Cndo2.h cndo/ReducedOverlapAOsParameters.h indo/Indo.h zindo/ZindoS.h mndo/Mndo.h am1/Am1.h am1/Am1D.h pm3/Pm3.h pm3/Pm3D.h pm3/Pm3Pddg.h base/factories/ElectronicStructureFactory.h md/MD.h mc/MC.h rpmd/RPMD.h nasco/NASCO.h optimization/Optimizer.h optimization/ConjugateGradient.h optimization/SteepestDescent.h optimization/BFGS.h optimization/GEDIIS.h base/factories/OptimizerFactory.h base/MolDS.h | |
39 | +ALL_OBJ_FILES = obj/Enums.o obj/PrintController.o obj/MolDSException.o obj/MallocerFreer.o obj/MpiProcess.o obj/AsyncCommunicator.o obj/Blas.o obj/Lapack.o obj/Utilities.o obj/MathUtilities.o obj/EularAngle.o obj/Parameters.o obj/Atom.o obj/Hatom.o obj/Liatom.o obj/Catom.o obj/Natom.o obj/Oatom.o obj/Satom.o obj/AtomFactory.o obj/Molecule.o obj/InputParser.o obj/GTOExpansionSTO.o obj/RealSphericalHarmonicsIndex.o obj/MOLogger.o obj/DensityLogger.o obj/HoleDensityLogger.o obj/ParticleDensityLogger.o obj/Cndo2.o obj/Indo.o obj/ZindoS.o obj/Mndo.o obj/Am1.o obj/Am1D.o obj/Pm3.o obj/Pm3D.o obj/Pm3Pddg.o obj/ElectronicStructureFactory.o obj/MD.o obj/MC.o obj/RPMD.o obj/NASCO.o obj/Optimizer.o obj/ConjugateGradient.o obj/SteepestDescent.o obj/BFGS.o obj/GEDIIS.o obj/OptimizerFactory.o obj/MolDS.o obj/Main.o | |
40 | 40 | |
41 | 41 | $(EXENAME): $(ALL_OBJ_FILES) |
42 | 42 | $(CC) -o $@ $(LDFLAGS) -Wl,-rpath=$(BOOST_LIB_DIR) -Wl,-rpath=$(OPENBLAS_LIB_DIR) $(LDFLAGS) $(ALL_OBJ_FILES) -L$(BOOST_LIB_DIR) -L$(OPENBLAS_LIB_DIR) $(LIBS) |
@@ -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" |
@@ -305,7 +306,7 @@ void Blas::Dsyr(molds_blas_int n, double alpha, | ||
305 | 306 | #else |
306 | 307 | CBLAS_UPLO uploA=CblasUpper; |
307 | 308 | cblas_dsyr(CblasRowMajor, uploA, n, alpha, x, incrementX, a, lda); |
308 | -#pragma omp parallel for schedule(auto) | |
309 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
309 | 310 | for(molds_blas_int i=0;i<n;i++){ |
310 | 311 | for(molds_blas_int j=i+1;j<n;j++){ |
311 | 312 | matrixA[j][i] = matrixA[i][j]; // Note that output matrixA is row-major(C/C++ stype) |
@@ -690,7 +691,7 @@ void Blas::Dsyrk(molds_blas_int n, molds_blas_int k, | ||
690 | 691 | CBLAS_UPLO uploC= isLowerTriangularPartMatrixCUsed ? CblasLower : CblasUpper; |
691 | 692 | CBLAS_TRANSPOSE transA= isMatrixATransposed ? CblasTrans : CblasNoTrans; |
692 | 693 | cblas_dsyrk(orderA, uploC, transA, n, k, alpha, a, lda, beta, c, ldc); |
693 | -#pragma omp parallel for schedule(auto) | |
694 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
694 | 695 | for(molds_blas_int i=0;i<n;i++){ |
695 | 696 | for(molds_blas_int j=i+1;j<n;j++){ |
696 | 697 | 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++){ |
@@ -3344,7 +3345,7 @@ void ZindoS::CalcGammaNRMinusKNRMatrix(double** gammaNRMinusKNR, const vector<Mo | ||
3344 | 3345 | if(mpiRank == calcRank){ |
3345 | 3346 | int moI = nonRedundantQIndeces[i].moI; |
3346 | 3347 | int moJ = nonRedundantQIndeces[i].moJ; |
3347 | -#pragma omp parallel for schedule(auto) | |
3348 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3348 | 3349 | for(int j=i; j<nonRedundantQIndecesSize; j++){ |
3349 | 3350 | try{ |
3350 | 3351 | int moK = nonRedundantQIndeces[j].moI; |
@@ -3405,7 +3406,7 @@ void ZindoS::CalcKRDagerGammaRInvMatrix(double** kRDagerGammaRInv, | ||
3405 | 3406 | if(mpiRank == calcRank){ |
3406 | 3407 | int moI = nonRedundantQIndeces[i].moI; |
3407 | 3408 | int moJ = nonRedundantQIndeces[i].moJ; |
3408 | -#pragma omp parallel for schedule(auto) | |
3409 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3409 | 3410 | for(int j=0; j<redundantQIndecesSize; j++){ |
3410 | 3411 | try{ |
3411 | 3412 | int moK = redundantQIndeces[j].moI; |
@@ -3701,7 +3702,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3701 | 3702 | &tmpRotatedDiatomicOverlapVec, |
3702 | 3703 | &tmpMatrixBC, |
3703 | 3704 | &tmpVectorBC); |
3704 | -#pragma omp for schedule(auto) | |
3705 | +#pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3705 | 3706 | for(int b=0; b<this->molecule->GetNumberAtoms(); b++){ |
3706 | 3707 | if(a == b){continue;} |
3707 | 3708 | const Atom& atomB = *molecule->GetAtom(b); |
@@ -3860,7 +3861,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3860 | 3861 | // First derivative of overlapAOs integral is |
3861 | 3862 | // calculated with GTO expansion technique. |
3862 | 3863 | stringstream ompErrors; |
3863 | -#pragma omp parallel for schedule(auto) | |
3864 | +#pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) | |
3864 | 3865 | for(int a=0; a<this->molecule->GetNumberAtoms(); a++){ |
3865 | 3866 | try{ |
3866 | 3867 | const Atom& atomA = *molecule->GetAtom(a); |