Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/MGmol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ int MGmol<OrbitalsType>::initial()
ct.numst, ct.bcWF, proj_matrices_.get(), lrs_, currentMasks_.get(),
corrMasks_.get(), local_cluster_.get(), true);

increaseMemorySlotsForOrbitals<MemorySpaceType>();
increaseMemorySlotsForOrbitals<ORBDTYPE, MemorySpaceType>();

Potentials& pot = hamiltonian_->potential();
pb::Lap<ORBDTYPE>* lapOper = hamiltonian_->lapOper();
Expand Down
24 changes: 12 additions & 12 deletions src/manage_memory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// Increase memory slots in BlockVector as needed based on runtime
// options
template <typename MemorySpaceType>
template <typename DataType, typename MemorySpaceType>
void increaseMemorySlotsForOrbitals()
{
Control& ct = *(Control::instance());
Expand All @@ -22,18 +22,18 @@ void increaseMemorySlotsForOrbitals()
case OuterSolverType::ABPG:
{
// r_k-1, phi_k-1
BlockVector<ORBDTYPE, MemorySpaceType>::incMaxAllocInstances(2);
BlockVector<DataType, MemorySpaceType>::incMaxAllocInstances(2);
break;
}
case OuterSolverType::PolakRibiere:
{
// r_k-1, z_k, z_k-1, p_k
BlockVector<ORBDTYPE, MemorySpaceType>::incMaxAllocInstances(4);
BlockVector<DataType, MemorySpaceType>::incMaxAllocInstances(4);
break;
}
case OuterSolverType::Davidson:
{
BlockVector<ORBDTYPE, MemorySpaceType>::incMaxAllocInstances(2);
BlockVector<DataType, MemorySpaceType>::incMaxAllocInstances(2);
break;
}
default:
Expand All @@ -44,39 +44,39 @@ void increaseMemorySlotsForOrbitals()
{
case WFExtrapolationType::Reversible:
{
BlockVector<ORBDTYPE, MemorySpaceType>::incMaxAllocInstances(2);
BlockVector<DataType, MemorySpaceType>::incMaxAllocInstances(2);
break;
}
case WFExtrapolationType::Order2:
{
BlockVector<ORBDTYPE, MemorySpaceType>::incMaxAllocInstances(1);
BlockVector<DataType, MemorySpaceType>::incMaxAllocInstances(1);
break;
}
case WFExtrapolationType::Order3:
{
BlockVector<ORBDTYPE, MemorySpaceType>::incMaxAllocInstances(2);
BlockVector<DataType, MemorySpaceType>::incMaxAllocInstances(2);
break;
}
default:
break;
}

for (short i = 1; i < ct.wf_m; i++)
BlockVector<ORBDTYPE, MemorySpaceType>::incMaxAllocInstances(2);
BlockVector<DataType, MemorySpaceType>::incMaxAllocInstances(2);
if (ct.use_kernel_functions)
BlockVector<ORBDTYPE, MemorySpaceType>::incMaxAllocInstances(1);
BlockVector<DataType, MemorySpaceType>::incMaxAllocInstances(1);

switch (ct.AtomsDynamic())
{
case AtomsDynamicType::LBFGS:
BlockVector<ORBDTYPE, MemorySpaceType>::incMaxAllocInstances(1);
BlockVector<DataType, MemorySpaceType>::incMaxAllocInstances(1);
break;
default:
break;
}
}

template void increaseMemorySlotsForOrbitals<MemorySpace::Host>();
template void increaseMemorySlotsForOrbitals<ORBDTYPE, MemorySpace::Host>();
#ifdef HAVE_MAGMA
template void increaseMemorySlotsForOrbitals<MemorySpace::Device>();
template void increaseMemorySlotsForOrbitals<ORBDTYPE, MemorySpace::Device>();
#endif
2 changes: 1 addition & 1 deletion src/manage_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// All rights reserved.
// This file is part of MGmol. For details, see https://github.com/llnl/mgmol.
// Please also read this link https://github.com/llnl/mgmol/LICENSE
template <typename MemorySpaceType>
template <typename DataType, typename MemorySpaceType>
void increaseMemorySlotsForOrbitals();