Skip to content

Commit

Permalink
Replace PAGE_SIZE by SSIDS_PAGE_SIZE
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison authored and jfowkes committed Feb 2, 2024
1 parent c1dfe13 commit 2efb3e6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/ssids/cpu/AppendAlloc.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ private:
* Deallocation is not supported.
*/
class Pool {
const size_t PAGE_SIZE = 0; // 0MB
const size_t SSIDS_PAGE_SIZE = 0; // 0MB
// Changed to 0MB to allow pages of no minimum size for performance
// see https://github.com/ralna/spral/issues/119 for more details
public:
Pool(size_t initial_size)
: top_page_(new Page(std::max(PAGE_SIZE, initial_size)))
: top_page_(new Page(std::max(SSIDS_PAGE_SIZE, initial_size)))
{}
Pool(const Pool&) =delete; // Not copyable
Pool& operator=(const Pool&) =delete; // Not copyable
Expand All @@ -88,7 +88,7 @@ public:
{
ptr = top_page_->allocate(sz);
if(!ptr) { // Insufficient space on current top page, make a new one
top_page_ = new Page(std::max(PAGE_SIZE, sz), top_page_);
top_page_ = new Page(std::max(SSIDS_PAGE_SIZE, sz), top_page_);
ptr = top_page_->allocate(sz);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/ssids/cpu/NumericSubtree.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ using namespace spral::ssids::cpu;
namespace {

typedef double T;
const int PAGE_SIZE = 8*1024*1024; // 8MB
typedef NumericSubtree<true, T, PAGE_SIZE, AppendAlloc<T>> NumericSubtreePosdef;
typedef NumericSubtree<false, T, PAGE_SIZE, AppendAlloc<T>> NumericSubtreeIndef;
const int SSIDS_PAGE_SIZE = 8*1024*1024; // 8MB
typedef NumericSubtree<true, T, SSIDS_PAGE_SIZE, AppendAlloc<T>> NumericSubtreePosdef;
typedef NumericSubtree<false, T, SSIDS_PAGE_SIZE, AppendAlloc<T>> NumericSubtreeIndef;

} /* end of anon namespace */
//////////////////////////////////////////////////////////////////////////
Expand Down
6 changes: 3 additions & 3 deletions src/ssids/cpu/NumericSubtree.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ namespace spral { namespace ssids { namespace cpu {
*
* \tparam posdef true for Cholesky factorization, false for indefinite LDL^T
* \tparam T underlying numerical type e.g. double
* \tparam PAGE_SIZE initial size to be used for thread Workspace
* \tparam SSIDS_PAGE_SIZE initial size to be used for thread Workspace
* \tparam FactorAllocator allocator to be used for factor storage. It must
* zero memory upon allocation (eg through calloc or memset).
* */
template <bool posdef, //< true for Cholesky factoriztion, false for indefinte
typename T,
size_t PAGE_SIZE,
size_t SSIDS_PAGE_SIZE,
typename FactorAllocator
>
class NumericSubtree {
Expand Down Expand Up @@ -78,7 +78,7 @@ public:
std::vector<Workspace> work;
work.reserve(num_threads);
for(int i=0; i<num_threads; ++i)
work.emplace_back(PAGE_SIZE);
work.emplace_back(SSIDS_PAGE_SIZE);

// initialise stats already so we can safely early-return in case of
// failure if not compiled with OpenMP (instead of omp cancel)
Expand Down
2 changes: 1 addition & 1 deletion src/ssids/cpu/SymbolicSubtree.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private:
std::vector<SymbolicNode> nodes_;
std::vector<SmallLeafSymbolicSubtree> small_leafs_;

template <bool posdef, typename T, size_t PAGE_SIZE, typename FactorAlloc>
template <bool posdef, typename T, size_t SSIDS_PAGE_SIZE, typename FactorAlloc>
friend class NumericSubtree;
};

Expand Down
4 changes: 2 additions & 2 deletions tests/ssids/kernels/ldlt_app.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ int ldlt_test(T u, T small, bool delays, bool singular, bool dblk_singular, int
// First m x n matrix
CopyBackup<T> backup(m, n, outer_block_size);
std::vector<Workspace> work;
const int PAGE_SIZE = 8*1024*1024; // 8 MB
const int SSIDS_PAGE_SIZE = 8*1024*1024; // 8 MB
for(int i=0; i<omp_get_num_threads(); ++i)
work.emplace_back(PAGE_SIZE);
work.emplace_back(SSIDS_PAGE_SIZE);
int const use_tasks = true;
int q1 = LDLT
<T, INNER_BLOCK_SIZE, CopyBackup<T>, use_tasks, debug>
Expand Down

0 comments on commit 2efb3e6

Please sign in to comment.