MPI-SCATCI  2.0
An MPI version of SCATCI
Contracted_Symbolic_Module.f90
Go to the documentation of this file.
1 ! Copyright 2019
2 !
3 ! For a comprehensive list of the developers that contributed to these codes
4 ! see the UK-AMOR website.
5 !
6 ! This file is part of UKRmol-in (UKRmol+ suite).
7 !
8 ! UKRmol-in is free software: you can redistribute it and/or modify
9 ! it under the terms of the GNU General Public License as published by
10 ! the Free Software Foundation, either version 3 of the License, or
11 ! (at your option) any later version.
12 !
13 ! UKRmol-in is distributed in the hope that it will be useful,
14 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ! GNU General Public License for more details.
17 !
18 ! You should have received a copy of the GNU General Public License
19 ! along with UKRmol-in (in source/COPYING). Alternatively, you can also visit
20 ! <https://www.gnu.org/licenses/>.
21 
34 
35  use const_gbl, only: stdout
37  use containers, only: bstree
38  use integer_packing, only: pack8ints, unpack8ints
39  use iso_c_binding, only: c_loc, c_ptr, c_f_pointer
40  use mpi_gbl, only: myrank, mpiint, mpi_mod_allgather, mpi_mod_rotate_cfp_arrays_around_ring, &
41  mpi_mod_rotate_int_arrays_around_ring, mpi_xermsg, mpi_reduceall_max
42  use precisn, only: longint, wp
44  use parallelization_module, only: grid => process_grid
46  use timing_module, only: master_timer
47 
48  implicit none
49 
51 
52  private
53 
62  type, extends(bstree) :: contractedsymbolicelementvector
63  private
64 
65  integer(longint), allocatable :: electron_integral(:,:)
66  real(wp), allocatable :: coeffs(:,:,:)
67 
68  integer :: n = 0
69  logical :: constructed = .false.
70  real(wp) :: threshold = 0.0
71  integer :: num_states_1 = 0
72  integer :: num_states_2 = 0
73  integer :: max_capacity = 0
74  integer :: expand_size = 100
75  contains
76  ! type-bound procedures used by the bstree interface
77  procedure, public :: compare => bstree_compare
78 
79  ! own type-bound procedures
80  procedure, public :: construct
81  procedure, public :: insert_ijklm_symbol
82  procedure, public :: insert_symbol
83  procedure, public :: remove_symbol_at
84  procedure, public :: is_empty
85  procedure, public :: clear
86  procedure, public :: check_same_integral
87  procedure, public :: get_integral_label
88  procedure, public :: synchronize_symbols
89  procedure, public :: estimate_synchronize_cost
90  procedure, public :: modify_coeff
91  procedure, public :: get_coefficient
92  procedure, public :: get_coeff_and_integral
93  procedure, public :: get_size
94  procedure, public :: get_num_targets_sym1
95  procedure, public :: get_num_targets_sym2
96  procedure, public :: add_symbols
97  procedure, public :: reduce_symbols
98  procedure, public :: print => print_symbols
99  !procedure, public :: prune_threshold
100  !procedure, public :: sort_symbols
101  procedure, private :: expand_array
102  procedure, private :: check_bounds
103  procedure, public :: destroy
104  procedure, private :: check_constructed
105  procedure, private :: synchronize_symbols_ii
106  !procedure, public :: count_occurance
107  !procedure, public :: construct
109 
111 
112 contains
113 
132  integer function bstree_compare (this, i, j, data) result (verdict)
133 
134  class(contractedsymbolicelementvector), intent(in) :: this
135  integer, intent(in) :: i, j
136  type(c_ptr), optional, intent(in) :: data
137 
138  integer(longint) :: ii(2), jj(2)
139  integer(longint), pointer :: kk(:)
140 
141  ! get the default index set to compare with (if provided)
142  if (present(data)) call c_f_pointer(data, kk, (/ 2 /))
143 
144  ! obtain pointers to the index sets
145  if (i <= 0) then; ii = kk; else; ii = this % electron_integral(:,i); end if
146  if (j <= 0) then; jj = kk; else; jj = this % electron_integral(:,j); end if
147 
148  ! compare the index sets using lexicographical comparison
149  if (ii(1) < jj(1)) then
150  verdict = -1
151  else if (ii(1) > jj(1)) then
152  verdict = +1
153  else if (ii(2) < jj(2)) then
154  verdict = -1
155  else if (ii(2) > jj(2)) then
156  verdict = +1
157  else
158  verdict = 0
159  end if
160 
161  end function bstree_compare
162 
163 
168  subroutine check_constructed (this)
169  class(contractedsymbolicelementvector) :: this
170  if (.not. this % constructed) then
171  write (stdout, "('Vector::constructed - Vector is not constructed')")
172  stop "Vector::constructed - Vector is not constructed"
173  end if
174 
175  end subroutine check_constructed
176 
177 
188  subroutine construct (this, n1, n2, threshold, initial_size)
189  class(contractedsymbolicelementvector) :: this
190  real(wp), optional, intent(in) :: threshold
191  integer, optional, intent(in) :: initial_size
192 
193  integer :: err, n1, n2
194 
195  if (present(threshold)) then
196  this % threshold = threshold
197  else
198  this % threshold = default_integral_threshold
199  end if
200 
201  this % expand_size = 100
202  this % max_capacity = this % expand_size
203  this % num_states_1 = n1
204  this % num_states_2 = n2
205 
206  !Allocate the vectors
207  allocate(this % electron_integral(2, this % max_capacity), this % coeffs(n1, n2, this % max_capacity), stat = err)
208  call master_memory % track_memory (kind(this % electron_integral), &
209  size(this % electron_integral), err, 'CONSYMBOLIC::ELECTRONINT')
210  call master_memory % track_memory(kind(this % coeffs), &
211  size(this % coeffs), err, 'CONSYMBOLIC::ELECTRONCOEFF')
212  if (err /= 0) then
213  call mpi_xermsg('Contracted_Symbolic_module', 'construct', 'SymbolicVector arrays not allocated', 1, 1)
214  end if
215 
216  !Do an intial clear
217  call this % clear
218 
219  !This has been succesfully constructed
220  this % constructed = .true.
221 
222  end subroutine construct
223 
224 
235  logical function check_same_integral (this, integral, idx) result (found)
236 
237  class(contractedsymbolicelementvector), intent(in) :: this
238  integer(longint), target, intent(in) :: integral(2)
239  integer, intent(out) :: idx
240 
241  call this % check_constructed
242 
243  idx = this % locate(-1, c_loc(integral))
244  found = idx > 0
245 
246  end function check_same_integral
247 
248 
261  subroutine insert_ijklm_symbol (this, i, j, k, l, m, coeffs, check_same_)
262  class(contractedsymbolicelementvector) :: this
263  integer, intent(in) :: i, j, k, l, m
264  real(wp), intent(in) :: coeffs(this % num_states_1, this % num_states_2)
265  logical, intent(in), optional :: check_same_
266 
267  integer(longint) :: integral_label(2)
268  logical :: check_same
269 
270  if (present(check_same_)) then
271  check_same = check_same_
272  else
273  check_same = .true.
274  end if
275 
276  call pack8ints(i, j, k, l, m, 0, 0, 0, integral_label)
277  call this%insert_symbol(integral_label, coeffs, check_same)
278 
279  end subroutine insert_ijklm_symbol
280 
281 
295  subroutine insert_symbol (this, integral_label, coeffs, check_same_)
296  class(contractedsymbolicelementvector) :: this
297  integer(longint), intent(in) :: integral_label(2)
298  real(wp), intent(in) :: coeffs(this % num_states_1, this % num_states_2)
299  logical, intent(in), optional :: check_same_
300 
301  integer :: idx = 0, check_idx
302  logical :: check_same
303 
304  if (present(check_same_)) then
305  check_same = check_same_
306  else
307  check_same = .true.
308  end if
309 
310  ! Filter small coefficients
311  !if(abs(coeff) < this%threshold) return
312 
313  if (.not. this % check_same_integral(integral_label, idx)) then
314  !If not then update number of elements
315  this % n = this % n + 1
316  !The idx is the last element
317  idx = this % n
318  !If we've exceeded capacity then expand
319  if (this % n > this % max_capacity) then
320  call this % expand_array()
321  end if
322  !Place into the array
323  this % electron_integral(:,idx) = integral_label(:)
324  !Zero the coefficient since we can guareentee the compiler will do so
325  this % coeffs(:,:,idx) = 0.0_wp
326  !Insert it into the binary tree
327  call this % insert(idx)
328  end if
329 
330  !Now we have an index, lets add in the coeffcient
331  this % coeffs(:,:,idx) = this % coeffs(:,:,idx) + coeffs(:,:)
332 
333  end subroutine insert_symbol
334 
335 
343  subroutine expand_array (this)
344  class(contractedsymbolicelementvector) :: this
345  integer(longint), allocatable :: temp_integral(:,:)
346  real(wp), allocatable :: temp_coeffs(:,:,:)
347  integer :: temp_capacity, ido, err
348 
349  !write(stdout,"('Size of arrays = ',5i12)") this%max_capacity,this%num_states_1,this%num_states_2,size(this%electron_integral),size(this%coeffs)
350 
351  !Of course lets check if we are constructed
352  call this % check_constructed
353 
354  !Now the tempcapacity is the current max capacity
355  temp_capacity = this % max_capacity
356 
357  allocate(temp_integral(2, this % max_capacity), &
358  temp_coeffs(this % num_states_1, this % num_states_2, this % max_capacity), stat = err)
359  call master_memory % track_memory(kind(temp_integral), size(temp_integral), err, 'CONSYMBOLIC::EXP::TEMPINT')
360  call master_memory % track_memory(kind(temp_coeffs), size(temp_coeffs), err, 'CONSYMBOLIC::EXP::TEMPCOEFF')
361 
362  !Copy over the elements into the temporary array
363  do ido = 1, temp_capacity
364  temp_integral(1,ido) = this % electron_integral(1,ido)
365  temp_integral(2,ido) = this % electron_integral(2,ido)
366  temp_coeffs(:,:,ido) = this % coeffs(:,:,ido)
367  end do
368 
369  call master_memory % free_memory(kind(this % electron_integral), size(this % electron_integral))
370  call master_memory % free_memory(kind(this % coeffs), size(this % coeffs))
371 
372  !deallocate our old values
373  deallocate(this % electron_integral)
374  deallocate(this % coeffs)
375 
376  !Increase the max capacity
377  this % max_capacity = this % max_capacity + this % expand_size
378 
379  !Allocate our new array with the new max capacity
380  allocate(this % electron_integral(2, this % max_capacity), &
381  this % coeffs(this % num_states_1, this % num_states_2, this % max_capacity), stat = err)
382  call master_memory % track_memory (kind(this % electron_integral), &
383  size(this % electron_integral), err,'CONSYMBOLIC::EXP::ELECTRONINT_EXP')
384  call master_memory % track_memory(kind(this % coeffs), &
385  size(this % coeffs), err, 'CONSYMBOLIC::EXP::ELECTRONCOEFF_EXP')
386  !Zero the elements
387  this % electron_integral = -1
388  this % coeffs = 0.0_wp
389 
390  do ido = 1, temp_capacity
391  !Copy our old values back
392  this % electron_integral(1,ido) = temp_integral(1,ido)
393  this % electron_integral(2,ido) = temp_integral(2,ido)
394  this % coeffs(:,:,ido) = temp_coeffs(:,:,ido)
395  end do
396 
397  call master_memory % free_memory(kind(temp_integral), size(temp_integral))
398  call master_memory % free_memory(kind(temp_coeffs), size(temp_coeffs))
399 
400  deallocate(temp_integral, temp_coeffs)
401 
402  end subroutine expand_array
403 
404 
413  subroutine add_symbols (this, rhs, alpha)
414  class(contractedsymbolicelementvector) :: this
415  class(symbolicelementvector), intent(in) :: rhs
416  real(wp) :: alpha(this % num_states_1, this % num_states_2), int_coeff
417  integer :: ido
418  integer(longint) :: label(2)
419 
420  !Loop through each rhs symbolic and add it to me scaled by alpha
421  do ido = 1, rhs % get_size()
422  call rhs % get_coeff_and_integral(ido, int_coeff, label)
423  call this % insert_symbol(label, int_coeff * alpha)
424  end do
425 
426  end subroutine add_symbols
427 
428 
429  subroutine reduce_symbols (this, rhs)
430  class(contractedsymbolicelementvector) :: this
431  class(contractedsymbolicelementvector), intent(in) :: rhs
432  integer :: ido
433  integer(longint) :: label(2)
434 
435  !Loop through each rhs symbolic and add it to me scaled by alpha
436  do ido = 1, rhs % get_size()
437  call this % insert_symbol(rhs % electron_integral(:,ido), rhs % coeffs(:,:,ido))
438  end do
439 
440  end subroutine reduce_symbols
441 
442 
443  subroutine synchronize_symbols (this)
444  class(contractedsymbolicelementvector) :: this
445 
446  integer :: my_num_symbols, largest_num_symbols, ierr
447  integer :: ido, proc_id, jdo
448 
449  integer(longint), allocatable, target :: labels(:,:)
450  integer(longint), pointer :: label_ptr(:)
451  integer(longint) :: procs_num_of_symbols_int, procs_num_of_symbols_coeff, size_labels, size_coeffs
452 
453  real(wp), allocatable, target :: coeffs(:,:,:)
454  real(wp), pointer :: coeffs_ptr(:)
455 
456  if (grid % gprocs <= 1) then
457  return
458  end if
459 
460  call master_timer % start_timer("Symbol Synchronize")
461 
462  my_num_symbols = this % get_size()
463  call mpi_reduceall_max(my_num_symbols, largest_num_symbols, grid % lcomm)
464 
465  if (largest_num_symbols == 0) then
466  call master_timer % stop_timer("Symbol Synchronize")
467  return
468  end if
469 
470  call master_memory % track_memory (kind(labels), largest_num_symbols * 2, 0, 'CONSYMBOLIC::MPISYNCH::LABELS')
471  call master_memory % track_memory (kind(coeffs), largest_num_symbols * this % num_states_1 * this % num_states_2, &
472  0, 'CONSYMBOLIC::MPISYNCH::COEFFS')
473 
474  allocate(labels(2, largest_num_symbols), coeffs(this % num_states_1, this % num_states_2, largest_num_symbols), stat = ierr)
475 
476  size_labels = size(labels, kind = longint)
477  size_coeffs = size(coeffs, kind = longint)
478 
479  label_ptr(1:size_labels) => labels(:,:)
480  coeffs_ptr(1:size_coeffs) => coeffs(:,:,:)
481 
482  labels = 0
483  coeffs = 0
484 
485  if (my_num_symbols > 0) then
486  labels(1,1:my_num_symbols) = this % electron_integral(1,1:my_num_symbols)
487  labels(2,1:my_num_symbols) = this % electron_integral(2,1:my_num_symbols)
488  do ido = 1, my_num_symbols
489  coeffs(1:this%num_states_1,1:this%num_states_2,ido) = this % coeffs(1:this%num_states_1,1:this%num_states_2,ido)
490  end do
491  end if
492 
493  procs_num_of_symbols_int = my_num_symbols * 2
494  procs_num_of_symbols_coeff = my_num_symbols * this % num_states_1 * this % num_states_2
495  do proc_id = 1, grid % lprocs - 1
496  call mpi_mod_rotate_int_arrays_around_ring(procs_num_of_symbols_int, label_ptr, size_labels, grid % lcomm)
497  call mpi_mod_rotate_cfp_arrays_around_ring(procs_num_of_symbols_coeff, coeffs_ptr, size_coeffs, grid % lcomm)
498 
499  do ido = 1, procs_num_of_symbols_int / 2
500  call this % insert_symbol(labels(1:2,ido), coeffs(1:this%num_states_1,1:this%num_states_2,ido))
501  end do
502  end do
503 
504  call master_timer % stop_timer("Symbol Synchronize")
505  call master_memory % free_memory(kind(labels), size(labels))
506  call master_memory % free_memory(kind(coeffs), size(coeffs))
507 
508  deallocate(labels, coeffs)
509 
510  end subroutine synchronize_symbols
511 
512 
513  subroutine synchronize_symbols_ii (this)
514  class(contractedsymbolicelementvector), target :: this
515 
516  integer(longint), allocatable, target :: labels(:,:)
517  integer(longint), pointer :: label_ptr(:)
518 
519  real(wp), allocatable, target :: coeffs(:,:,:)
520  real(wp), pointer :: coeffs_ptr(:)
521 
522  integer :: my_num_symbols, largest_num_symbols, procs_num_of_symbols_int, procs_num_of_symbols_coeff, ido, proc_id, jdo
523  integer :: ierr, local_communicator, global_communicator, odd_even
524 
525  integer(kind=mpiint) :: master_comm, global_rank, global_nprocs, error, proc, tag = 1
526 
527  if (grid % gprocs <= 1) then
528  return
529  end if
530 
531  end subroutine synchronize_symbols_ii
532 
533 
541  logical function check_bounds (this, i)
542  class(contractedsymbolicelementvector) :: this
543  integer, intent(in) :: i
544 
545  if (i <= 0 .or. i > this % n) then
546  write (stdout, "('SymbolicVector::check_bounds - Out of Bounds access')")
547  stop "SymbolicVector::check_bounds - Out of Bounds access"
548  check_bounds = .false.
549  else
550  check_bounds = .true.
551  end if
552 
553  end function check_bounds
554 
555 
560  subroutine remove_symbol_at (this, idx)
561  class(contractedsymbolicelementvector) :: this
562  integer, intent(in) :: idx
563  integer :: ido
564 
565  if (this % check_bounds(idx)) then
566  do ido = idx + 1, this % n
567  this % electron_integral(1, ido - 1) = this % electron_integral(1, ido)
568  this % electron_integral(2, ido - 1) = this % electron_integral(2, ido)
569  !this%coeffs(ido-1) = this%coeffs(ido)
570  end do
571  this % electron_integral(:, this % n) = 0
572  !this % coeffs(this % n) = 0
573  this % n = this % n - 1
574  end if
575 
576  end subroutine remove_symbol_at
577 
578 
585  logical function is_empty (this)
586 
587  class(contractedsymbolicelementvector) :: this
588 
589  is_empty = (this % n == 0)
590 
591  end function is_empty
592 
593 
598  subroutine clear (this)
599 
600  class(contractedsymbolicelementvector) :: this
601 
602  this % n = 0
603  call this % bstree % destroy
604 
605  end subroutine clear
606 
607 
608  subroutine modify_coeff (this, idx, coeff)
609  class(contractedsymbolicelementvector) :: this
610  integer, intent(in) :: idx
611  real(wp) :: coeff
612  !this%coeffs(idx) = this%coeffs(idx)+ coeff
613  end subroutine modify_coeff
614 
615 
620  function get_integral_label (this, idx)
621  class(contractedsymbolicelementvector) :: this
622  integer, intent(in) :: idx
623  integer(longint), dimension(2) :: get_integral_label
624 
625  if (this % check_bounds(idx)) get_integral_label(:) = this % electron_integral(:,idx)
626 
627  end function get_integral_label
628 
629 
634  real(wp) function get_coefficient(this, idx, n1, n2)
635  class(contractedsymbolicelementvector) :: this
636  integer, intent(in) :: idx, n1, n2
637 
638  !if(this%check_bounds(idx)==.true.) get_coefficient=this%coeffs(idx)
639  get_coefficient = this % coeffs(n1, n2, idx)
640 
641  end function get_coefficient
642 
643 
648  subroutine get_coeff_and_integral (this, idx, coeff, label)
649  class(contractedsymbolicelementvector), intent(in) :: this
650  integer, intent(in) :: idx
651  real(wp), intent(out) :: coeff(this % num_states_1, this % num_states_2)
652  integer(longint), intent(out) :: label(2)
653 
654  if (this % check_bounds(idx)) then
655  label(1:2) = this % electron_integral(1:2,idx)
656  coeff(:,:) = this % coeffs(:,:,idx)
657  end if
658 
659  end subroutine get_coeff_and_integral
660 
661 
666  integer function get_size (this)
667  class(contractedsymbolicelementvector) :: this
668  get_size = this % n
669  end function get_size
670 
671 
672  integer function get_num_targets_sym1 (this)
673  class(contractedsymbolicelementvector) :: this
674  get_num_targets_sym1 = this % num_states_1
675  end function get_num_targets_sym1
676 
677 
678  integer function get_num_targets_sym2 (this)
679  class(contractedsymbolicelementvector) :: this
680  get_num_targets_sym2 = this % num_states_2
681  end function get_num_targets_sym2
682 
683 
688  subroutine destroy (this)
689  class(contractedsymbolicelementvector) :: this
690 
691  if (allocated(this % electron_integral)) then
692  call master_memory % free_memory(kind(this % electron_integral), size(this % electron_integral))
693  deallocate(this % electron_integral)
694  end if
695  if(allocated(this % coeffs)) then
696  call master_memory % free_memory(kind(this % coeffs), size(this % coeffs))
697  deallocate(this % coeffs)
698  end if
699 
700  call this % bstree % destroy
701 
702  this % constructed = .false.
703 
704  end subroutine destroy
705 
706 
711  subroutine print_symbols (this)
712  class(contractedsymbolicelementvector) :: this
713  integer :: labels(8), ido
714  real(wp) :: coeff
715 
716  if (.not. this % is_empty()) write (stdout, "('Outputting symbolic elements....')")
717 
718  do ido = 1, this % n
719  call unpack8ints(this % electron_integral(1,ido), labels)
720  write (1923 + myrank, "(5i4,' -- ',5es14.3)") labels(1:5), this % coeffs(:,:,ido)
721  end do
722 
723  end subroutine print_symbols
724 
725 
726  logical function estimate_synchronize_cost (this)
727  class(contractedsymbolicelementvector) :: this
728  integer(longint) :: memory_cost
729  integer :: my_num_symbols, largest_num_symbols
730  integer :: gathered_bool, global_bool(grid % gprocs)
731 
732  if (grid % gprocs <= 1) then
734  return
735  end if
736 
737  my_num_symbols = this % get_size()
738  gathered_bool = 0
740 
741  call mpi_reduceall_max(my_num_symbols, largest_num_symbols, grid % gcomm)
742 
743  memory_cost = 2 * largest_num_symbols * (2 + this % num_states_1 * this % num_states_2) * 8
744 
745  if (memory_cost >= master_memory % get_scaled_available_memory(0.75_wp)) gathered_bool = 1
746 
747  global_bool = 0
748 
749  call mpi_mod_allgather(gathered_bool, global_bool, grid % gcomm)
750 
751  if (sum(global_bool) /= 0) then
752  estimate_synchronize_cost = .false.
753  end if
754 
755  end function estimate_synchronize_cost
756 
contracted_symbolic_module::get_coeff_and_integral
subroutine get_coeff_and_integral(this, idx, coeff, label)
Get both label and coeffcient at specific index.
Definition: Contracted_Symbolic_Module.f90:649
contracted_symbolic_module::get_num_targets_sym1
integer function get_num_targets_sym1(this)
Definition: Contracted_Symbolic_Module.f90:673
contracted_symbolic_module::is_empty
logical function is_empty(this)
Simply returns whether we are storing integrals and coeffs or not.
Definition: Contracted_Symbolic_Module.f90:586
contracted_symbolic_module
Symbolic module.
Definition: Contracted_Symbolic_Module.f90:33
contracted_symbolic_module::estimate_synchronize_cost
logical function estimate_synchronize_cost(this)
Definition: Contracted_Symbolic_Module.f90:727
contracted_symbolic_module::construct
subroutine construct(this, n1, n2, threshold, initial_size)
Constructs the class by allocating space for the electron integrals.
Definition: Contracted_Symbolic_Module.f90:189
memorymanager_module
Memory manager module.
Definition: MemoryManager_module.f90:31
timing_module
Timing module.
Definition: Timing_Module.f90:28
contracted_symbolic_module::synchronize_symbols
subroutine synchronize_symbols(this)
Definition: Contracted_Symbolic_Module.f90:444
contracted_symbolic_module::clear
subroutine clear(this)
Clear our array (not really but it essentialy resets the symbol counter to zero which is way quicker)...
Definition: Contracted_Symbolic_Module.f90:599
contracted_symbolic_module::insert_ijklm_symbol
subroutine insert_ijklm_symbol(this, i, j, k, l, m, coeffs, check_same_)
Insert unpacked integral labels.
Definition: Contracted_Symbolic_Module.f90:262
contracted_symbolic_module::get_coefficient
real(wp) function get_coefficient(this, idx, n1, n2)
Get coefficient at specific index.
Definition: Contracted_Symbolic_Module.f90:635
contracted_symbolic_module::check_same_integral
logical function check_same_integral(this, integral, idx)
A function to check whether the same integral label exists.
Definition: Contracted_Symbolic_Module.f90:236
contracted_symbolic_module::print_symbols
subroutine print_symbols(this)
Print currently stored symbols.
Definition: Contracted_Symbolic_Module.f90:712
symbolic_module
Symbolic module.
Definition: Symbolic_Module.f90:33
parallelization_module::process_grid
type(processgrid) process_grid
Definition: Parallelization_module.F90:80
contracted_symbolic_module::check_constructed
subroutine check_constructed(this)
A simple class to check if this has been properly constructed.
Definition: Contracted_Symbolic_Module.f90:169
contracted_symbolic_module::to_be_synched
class(contractedsymbolicelementvector), pointer to_be_synched
Definition: Contracted_Symbolic_Module.f90:110
consts_mpi_ci
MPI SCATCI Constants module.
Definition: consts_mpi_ci.f90:31
contracted_symbolic_module::synchronize_symbols_ii
subroutine synchronize_symbols_ii(this)
Definition: Contracted_Symbolic_Module.f90:514
symbolic_module::symbolicelementvector
This class handles the storage symbolic elements.
Definition: Symbolic_Module.f90:57
contracted_symbolic_module::add_symbols
subroutine add_symbols(this, rhs, alpha)
Inserts one symbolic vector into another scaled by.
Definition: Contracted_Symbolic_Module.f90:414
contracted_symbolic_module::modify_coeff
subroutine modify_coeff(this, idx, coeff)
Definition: Contracted_Symbolic_Module.f90:609
parallelization_module
Distribution of processes into a grid.
Definition: Parallelization_module.F90:29
contracted_symbolic_module::expand_array
subroutine expand_array(this)
This is the array expansion subroutine.
Definition: Contracted_Symbolic_Module.f90:344
contracted_symbolic_module::check_bounds
logical function check_bounds(this, i)
Simply checks the index and wheter it exists within the array.
Definition: Contracted_Symbolic_Module.f90:542
consts_mpi_ci::default_integral_threshold
real(wp), parameter default_integral_threshold
Default threshold to store integrals.
Definition: consts_mpi_ci.f90:142
contracted_symbolic_module::remove_symbol_at
subroutine remove_symbol_at(this, idx)
Removes an integral and coefficient, never been used and pretty much useless.
Definition: Contracted_Symbolic_Module.f90:561
contracted_symbolic_module::get_num_targets_sym2
integer function get_num_targets_sym2(this)
Definition: Contracted_Symbolic_Module.f90:679
contracted_symbolic_module::get_size
integer function get_size(this)
Returns the number of symbolic elements stored.
Definition: Contracted_Symbolic_Module.f90:667
contracted_symbolic_module::insert_symbol
subroutine insert_symbol(this, integral_label, coeffs, check_same_)
Insert a packed integral symbol into the class.
Definition: Contracted_Symbolic_Module.f90:296
contracted_symbolic_module::destroy
subroutine destroy(this)
Cleans up the class by deallocating arrays.
Definition: Contracted_Symbolic_Module.f90:689
contracted_symbolic_module::contractedsymbolicelementvector
This class handles the storage symbolic elements.
Definition: Contracted_Symbolic_Module.f90:62
contracted_symbolic_module::bstree_compare
integer function bstree_compare(this, i, j, data)
Compare two integral index sets.
Definition: Contracted_Symbolic_Module.f90:133
contracted_symbolic_module::get_integral_label
integer(longint) function, dimension(2) get_integral_label(this, idx)
Get integral label at specific index.
Definition: Contracted_Symbolic_Module.f90:621
contracted_symbolic_module::reduce_symbols
subroutine reduce_symbols(this, rhs)
Definition: Contracted_Symbolic_Module.f90:430
timing_module::master_timer
type(timer), public master_timer
Definition: Timing_Module.f90:74
memorymanager_module::master_memory
type(memorymanager), public master_memory
This is the global memory manager.
Definition: MemoryManager_module.f90:69