Skip to content

DFTEFE‐TODO

Avirup Sircar edited this page Sep 18, 2024 · 43 revisions

Atoms

  1. No need to read, store m values (QNumber[2]) as, in a given l, m is fixed from -l to l with same f_nl(r). This will reduce some flops.

LinearAlgebra

  1. Add LinAlgOpContextContainer.h which contains std::map<MemorySpace, std::variant>.
  2. Modify the lapackpp device calls of BlasLapack.h. (Currently implemented via the lapckpp host calls.).
  3. BlasLapack.h assumes using LapackInt = int64_t for lapackpp function input parameters requiring pointers e.g. pivot array in LU decomposition (lapack::getri)
  4. Implement MultiPassCholesky with efficient way to calculate minimum eigenValue of overlap matrix.
  5. Extend the multivector constructor to generate random multivector using utils::RandNumGen
  6. Exception case is wrong (check other exceptions here)? this
  7. Implement Batched CHFSI implementation.

Utils

  1. Extend the RandNumGenerator to normal distribution and add memoryspace template. Write GPU kernel for rand num generator.

Basis

  1. Remove dealii exposure from BasisDataStorage derived classes. This will be done by having an evaluate function in DofHandler like evaluateFEValues(list of parameteric points, range of cell Ids, list of evaluate flags, list/map of MemoryStorage to store the values) In the above, list of evaluate flags can be enums or bools to determine what all quantities to evaluate (values, gradients, Hessian, Jacobian or its inverse etc).
  2. Forking of the getBasisFunctionGrad(cell range in std::pair, std::vector) and getBasisFunctionValue(cell range in std::pair, std::vector) in BasisDataStorage depending on how the basis data is stored (i.e. for grad data, classical dofs with cellwise inverseJacobian storage and enrichment dofs, direct evaluation of the enrichment function gradients)
  3. Compute MInv for enrichment ids using overlap of enrichment functions in atoms which are local to the processor. This is a more efficient (without MPI) and approximate MInv.
  4. Compute diagonal of <N_i|N_j> for hanging node constraint case more accurately. i.e. instead of adding the diagonal entries , take the <N_i_parent|N_j_child> entries also.
  5. Divide the AtomIdsPartition into:
    • AtomIdsPartition(std::vector<std::pair<(std::vector)atomCoords, (std::string)atomSymbols>>, std::unordered_map<(std::string)atomSymbol, (double)cutoffRadius>>) where based on the cutoffRadius one can store the locallyOwned and Ghost atomIds.
    • Then have AtomIdsRenumber(AtomIdsPartition) that does the renumbering of the atom ids with the currently implemented AtomIdsPartitioner. (Reminder: Renumbering of atom is important for numbering of enrichment ids because the MPIPatternP2P takes a contiguous set of locallyOwnedIds.)
    • This will optimize the adaptive quadrature where only some enrichment fns (with enrichment fn cutoff is used) will be evaluated based on atomcoordinates. This will also optimize in all functions in in electrostaticfe in ksdft (where smeared charge cutoff is used) and other classes where atomcoordinatesvec are taken as input.
  6. Implement R-tree algorithm for the EnrichmentIdsPartition and new AtomidsPartition for checking whether a spherically symmetric enrichment dof is inside a bounding box or not.
  7. Check for non periodic case that enrichment functions do not spill to boundary.
  8. Edit this after making changes in linalgopcontext before gpu compilation.
  9. Change maxCellTimesBlockVec to maxCellBlock in FEBasisOpertions.t.cpp input
  10. Change FeBasisOperations::ComputeFEMatrices to take L1Op1 f L2Op2 and L1 Op L2 cases generally.
  11. Modify EnrichmentIdsPartition if the domain has non-orthogonal domainVectors.
  12. Periodic implementation of basis: EnrichmentIdsPartition will change as enrichment fns can spill and come from other side of domain. (note: proper checks for periodic , non-periodic combined case of the bounding domain)
  13. In EFEBasisDataStorage and OverlapOperator , remove the if else in clasical and enrichment dof cell loops, and use for loops to vectorize the loops. this

Electrostatics

  1. Do the construction of the Laplacian and the Jacobi preconditioner only once i.e. implement the reinit. (As rho is input in every scf). For the PoissonProblem

Ksdft

  1. Add bisection method for getting initial guess of newton raphson solve
  2. Edit this after making changes in linalgopcontext before gpu compilation.
  3. KSDFT classes and the individual Hamiltonian should take in quadRuleContainer (not feBasisDataStorage) as inputs. The FEBD should be created within the functional. Have appropriate getter functions for post-processing and force calculations.
  4. Make waveFnInitialGuess and eigenVector as the same memory.
  5. Currently using KSDFTDefaults::MAX_KINENG_WAVEFN_BATCH_SIZE in defaults because KE evalustion blows up peak memory. Remove it.

General Optimizations/Concerns

  1. Check for ThrowException and replace with asserts.
  2. Enrichment function evaluations may be optimized by getting values for std::vector of points.
  3. Are we doing std::vector::push_back() properly at all places.
Clone this wiki locally