Skip to content

Commit c94c97a

Browse files
committed
Commented out the serial version of the overlap calculations
1 parent c4bf04c commit c94c97a

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

src/libint2_wrappers/libint2_wrappers.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ std::vector<size_t> map_shell_to_basis_function(const std::vector<libint2::Shell
166166

167167

168168

169-
169+
/*
170170
171171
// Computing the integrals between two shells serial
172172
MATRIX compute_1body_ints(const std::vector<libint2::Shell>& shells_1, const std::vector<libint2::Shell>& shells_2,libint2::Operator obtype)
@@ -206,31 +206,31 @@ MATRIX compute_1body_ints(const std::vector<libint2::Shell>& shells_1, const std
206206
207207
// loop over unique shell pairs, {s1,s2} such that s1 >= s2
208208
// this is due to the permutational symmetry of the real integrals over Hermitian operators: (1|2) = (2|1)
209-
std::cout << shells_1.size();
209+
//std::cout << shells_1.size();
210210
for(auto s1=0; s1!=shells_1.size(); ++s1) {
211211
212212
auto bf1 = shell2bf_1[s1]; // first basis function in this shell
213-
std::cout << "Flag bf1: " << bf1 << "\n";
213+
//std::cout << "Flag bf1: " << bf1 << "\n";
214214
auto n1 = shells_1[s1].size();
215215
216-
std::cout << "shells_1[s1]" << shells_1[s1].size() << "\n";
216+
//std::cout << "shells_1[s1]" << shells_1[s1].size() << "\n";
217217
218218
//for(auto s2=0; s2<=s1; ++s2) {
219219
for(auto s2=0; s2!=shells_2.size(); ++s2) {
220220
221221
auto bf2 = shell2bf_2[s2];
222-
std::cout << "Flag bf2: " << bf2 << "\n";
222+
//std::cout << "Flag bf2: " << bf2 << "\n";
223223
auto n2 = shells_2[s2].size();
224224
225-
std::cout << "shells_2[s2]" << shells_2[s2].size() << "\n";
225+
//std::cout << "shells_2[s2]" << shells_2[s2].size() << "\n";
226226
227227
// compute shell pair
228228
engine.compute(shells_1[s1], shells_2[s2]);
229229
//std::cout << "Flag after engine.compute" << "\n";
230230
// "map" buffer to a const Eigen Matrix, and copy it to the corresponding blocks of the result
231231
Eigen::Map<const Matrix> buf_mat(buf[0], n1, n2);
232-
std::cout << "Flag after buf_mat" << "\n" << "buf_mat.size: \n" << buf_mat.size() << "\n";
233-
std::cout << "Flag after buf_mat" << "\n" << "buf_mat \n" << buf_mat << "\n";
232+
//std::cout << "Flag after buf_mat" << "\n" << "buf_mat.size: \n" << buf_mat.size() << "\n";
233+
//std::cout << "Flag after buf_mat" << "\n" << "buf_mat \n" << buf_mat << "\n";
234234
//std::cout << "Flag after buf_mat" << "\n" << "bf1.size" << bf1.size() << "\n";
235235
//std::cout << "Flag after buf_mat" << "\n" << "bf2.size" << bf2.size() << "\n";
236236
result.block(bf1, bf2, n1, n2) = buf_mat;
@@ -240,7 +240,7 @@ MATRIX compute_1body_ints(const std::vector<libint2::Shell>& shells_1, const std
240240
//std::cout << "Flag after buf_mat.transpose" << "\n";
241241
}
242242
}
243-
std::cout << "Flag before MATRIX res" << "\n";
243+
//std::cout << "Flag before MATRIX res" << "\n";
244244
MATRIX res(n_1, n_2);
245245
for(int i=0;i<n_1;i++){
246246
for(int j=0; j<n_2;j++){
@@ -252,7 +252,7 @@ MATRIX compute_1body_ints(const std::vector<libint2::Shell>& shells_1, const std
252252
return res;
253253
}
254254
255-
255+
*/
256256

257257

258258
// Computing the integrals between two shells in parallel using OpenMP (This is also adopted from libint test files with some modifications)
@@ -305,11 +305,12 @@ libint2::Operator obtype, int nthreads){
305305
const auto& buf = engines[thread_id].results();
306306

307307
for (auto s1 = 0l, s12 = 0l; s1 != shells_1.size(); ++s1) {
308+
// for (auto s1 = 0; s1 < shells_1.size(); ++s1) {
308309
auto bf1 = shell2bf1[s1]; // first basis function in this shell
309310
auto n1 = shells_1[s1].size();
310311
//std::cout << "shells_1[" << s1 << "]" << shells_1[s1].size() << "\n";
311312
auto s1_offset = s1 * (s1+1) / 2;
312-
//for (auto s2=0; s2<=s1; ++s2) {
313+
//for (auto s2 = 0; s2 < shells_2.size(); ++s2) {
313314
for (auto s2=0; s2!= shells_2.size(); ++s2) {
314315
//std::cout << "shells_2[" << s2 << "]" << shells_2[s2].size() << "\n";
315316
auto s12 = s1_offset + s2;
@@ -376,25 +377,26 @@ MATRIX compute_overlaps(const std::vector<libint2::Shell>& shells_1, const std::
376377
libint2::initialize();
377378
// Compute the AO overlap matrix
378379
auto S = compute_1body_ints_parallel(shells_1, shells_2, Operator::overlap, nthreads);
379-
std::cout << "\n\tFinished computing overlap integral\n";
380+
//std::cout << "\n\tFinished computing overlap integral\n";
380381
// End of AO matrix calculation
381382
libint2::finalize(); // done with libint
382383

383384
return S;
384385
}
385386

386387

387-
388+
/*
388389
MATRIX compute_overlaps_serial(const std::vector<libint2::Shell>& shells_1, const std::vector<libint2::Shell>& shells_2) {
389390
// Initialize Libint
390391
libint2::initialize();
391392
// Compute the AO overlap matrix
392393
auto S = compute_1body_ints(shells_1, shells_2, Operator::overlap);
393-
std::cout << "\n\tFinished computing overlap integral\n";
394+
//std::cout << "\n\tFinished computing overlap integral\n";
394395
libint2::finalize(); // done with libint
395396
return S;
396397
}
397398
399+
*/
398400

399401

400402
}// namespace liblibint2_wrappers

src/libint2_wrappers/libint2_wrappers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ std::vector<size_t> map_shell_to_basis_function(const std::vector<libint2::Shell
116116
using real_t = libint2::scalar_type;
117117
typedef Eigen::Matrix<real_t, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> Matrix;
118118

119-
MATRIX compute_1body_ints(const std::vector<libint2::Shell>& shells_1, const std::vector<libint2::Shell>& shells_2,libint2::Operator obtype);
119+
//MATRIX compute_1body_ints(const std::vector<libint2::Shell>& shells_1, const std::vector<libint2::Shell>& shells_2,libint2::Operator obtype);
120120
MATRIX compute_1body_ints_parallel(const std::vector<libint2::Shell>& shells_1, const std::vector<libint2::Shell>& shells_2,libint2::Operator obtype);
121121
MATRIX compute_overlaps(const std::vector<libint2::Shell>& shells_1, const std::vector<libint2::Shell>& shells_2, int number_of_threads);
122-
MATRIX compute_overlaps_serial(const std::vector<libint2::Shell>& shells_1, const std::vector<libint2::Shell>& shells_2);
122+
//MATRIX compute_overlaps_serial(const std::vector<libint2::Shell>& shells_1, const std::vector<libint2::Shell>& shells_2);
123123

124124

125125

src/libint2_wrappers/liblibint2_wrappers.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,11 @@ void export_libint2_wrappers_objects(){
104104

105105
def("compute_overlaps", expt_compute_overlaps_v1);
106106

107+
/*
107108
MATRIX (*expt_compute_overlaps_serial_v1)
108109
(const std::vector<libint2::Shell>& shells_1, const std::vector<libint2::Shell>& shells_2) = &compute_overlaps_serial;
109110
def("compute_overlaps_serial", expt_compute_overlaps_serial_v1);
110-
111+
*/
111112

112113

113114
/**

0 commit comments

Comments
 (0)