• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révisionf0be4549046b93203758692755f4d8615124fad3 (tree)
l'heure2013-06-20 11:15:14
AuteurMikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Message de Log

ZindoS::CalcCISProperties is parallelized by openMP and MPI. #31588

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/branches/mpi-cis@1369 1136aad2-a195-0410-b898-f5ea1d11b9d8

Change Summary

Modification

--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -23,8 +23,7 @@
2323 #include<stdexcept>
2424 #include<boost/shared_ptr.hpp>
2525 #include<boost/format.hpp>
26-#include<boost/mpi/environment.hpp>
27-#include<boost/mpi/communicator.hpp>
26+#include<boost/mpi.hpp>
2827 #include"base/Uncopyable.h"
2928 #include"mpi/MpiProcess.h"
3029 #include"base/PrintController.h"
--- a/src/am1/Am1.cpp
+++ b/src/am1/Am1.cpp
@@ -24,8 +24,7 @@
2424 #include<string>
2525 #include<vector>
2626 #include<boost/format.hpp>
27-#include<boost/mpi/environment.hpp>
28-#include<boost/mpi/communicator.hpp>
27+#include<boost/mpi.hpp>
2928 #include"../base/Uncopyable.h"
3029 #include"../mpi/MpiProcess.h"
3130 #include"../base/PrintController.h"
--- a/src/am1/Am1D.cpp
+++ b/src/am1/Am1D.cpp
@@ -24,8 +24,7 @@
2424 #include<string>
2525 #include<vector>
2626 #include<boost/format.hpp>
27-#include<boost/mpi/environment.hpp>
28-#include<boost/mpi/communicator.hpp>
27+#include<boost/mpi.hpp>
2928 #include"../base/Uncopyable.h"
3029 #include"../mpi/MpiProcess.h"
3130 #include"../base/PrintController.h"
--- a/src/base/InputParser.cpp
+++ b/src/base/InputParser.cpp
@@ -28,8 +28,7 @@
2828 #include<vector>
2929 #include<stdexcept>
3030 #include<boost/format.hpp>
31-#include<boost/mpi/environment.hpp>
32-#include<boost/mpi/communicator.hpp>
31+#include<boost/mpi.hpp>
3332 #include"Uncopyable.h"
3433 #include"../mpi/MpiProcess.h"
3534 #include"PrintController.h"
--- a/src/base/MallocerFreer.cpp
+++ b/src/base/MallocerFreer.cpp
@@ -25,8 +25,7 @@
2525 #include<vector>
2626 #include<stdexcept>
2727 #include<boost/format.hpp>
28-#include<boost/mpi/environment.hpp>
29-#include<boost/mpi/communicator.hpp>
28+#include<boost/mpi.hpp>
3029 #include"Uncopyable.h"
3130 #include"../mpi/MpiProcess.h"
3231 #include"PrintController.h"
--- a/src/base/MathUtilities.cpp
+++ b/src/base/MathUtilities.cpp
@@ -23,8 +23,7 @@
2323 #include<math.h>
2424 #include<stdexcept>
2525 #include<boost/format.hpp>
26-#include<boost/mpi/environment.hpp>
27-#include<boost/mpi/communicator.hpp>
26+#include<boost/mpi.hpp>
2827 #include<boost/math/special_functions/factorials.hpp>
2928 #include"Uncopyable.h"
3029 #include"../mpi/MpiProcess.h"
--- a/src/base/MolDS.cpp
+++ b/src/base/MolDS.cpp
@@ -29,8 +29,7 @@
2929 #include<omp.h>
3030 #include<boost/shared_ptr.hpp>
3131 #include<boost/random.hpp>
32-#include<boost/mpi/environment.hpp>
33-#include<boost/mpi/communicator.hpp>
32+#include<boost/mpi.hpp>
3433 #include"Uncopyable.h"
3534 #include"../mpi/MpiProcess.h"
3635 #include"PrintController.h"
--- a/src/base/Molecule.cpp
+++ b/src/base/Molecule.cpp
@@ -25,8 +25,7 @@
2525 #include<vector>
2626 #include<stdexcept>
2727 #include<boost/format.hpp>
28-#include<boost/mpi/environment.hpp>
29-#include<boost/mpi/communicator.hpp>
28+#include<boost/mpi.hpp>
3029 #include"Uncopyable.h"
3130 #include"../mpi/MpiProcess.h"
3231 #include"PrintController.h"
--- a/src/base/Parameters.cpp
+++ b/src/base/Parameters.cpp
@@ -27,8 +27,7 @@
2727 #include<vector>
2828 #include<stdexcept>
2929 #include<boost/format.hpp>
30-#include<boost/mpi/environment.hpp>
31-#include<boost/mpi/communicator.hpp>
30+#include<boost/mpi.hpp>
3231 #include"Uncopyable.h"
3332 #include"../mpi/MpiProcess.h"
3433 #include"PrintController.h"
--- a/src/base/Utilities.cpp
+++ b/src/base/Utilities.cpp
@@ -25,8 +25,7 @@
2525 #include<time.h>
2626 #include<omp.h>
2727 #include<boost/format.hpp>
28-#include<boost/mpi/environment.hpp>
29-#include<boost/mpi/communicator.hpp>
28+#include<boost/mpi.hpp>
3029 #include"Uncopyable.h"
3130 #include"../mpi/MpiProcess.h"
3231 #include"PrintController.h"
--- a/src/base/atoms/Atom.cpp
+++ b/src/base/atoms/Atom.cpp
@@ -26,8 +26,7 @@
2626 #include<vector>
2727 #include<stdexcept>
2828 #include<boost/format.hpp>
29-#include<boost/mpi/environment.hpp>
30-#include<boost/mpi/communicator.hpp>
29+#include<boost/mpi.hpp>
3130 #include"../Uncopyable.h"
3231 #include"../../mpi/MpiProcess.h"
3332 #include"../PrintController.h"
--- a/src/base/atoms/Catom.cpp
+++ b/src/base/atoms/Catom.cpp
@@ -23,8 +23,7 @@
2323 #include<math.h>
2424 #include<vector>
2525 #include<boost/format.hpp>
26-#include<boost/mpi/environment.hpp>
27-#include<boost/mpi/communicator.hpp>
26+#include<boost/mpi.hpp>
2827 #include"../Uncopyable.h"
2928 #include"../../mpi/MpiProcess.h"
3029 #include"../PrintController.h"
--- a/src/base/atoms/Hatom.cpp
+++ b/src/base/atoms/Hatom.cpp
@@ -23,8 +23,7 @@
2323 #include<math.h>
2424 #include<vector>
2525 #include<boost/format.hpp>
26-#include<boost/mpi/environment.hpp>
27-#include<boost/mpi/communicator.hpp>
26+#include<boost/mpi.hpp>
2827 #include"../Uncopyable.h"
2928 #include"../../mpi/MpiProcess.h"
3029 #include"../PrintController.h"
--- a/src/base/atoms/Liatom.cpp
+++ b/src/base/atoms/Liatom.cpp
@@ -23,8 +23,7 @@
2323 #include<math.h>
2424 #include<vector>
2525 #include<boost/format.hpp>
26-#include<boost/mpi/environment.hpp>
27-#include<boost/mpi/communicator.hpp>
26+#include<boost/mpi.hpp>
2827 #include"../Uncopyable.h"
2928 #include"../../mpi/MpiProcess.h"
3029 #include"../PrintController.h"
--- a/src/base/atoms/Natom.cpp
+++ b/src/base/atoms/Natom.cpp
@@ -23,8 +23,7 @@
2323 #include<math.h>
2424 #include<vector>
2525 #include<boost/format.hpp>
26-#include<boost/mpi/environment.hpp>
27-#include<boost/mpi/communicator.hpp>
26+#include<boost/mpi.hpp>
2827 #include"../Uncopyable.h"
2928 #include"../../mpi/MpiProcess.h"
3029 #include"../PrintController.h"
--- a/src/base/atoms/Oatom.cpp
+++ b/src/base/atoms/Oatom.cpp
@@ -23,8 +23,7 @@
2323 #include<math.h>
2424 #include<vector>
2525 #include<boost/format.hpp>
26-#include<boost/mpi/environment.hpp>
27-#include<boost/mpi/communicator.hpp>
26+#include<boost/mpi.hpp>
2827 #include"../Uncopyable.h"
2928 #include"../../mpi/MpiProcess.h"
3029 #include"../PrintController.h"
--- a/src/base/atoms/Satom.cpp
+++ b/src/base/atoms/Satom.cpp
@@ -23,8 +23,7 @@
2323 #include<math.h>
2424 #include<vector>
2525 #include<boost/format.hpp>
26-#include<boost/mpi/environment.hpp>
27-#include<boost/mpi/communicator.hpp>
26+#include<boost/mpi.hpp>
2827 #include"../Uncopyable.h"
2928 #include"../../mpi/MpiProcess.h"
3029 #include"../PrintController.h"
--- a/src/base/factories/AtomFactory.cpp
+++ b/src/base/factories/AtomFactory.cpp
@@ -23,8 +23,7 @@
2323 #include<vector>
2424 #include<stdexcept>
2525 #include<boost/format.hpp>
26-#include<boost/mpi/environment.hpp>
27-#include<boost/mpi/communicator.hpp>
26+#include<boost/mpi.hpp>
2827 #include"../Uncopyable.h"
2928 #include"../../mpi/MpiProcess.h"
3029 #include"../PrintController.h"
--- a/src/base/factories/ElectronicStructureFactory.cpp
+++ b/src/base/factories/ElectronicStructureFactory.cpp
@@ -24,8 +24,7 @@
2424 #include<vector>
2525 #include<stdexcept>
2626 #include<boost/format.hpp>
27-#include<boost/mpi/environment.hpp>
28-#include<boost/mpi/communicator.hpp>
27+#include<boost/mpi.hpp>
2928 #include"../Uncopyable.h"
3029 #include"../../mpi/MpiProcess.h"
3130 #include"../PrintController.h"
--- a/src/base/factories/OptimizerFactory.cpp
+++ b/src/base/factories/OptimizerFactory.cpp
@@ -25,8 +25,7 @@
2525 #include<stdexcept>
2626 #include<boost/shared_ptr.hpp>
2727 #include<boost/format.hpp>
28-#include<boost/mpi/environment.hpp>
29-#include<boost/mpi/communicator.hpp>
28+#include<boost/mpi.hpp>
3029 #include"../Uncopyable.h"
3130 #include"../../mpi/MpiProcess.h"
3231 #include"../PrintController.h"
--- a/src/base/loggers/DensityLogger.cpp
+++ b/src/base/loggers/DensityLogger.cpp
@@ -28,8 +28,7 @@
2828 #include<stdexcept>
2929 #include<omp.h>
3030 #include<boost/format.hpp>
31-#include<boost/mpi/environment.hpp>
32-#include<boost/mpi/communicator.hpp>
31+#include<boost/mpi.hpp>
3332 #include"../Uncopyable.h"
3433 #include"../../mpi/MpiProcess.h"
3534 #include"../PrintController.h"
--- a/src/base/loggers/HoleDensityLogger.cpp
+++ b/src/base/loggers/HoleDensityLogger.cpp
@@ -28,8 +28,7 @@
2828 #include<stdexcept>
2929 #include<omp.h>
3030 #include<boost/format.hpp>
31-#include<boost/mpi/environment.hpp>
32-#include<boost/mpi/communicator.hpp>
31+#include<boost/mpi.hpp>
3332 #include"../Uncopyable.h"
3433 #include"../../mpi/MpiProcess.h"
3534 #include"../PrintController.h"
--- a/src/base/loggers/MOLogger.cpp
+++ b/src/base/loggers/MOLogger.cpp
@@ -28,8 +28,7 @@
2828 #include<stdexcept>
2929 #include<omp.h>
3030 #include<boost/format.hpp>
31-#include<boost/mpi/environment.hpp>
32-#include<boost/mpi/communicator.hpp>
31+#include<boost/mpi.hpp>
3332 #include"../Uncopyable.h"
3433 #include"../../mpi/MpiProcess.h"
3534 #include"../PrintController.h"
--- a/src/base/loggers/ParticleDensityLogger.cpp
+++ b/src/base/loggers/ParticleDensityLogger.cpp
@@ -28,8 +28,7 @@
2828 #include<stdexcept>
2929 #include<omp.h>
3030 #include<boost/format.hpp>
31-#include<boost/mpi/environment.hpp>
32-#include<boost/mpi/communicator.hpp>
31+#include<boost/mpi.hpp>
3332 #include"../Uncopyable.h"
3433 #include"../../mpi/MpiProcess.h"
3534 #include"../PrintController.h"
--- a/src/cndo/Cndo2.cpp
+++ b/src/cndo/Cndo2.cpp
@@ -28,8 +28,7 @@
2828 #include<stdexcept>
2929 #include<omp.h>
3030 #include<boost/format.hpp>
31-#include<boost/mpi/environment.hpp>
32-#include<boost/mpi/communicator.hpp>
31+#include<boost/mpi.hpp>
3332 #include"../base/Uncopyable.h"
3433 #include"../mpi/MpiProcess.h"
3534 #include"../base/PrintController.h"
--- a/src/indo/Indo.cpp
+++ b/src/indo/Indo.cpp
@@ -25,8 +25,7 @@
2525 #include<vector>
2626 #include<stdexcept>
2727 #include<boost/format.hpp>
28-#include<boost/mpi/environment.hpp>
29-#include<boost/mpi/communicator.hpp>
28+#include<boost/mpi.hpp>
3029 #include"../base/Uncopyable.h"
3130 #include"../mpi/MpiProcess.h"
3231 #include"../base/PrintController.h"
--- a/src/mc/MC.cpp
+++ b/src/mc/MC.cpp
@@ -27,8 +27,7 @@
2727 #include<boost/shared_ptr.hpp>
2828 #include<boost/random.hpp>
2929 #include<boost/format.hpp>
30-#include<boost/mpi/environment.hpp>
31-#include<boost/mpi/communicator.hpp>
30+#include<boost/mpi.hpp>
3231 #include"../base/Uncopyable.h"
3332 #include"../mpi/MpiProcess.h"
3433 #include"../base/PrintController.h"
--- a/src/md/MD.cpp
+++ b/src/md/MD.cpp
@@ -26,8 +26,7 @@
2626 #include<stdexcept>
2727 #include<boost/shared_ptr.hpp>
2828 #include<boost/format.hpp>
29-#include<boost/mpi/environment.hpp>
30-#include<boost/mpi/communicator.hpp>
29+#include<boost/mpi.hpp>
3130 #include"../base/Uncopyable.h"
3231 #include"../mpi/MpiProcess.h"
3332 #include"../base/PrintController.h"
--- a/src/mndo/Mndo.cpp
+++ b/src/mndo/Mndo.cpp
@@ -26,8 +26,7 @@
2626 #include<stdexcept>
2727 #include<omp.h>
2828 #include<boost/format.hpp>
29-#include<boost/mpi/environment.hpp>
30-#include<boost/mpi/communicator.hpp>
29+#include<boost/mpi.hpp>
3130 #include"../base/Uncopyable.h"
3231 #include"../mpi/MpiProcess.h"
3332 #include"../base/PrintController.h"
--- a/src/mpi/MpiProcess.cpp
+++ b/src/mpi/MpiProcess.cpp
@@ -23,8 +23,7 @@
2323 #include<math.h>
2424 #include<string>
2525 #include<stdexcept>
26-#include<boost/mpi/environment.hpp>
27-#include<boost/mpi/communicator.hpp>
26+#include<boost/mpi.hpp>
2827 #include"../base/MolDSException.h"
2928 #include"../base/Uncopyable.h"
3029 #include"MpiProcess.h"
--- a/src/nasco/NASCO.cpp
+++ b/src/nasco/NASCO.cpp
@@ -27,8 +27,7 @@
2727 #include<boost/shared_ptr.hpp>
2828 #include<boost/random.hpp>
2929 #include<boost/format.hpp>
30-#include<boost/mpi/environment.hpp>
31-#include<boost/mpi/communicator.hpp>
30+#include<boost/mpi.hpp>
3231 #include"../base/Uncopyable.h"
3332 #include"../mpi/MpiProcess.h"
3433 #include"../base/PrintController.h"
--- a/src/optimization/BFGS.cpp
+++ b/src/optimization/BFGS.cpp
@@ -28,8 +28,7 @@
2828 #include<stdexcept>
2929 #include<boost/shared_ptr.hpp>
3030 #include<boost/format.hpp>
31-#include<boost/mpi/environment.hpp>
32-#include<boost/mpi/communicator.hpp>
31+#include<boost/mpi.hpp>
3332 #include"../base/Uncopyable.h"
3433 #include"../mpi/MpiProcess.h"
3534 #include"../base/PrintController.h"
--- a/src/optimization/ConjugateGradient.cpp
+++ b/src/optimization/ConjugateGradient.cpp
@@ -27,8 +27,7 @@
2727 #include<stdexcept>
2828 #include<boost/shared_ptr.hpp>
2929 #include<boost/format.hpp>
30-#include<boost/mpi/environment.hpp>
31-#include<boost/mpi/communicator.hpp>
30+#include<boost/mpi.hpp>
3231 #include"../base/Uncopyable.h"
3332 #include"../mpi/MpiProcess.h"
3433 #include"../base/PrintController.h"
--- a/src/optimization/Optimizer.cpp
+++ b/src/optimization/Optimizer.cpp
@@ -27,8 +27,7 @@
2727 #include<stdexcept>
2828 #include<boost/shared_ptr.hpp>
2929 #include<boost/format.hpp>
30-#include<boost/mpi/environment.hpp>
31-#include<boost/mpi/communicator.hpp>
30+#include<boost/mpi.hpp>
3231 #include"../base/Uncopyable.h"
3332 #include"../mpi/MpiProcess.h"
3433 #include"../base/PrintController.h"
--- a/src/optimization/SteepestDescent.cpp
+++ b/src/optimization/SteepestDescent.cpp
@@ -27,8 +27,7 @@
2727 #include<stdexcept>
2828 #include<boost/shared_ptr.hpp>
2929 #include<boost/format.hpp>
30-#include<boost/mpi/environment.hpp>
31-#include<boost/mpi/communicator.hpp>
30+#include<boost/mpi.hpp>
3231 #include"../base/Uncopyable.h"
3332 #include"../mpi/MpiProcess.h"
3433 #include"../base/PrintController.h"
--- a/src/pm3/Pm3.cpp
+++ b/src/pm3/Pm3.cpp
@@ -24,8 +24,7 @@
2424 #include<string>
2525 #include<vector>
2626 #include<boost/format.hpp>
27-#include<boost/mpi/environment.hpp>
28-#include<boost/mpi/communicator.hpp>
27+#include<boost/mpi.hpp>
2928 #include"../base/Uncopyable.h"
3029 #include"../mpi/MpiProcess.h"
3130 #include"../base/PrintController.h"
--- a/src/pm3/Pm3D.cpp
+++ b/src/pm3/Pm3D.cpp
@@ -24,8 +24,7 @@
2424 #include<string>
2525 #include<vector>
2626 #include<boost/format.hpp>
27-#include<boost/mpi/environment.hpp>
28-#include<boost/mpi/communicator.hpp>
27+#include<boost/mpi.hpp>
2928 #include"../base/Uncopyable.h"
3029 #include"../mpi/MpiProcess.h"
3130 #include"../base/PrintController.h"
--- a/src/pm3/Pm3Pddg.cpp
+++ b/src/pm3/Pm3Pddg.cpp
@@ -24,8 +24,7 @@
2424 #include<string>
2525 #include<vector>
2626 #include<boost/format.hpp>
27-#include<boost/mpi/environment.hpp>
28-#include<boost/mpi/communicator.hpp>
27+#include<boost/mpi.hpp>
2928 #include"../base/Uncopyable.h"
3029 #include"../mpi/MpiProcess.h"
3130 #include"../base/PrintController.h"
--- a/src/rpmd/RPMD.cpp
+++ b/src/rpmd/RPMD.cpp
@@ -27,8 +27,7 @@
2727 #include<boost/shared_ptr.hpp>
2828 #include<boost/random.hpp>
2929 #include<boost/format.hpp>
30-#include<boost/mpi/environment.hpp>
31-#include<boost/mpi/communicator.hpp>
30+#include<boost/mpi.hpp>
3231 #include"../base/Uncopyable.h"
3332 #include"../mpi/MpiProcess.h"
3433 #include"../base/PrintController.h"
--- a/src/wrappers/Blas.cpp
+++ b/src/wrappers/Blas.cpp
@@ -25,8 +25,7 @@
2525 #include<string>
2626 #include<stdexcept>
2727 #include<boost/format.hpp>
28-#include<boost/mpi/environment.hpp>
29-#include<boost/mpi/communicator.hpp>
28+#include<boost/mpi.hpp>
3029 #ifdef __INTEL_COMPILER
3130 #include"mkl.h"
3231 #else
--- a/src/wrappers/Lapack.cpp
+++ b/src/wrappers/Lapack.cpp
@@ -24,8 +24,7 @@
2424 #include<string>
2525 #include<stdexcept>
2626 #include<boost/format.hpp>
27-#include<boost/mpi/environment.hpp>
28-#include<boost/mpi/communicator.hpp>
27+#include<boost/mpi.hpp>
2928 #ifdef __INTEL_COMPILER
3029 #include"mkl.h"
3130 #else
--- a/src/zindo/ZindoS.cpp
+++ b/src/zindo/ZindoS.cpp
@@ -28,8 +28,7 @@
2828 #include<algorithm>
2929 #include<omp.h>
3030 #include<boost/format.hpp>
31-#include<boost/mpi/environment.hpp>
32-#include<boost/mpi/communicator.hpp>
31+#include<boost/mpi.hpp>
3332 #include"../base/Uncopyable.h"
3433 #include"../mpi/MpiProcess.h"
3534 #include"../base/PrintController.h"
@@ -1087,131 +1086,184 @@ void ZindoS::DoCIS(){
10871086 void ZindoS::CalcCISProperties(){
10881087 //calculate dipole moments and transitiondipolemoment
10891088 {
1090- double*** dipoleMOs = NULL;
1091- double** overlapMOs = NULL;
10921089 int totalNumberAOs = this->molecule->GetTotalNumberAOs();
10931090 int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2;
10941091 int numberActiveOcc = Parameters::GetInstance()->GetActiveOccCIS();
10951092 int numberActiveVir = Parameters::GetInstance()->GetActiveVirCIS();
1096- MallocerFreer::GetInstance()->Malloc<double>(&dipoleMOs, CartesianType_end, totalNumberAOs, totalNumberAOs);
1097- MallocerFreer::GetInstance()->Malloc<double>(&overlapMOs, totalNumberAOs, totalNumberAOs);
1098- double alpha=1.0;
1099- double beta =0.0;
1100- //double ompStartTime = omp_get_wtime();
1101- MolDS_wrappers::Blas::GetInstance()->Dgemmm(false, false, true, totalNumberAOs, totalNumberAOs, totalNumberAOs, totalNumberAOs,
1102- alpha,
1103- this->fockMatrix,
1104- this->cartesianMatrix[XAxis],
1105- this->fockMatrix,
1106- beta,
1107- dipoleMOs[XAxis]);
1108- MolDS_wrappers::Blas::GetInstance()->Dgemmm(false, false, true, totalNumberAOs, totalNumberAOs, totalNumberAOs, totalNumberAOs,
1109- alpha,
1110- this->fockMatrix,
1111- this->cartesianMatrix[YAxis],
1112- this->fockMatrix,
1113- beta,
1114- dipoleMOs[YAxis]);
1115- MolDS_wrappers::Blas::GetInstance()->Dgemmm(false, false, true, totalNumberAOs, totalNumberAOs, totalNumberAOs, totalNumberAOs,
1116- alpha,
1117- this->fockMatrix,
1118- this->cartesianMatrix[ZAxis],
1119- this->fockMatrix,
1120- beta,
1121- dipoleMOs[ZAxis]);
1122-
1123- double const* centerOfDipole = this->molecule->GetXyzCOC();
1124- // set orign of dipole
1125- MolDS_wrappers::Blas::GetInstance()->Dgemmm(false, false, true, totalNumberAOs, totalNumberAOs, totalNumberAOs, totalNumberAOs,
1126- alpha,
1127- this->fockMatrix,
1128- this->overlapAOs,
1129- this->fockMatrix,
1130- beta,
1131- overlapMOs);
1132- MolDS_wrappers::Blas::GetInstance()->Daxpy(totalNumberAOs*totalNumberAOs,
1133- -centerOfDipole[XAxis],
1134- &overlapMOs[0][0],
1135- &dipoleMOs[XAxis][0][0]);
1136- MolDS_wrappers::Blas::GetInstance()->Daxpy(totalNumberAOs*totalNumberAOs,
1137- -centerOfDipole[YAxis],
1138- &overlapMOs[0][0],
1139- &dipoleMOs[YAxis][0][0]);
1140- MolDS_wrappers::Blas::GetInstance()->Daxpy(totalNumberAOs*totalNumberAOs,
1141- -centerOfDipole[ZAxis],
1142- &overlapMOs[0][0],
1143- &dipoleMOs[ZAxis][0][0]);
1144-
1145-
1146- // dipole moments of excited states
1147- //this->CalcElectronicDipoleMomentsExcitedStates(this->electronicTransitionDipoleMoments,
1148- // this->fockMatrix,
1149- // this->matrixCIS,
1150- // this->cartesianMatrix,
1151- // *this->molecule,
1152- // this->orbitalElectronPopulation,
1153- // this->overlapAOs);
1154- int groundState = 0;
1155- for(int k=0; k<Parameters::GetInstance()->GetNumberExcitedStatesCIS(); k++){
1156- int excitedState = k+1; // (k+1)-th excited state
1157- this->electronicTransitionDipoleMoments[excitedState][excitedState][XAxis] = this->electronicTransitionDipoleMoments[groundState][groundState][XAxis];
1158- this->electronicTransitionDipoleMoments[excitedState][excitedState][YAxis] = this->electronicTransitionDipoleMoments[groundState][groundState][YAxis];
1159- this->electronicTransitionDipoleMoments[excitedState][excitedState][ZAxis] = this->electronicTransitionDipoleMoments[groundState][groundState][ZAxis];
1160- for(int l=0; l<this->matrixCISdimension; l++){
1161- // single excitation from I-th (occupied)MO to A-th (virtual)MO
1162- int moI = this->GetActiveOccIndex(*this->molecule, l);
1163- int moA = this->GetActiveVirIndex(*this->molecule, l);
1164- double temp = matrixCIS[k][l]*matrixCIS[k][l];
1165- this->electronicTransitionDipoleMoments[excitedState][excitedState][XAxis] += temp*(-dipoleMOs[XAxis][moI][moI]+dipoleMOs[XAxis][moA][moA]);
1166- this->electronicTransitionDipoleMoments[excitedState][excitedState][YAxis] += temp*(-dipoleMOs[YAxis][moI][moI]+dipoleMOs[YAxis][moA][moA]);
1167- this->electronicTransitionDipoleMoments[excitedState][excitedState][ZAxis] += temp*(-dipoleMOs[ZAxis][moI][moI]+dipoleMOs[ZAxis][moA][moA]);
1168- }
1169- }
1170-
1171- // transition dipole moment
1172- //this->CalcElectronicTransitionDipoleMoments(this->electronicTransitionDipoleMoments,
1173- // this->fockMatrix,
1174- // this->matrixCIS,
1175- // this->cartesianMatrix,
1176- // *this->molecule,
1177- // this->orbitalElectronPopulation,
1178- // this->overlapAOs);
1179- for(int k=0; k<Parameters::GetInstance()->GetNumberExcitedStatesCIS(); k++){
1180- int excitedState = k+1; // (k+1)-th excited state
1181- this->electronicTransitionDipoleMoments[excitedState][groundState][XAxis] = 0.0;
1182- this->electronicTransitionDipoleMoments[excitedState][groundState][YAxis] = 0.0;
1183- this->electronicTransitionDipoleMoments[excitedState][groundState][ZAxis] = 0.0;
1184- for(int l=0; l<this->matrixCISdimension; l++){
1185- // single excitation from I-th (occupied)MO to A-th (virtual)MO
1186- int moI = this->GetActiveOccIndex(*this->molecule, l);
1187- int moA = this->GetActiveVirIndex(*this->molecule, l);
1188- //double temp = matrixCIS[k][l]*matrixCIS[k][l];
1189- double temp = this->matrixCIS[k][l]*sqrt(2.0);
1190- this->electronicTransitionDipoleMoments[excitedState][groundState][XAxis] += temp*dipoleMOs[XAxis][moA][moI];
1191- this->electronicTransitionDipoleMoments[excitedState][groundState][YAxis] += temp*dipoleMOs[YAxis][moA][moI];
1192- this->electronicTransitionDipoleMoments[excitedState][groundState][ZAxis] += temp*dipoleMOs[ZAxis][moA][moI];
1193- }
1194- }
1195- if(Parameters::GetInstance()->RequiresAllTransitionDipoleMomentsCIS()){
1093+ boost::mpi::communicator* world = MolDS_mpi::MpiProcess::GetInstance()->GetCommunicator();
1094+ double*** dipoleMOs = NULL;
1095+ double** overlapMOs = NULL;
1096+ try{
1097+ MallocerFreer::GetInstance()->Malloc<double>(&dipoleMOs, CartesianType_end, totalNumberAOs, totalNumberAOs);
1098+ MallocerFreer::GetInstance()->Malloc<double>(&overlapMOs, totalNumberAOs, totalNumberAOs);
1099+ double alpha=1.0;
1100+ double beta =0.0;
1101+ //double ompStartTime = omp_get_wtime();
1102+ MolDS_wrappers::Blas::GetInstance()->Dgemmm(false, false, true, totalNumberAOs, totalNumberAOs, totalNumberAOs, totalNumberAOs,
1103+ alpha,
1104+ this->fockMatrix,
1105+ this->cartesianMatrix[XAxis],
1106+ this->fockMatrix,
1107+ beta,
1108+ dipoleMOs[XAxis]);
1109+ MolDS_wrappers::Blas::GetInstance()->Dgemmm(false, false, true, totalNumberAOs, totalNumberAOs, totalNumberAOs, totalNumberAOs,
1110+ alpha,
1111+ this->fockMatrix,
1112+ this->cartesianMatrix[YAxis],
1113+ this->fockMatrix,
1114+ beta,
1115+ dipoleMOs[YAxis]);
1116+ MolDS_wrappers::Blas::GetInstance()->Dgemmm(false, false, true, totalNumberAOs, totalNumberAOs, totalNumberAOs, totalNumberAOs,
1117+ alpha,
1118+ this->fockMatrix,
1119+ this->cartesianMatrix[ZAxis],
1120+ this->fockMatrix,
1121+ beta,
1122+ dipoleMOs[ZAxis]);
1123+
1124+ double const* centerOfDipole = this->molecule->GetXyzCOC();
1125+ // set orign of dipole
1126+ MolDS_wrappers::Blas::GetInstance()->Dgemmm(false, false, true, totalNumberAOs, totalNumberAOs, totalNumberAOs, totalNumberAOs,
1127+ alpha,
1128+ this->fockMatrix,
1129+ this->overlapAOs,
1130+ this->fockMatrix,
1131+ beta,
1132+ overlapMOs);
1133+ MolDS_wrappers::Blas::GetInstance()->Daxpy(totalNumberAOs*totalNumberAOs,
1134+ -centerOfDipole[XAxis],
1135+ &overlapMOs[0][0],
1136+ &dipoleMOs[XAxis][0][0]);
1137+ MolDS_wrappers::Blas::GetInstance()->Daxpy(totalNumberAOs*totalNumberAOs,
1138+ -centerOfDipole[YAxis],
1139+ &overlapMOs[0][0],
1140+ &dipoleMOs[YAxis][0][0]);
1141+ MolDS_wrappers::Blas::GetInstance()->Daxpy(totalNumberAOs*totalNumberAOs,
1142+ -centerOfDipole[ZAxis],
1143+ &overlapMOs[0][0],
1144+ &dipoleMOs[ZAxis][0][0]);
1145+
1146+
1147+ // dipole moments of excited states
1148+ //this->CalcElectronicDipoleMomentsExcitedStates(this->electronicTransitionDipoleMoments,
1149+ // this->fockMatrix,
1150+ // this->matrixCIS,
1151+ // this->cartesianMatrix,
1152+ // *this->molecule,
1153+ // this->orbitalElectronPopulation,
1154+ // this->overlapAOs);
1155+ int groundState = 0;
11961156 for(int k=0; k<Parameters::GetInstance()->GetNumberExcitedStatesCIS(); k++){
1197- int departureExcitedState = k+1; // (k+1)-th excited state
1198- for(int l=k+1; l<Parameters::GetInstance()->GetNumberExcitedStatesCIS(); l++){
1199- int destinationExcitedState = l+1; // (l+1)-th excited state
1200- this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][XAxis] = 0.0;
1201- this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][YAxis] = 0.0;
1202- this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][ZAxis] = 0.0;
1203- for(int l=0; l<this->matrixCISdimension; l++){
1204- // single excitation from I-th (occupied)MO to A-th (virtual)MO
1205- int moI = this->GetActiveOccIndex(*this->molecule, l);
1206- int moA = this->GetActiveVirIndex(*this->molecule, l);
1207- double temp = matrixCIS[departureExcitedState-1][l]*matrixCIS[destinationExcitedState-1][l];
1208- this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][XAxis] += temp*(-dipoleMOs[XAxis][moI][moI]+dipoleMOs[XAxis][moA][moA]);
1209- this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][YAxis] += temp*(-dipoleMOs[YAxis][moI][moI]+dipoleMOs[YAxis][moA][moA]);
1210- this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][ZAxis] += temp*(-dipoleMOs[ZAxis][moI][moI]+dipoleMOs[ZAxis][moA][moA]);
1157+ int excitedState = k+1; // (k+1)-th excited state
1158+ if(excitedState%world->size() != world->rank()){continue;}
1159+ this->electronicTransitionDipoleMoments[excitedState][excitedState][XAxis] = this->electronicTransitionDipoleMoments[groundState][groundState][XAxis];
1160+ this->electronicTransitionDipoleMoments[excitedState][excitedState][YAxis] = this->electronicTransitionDipoleMoments[groundState][groundState][YAxis];
1161+ this->electronicTransitionDipoleMoments[excitedState][excitedState][ZAxis] = this->electronicTransitionDipoleMoments[groundState][groundState][ZAxis];
1162+ double tmpX=0.0, tmpY=0.0, tmpZ=0.0;
1163+#pragma omp parallel for reduction(+:tmpX,tmpY,tmpZ) schedule(auto)
1164+ for(int l=0; l<this->matrixCISdimension; l++){
1165+ // single excitation from I-th (occupied)MO to A-th (virtual)MO
1166+ int moI = this->GetActiveOccIndex(*this->molecule, l);
1167+ int moA = this->GetActiveVirIndex(*this->molecule, l);
1168+ double temp = matrixCIS[k][l]*matrixCIS[k][l];
1169+ tmpX += temp*(-dipoleMOs[XAxis][moI][moI]+dipoleMOs[XAxis][moA][moA]);
1170+ tmpY += temp*(-dipoleMOs[YAxis][moI][moI]+dipoleMOs[YAxis][moA][moA]);
1171+ tmpZ += temp*(-dipoleMOs[ZAxis][moI][moI]+dipoleMOs[ZAxis][moA][moA]);
1172+ }
1173+ this->electronicTransitionDipoleMoments[excitedState][excitedState][XAxis] += tmpX;
1174+ this->electronicTransitionDipoleMoments[excitedState][excitedState][YAxis] += tmpY;
1175+ this->electronicTransitionDipoleMoments[excitedState][excitedState][ZAxis] += tmpZ;
1176+
1177+ }
1178+
1179+ // transition dipole moment
1180+ //this->CalcElectronicTransitionDipoleMoments(this->electronicTransitionDipoleMoments,
1181+ // this->fockMatrix,
1182+ // this->matrixCIS,
1183+ // this->cartesianMatrix,
1184+ // *this->molecule,
1185+ // this->orbitalElectronPopulation,
1186+ // this->overlapAOs);
1187+ for(int k=0; k<Parameters::GetInstance()->GetNumberExcitedStatesCIS(); k++){
1188+ int excitedState = k+1; // (k+1)-th excited state
1189+ if(excitedState%world->size() != world->rank()){continue;}
1190+ this->electronicTransitionDipoleMoments[excitedState][groundState][XAxis] = 0.0;
1191+ this->electronicTransitionDipoleMoments[excitedState][groundState][YAxis] = 0.0;
1192+ this->electronicTransitionDipoleMoments[excitedState][groundState][ZAxis] = 0.0;
1193+ double tmpX=0.0, tmpY=0.0, tmpZ=0.0;
1194+#pragma omp parallel for reduction(+:tmpX,tmpY,tmpZ) schedule(auto)
1195+ for(int l=0; l<this->matrixCISdimension; l++){
1196+ // single excitation from I-th (occupied)MO to A-th (virtual)MO
1197+ int moI = this->GetActiveOccIndex(*this->molecule, l);
1198+ int moA = this->GetActiveVirIndex(*this->molecule, l);
1199+ //double temp = matrixCIS[k][l]*matrixCIS[k][l];
1200+ double tmp = this->matrixCIS[k][l]*sqrt(2.0);
1201+ tmpX += tmp*dipoleMOs[XAxis][moA][moI];
1202+ tmpY += tmp*dipoleMOs[YAxis][moA][moI];
1203+ tmpZ += tmp*dipoleMOs[ZAxis][moA][moI];
1204+ }
1205+ this->electronicTransitionDipoleMoments[excitedState][groundState][XAxis] += tmpX;
1206+ this->electronicTransitionDipoleMoments[excitedState][groundState][YAxis] += tmpY;
1207+ this->electronicTransitionDipoleMoments[excitedState][groundState][ZAxis] += tmpZ;
1208+ }
1209+ if(Parameters::GetInstance()->RequiresAllTransitionDipoleMomentsCIS()){
1210+ for(int k=0; k<Parameters::GetInstance()->GetNumberExcitedStatesCIS(); k++){
1211+ int departureExcitedState = k+1; // (k+1)-th excited state
1212+ for(int l=k+1; l<Parameters::GetInstance()->GetNumberExcitedStatesCIS(); l++){
1213+ int destinationExcitedState = l+1; // (l+1)-th excited state
1214+ if(destinationExcitedState%world->size() != world->rank()){continue;}
1215+ this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][XAxis] = 0.0;
1216+ this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][YAxis] = 0.0;
1217+ this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][ZAxis] = 0.0;
1218+ double tmpX=0.0, tmpY=0.0, tmpZ=0.0;
1219+#pragma omp parallel for reduction(+:tmpX,tmpY,tmpZ) schedule(auto)
1220+ for(int l=0; l<this->matrixCISdimension; l++){
1221+ // single excitation from I-th (occupied)MO to A-th (virtual)MO
1222+ int moI = this->GetActiveOccIndex(*this->molecule, l);
1223+ int moA = this->GetActiveVirIndex(*this->molecule, l);
1224+ double tmp = matrixCIS[departureExcitedState-1][l]*matrixCIS[destinationExcitedState-1][l];
1225+ tmpX += tmp*(-dipoleMOs[XAxis][moI][moI]+dipoleMOs[XAxis][moA][moA]);
1226+ tmpY += tmp*(-dipoleMOs[YAxis][moI][moI]+dipoleMOs[YAxis][moA][moA]);
1227+ tmpZ += tmp*(-dipoleMOs[ZAxis][moI][moI]+dipoleMOs[ZAxis][moA][moA]);
1228+ }
1229+ this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][XAxis] += tmpX;
1230+ this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][YAxis] += tmpY;
1231+ this->electronicTransitionDipoleMoments[destinationExcitedState][departureExcitedState][ZAxis] += tmpZ;
12111232 }
12121233 }
12131234 }
1235+ }
1236+ catch(MolDSException ex){
1237+ MallocerFreer::GetInstance()->Free<double>(&dipoleMOs, CartesianType_end, totalNumberAOs, totalNumberAOs);
1238+ MallocerFreer::GetInstance()->Free<double>(&overlapMOs, totalNumberAOs, totalNumberAOs);
1239+ throw ex;
1240+ }
1241+ MallocerFreer::GetInstance()->Free<double>(&dipoleMOs, CartesianType_end, totalNumberAOs, totalNumberAOs);
1242+ MallocerFreer::GetInstance()->Free<double>(&overlapMOs, totalNumberAOs, totalNumberAOs);
1243+
1244+ // communication to collect all matrix data on rank 0
1245+ int numTransported = (Parameters::GetInstance()->GetNumberExcitedStatesCIS()+1)*CartesianType_end;
1246+ if(world->rank() == 0){
1247+ // receive the matrix data from other ranks
1248+ for(int k=0; k<Parameters::GetInstance()->GetNumberExcitedStatesCIS()+1; k++){
1249+ if(k%world->size() == 0){continue;}
1250+ int source = k%world->size();
1251+ int tag = k;
1252+ world->recv(source, tag, &this->electronicTransitionDipoleMoments[k][0][0], numTransported);
1253+ }
1254+ }
1255+ else{
1256+ // send the matrix data to rank-0
1257+ for(int k=0; k<Parameters::GetInstance()->GetNumberExcitedStatesCIS()+1; k++){
1258+ if(k%world->size() != world->rank()){continue;}
1259+ int dest = 0;
1260+ int tag = k;
1261+ world->send(dest, tag, &this->electronicTransitionDipoleMoments[k][0][0], numTransported);
1262+ }
1263+ }
12141264
1265+ // right upper part of the matrix is copied from left lower part.
1266+ if(world->rank() == 0 && Parameters::GetInstance()->RequiresAllTransitionDipoleMomentsCIS()){
12151267 for(int k=0; k<Parameters::GetInstance()->GetNumberExcitedStatesCIS()+1; k++){
12161268 for(int l=k+1; l<Parameters::GetInstance()->GetNumberExcitedStatesCIS()+1; l++){
12171269 for(int axis=0; axis<CartesianType_end; axis++){
@@ -1221,8 +1273,13 @@ void ZindoS::CalcCISProperties(){
12211273 }
12221274 }
12231275 }
1224- MallocerFreer::GetInstance()->Free<double>(&dipoleMOs, CartesianType_end, totalNumberAOs, totalNumberAOs);
1225- MallocerFreer::GetInstance()->Free<double>(&overlapMOs, totalNumberAOs, totalNumberAOs);
1276+
1277+ // broadcast all matrix data to all ranks
1278+ numTransported *= (Parameters::GetInstance()->GetNumberExcitedStatesCIS()+1);
1279+ int source=0;
1280+ broadcast(*world, &this->electronicTransitionDipoleMoments[0][0][0], numTransported, source);
1281+
1282+
12261283 }// end of "calculate dipole moments and transitiondipolemoment"
12271284
12281285
@@ -2355,6 +2412,10 @@ void ZindoS::CalcCISMatrix(double** matrixCIS) const{
23552412 }
23562413 }
23572414
2415+ // broadcast all matrix data to all rank
2416+ int source=0;
2417+ broadcast(*world, &matrixCIS[0][0], this->matrixCISdimension*this->matrixCISdimension, source);
2418+
23582419 double ompEndTime = omp_get_wtime();
23592420 this->OutputLog(boost::format("%s%lf%s\n%s") % this->messageOmpElapsedTimeCalcCISMarix.c_str()
23602421 % (ompEndTime - ompStartTime)