Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace PAGE_SIZE by SSIDS_PAGE_SIZE #189

Merged
merged 1 commit into from
Feb 2, 2024
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
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
Loading