Skip to content

Commit d7c0d6a

Browse files
Make NXTVAL + B/S configuration cutoff in PT2 configurable
1 parent 8d6fd71 commit d7c0d6a

3 files changed

Lines changed: 21 additions & 9 deletions

File tree

include/macis/asci/determinant_search.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ struct ASCISettings {
4444
size_t pt2_reserve_count = 70000000;
4545
bool pt2_prune = false;
4646
bool pt2_precompute_eps = false;
47+
size_t pt2_bigcon_thresh = 250;
48+
49+
size_t nxtval_bcount_thresh = 1000;
50+
size_t nxtval_bcount_inc = 10;
4751

4852
bool just_singles = false;
4953
size_t grow_factor = 8;
@@ -298,7 +302,7 @@ asci_contrib_container<wfn_t<N>> asci_contributions_constraint(
298302

299303
// Atomically get the next task ID and increment for other
300304
// MPI ranks and threads
301-
size_t ntake = ic < 1000 ? 1 : 10;
305+
size_t ntake = ic < asci_settings.nxtval_bcount_thresh ? 1 : asci_settings.nxtval_bcount_inc;
302306
ic = nxtval.fetch_and_add(ntake);
303307

304308
// Loop over assigned tasks

include/macis/asci/pt2.hpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,17 @@ double asci_pt2_constraint(ASCISettings asci_settings,
4343

4444
const size_t ncdets = std::distance(cdets_begin, cdets_end);
4545
logger->info("[ASCI PT2 Settings]");
46-
logger->info(" * NDETS = {}", ncdets);
47-
logger->info(" * PT2_TOL = {}", asci_settings.pt2_tol);
48-
logger->info(" * PT2_RESERVE_COUNT = {}", asci_settings.pt2_reserve_count);
49-
logger->info(" * PT2_CONSTRAINT_LVL = {}", asci_settings.pt2_constraint_level);
50-
logger->info(" * PT2_PRUNE = {}", asci_settings.pt2_prune);
51-
logger->info(" * PT2_PRECMP_EPS = {}", asci_settings.pt2_precompute_eps);
46+
logger->info(" * NDETS = {}", ncdets);
47+
logger->info(" * PT2_TOL = {}", asci_settings.pt2_tol);
48+
logger->info(" * PT2_RESERVE_COUNT = {}", asci_settings.pt2_reserve_count);
49+
logger->info(" * PT2_CONSTRAINT_LVL = {}", asci_settings.pt2_constraint_level);
50+
logger->info(" * PT2_PRUNE = {}", asci_settings.pt2_prune);
51+
logger->info(" * PT2_PRECOMP_EPS = {}", asci_settings.pt2_precompute_eps);
52+
logger->info(" * PT2_BIGCON_THRESH = {}", asci_settings.pt2_bigcon_thresh);
53+
logger->info(" * NXTVAL_BCOUNT_THRESH = {}",
54+
asci_settings.nxtval_bcount_thresh);
55+
logger->info(" * NXTVAL_BCOUNT_INC = {}",
56+
asci_settings.nxtval_bcount_inc);
5257
logger->info("");
5358

5459
// For each unique alpha, create a list of beta string and store metadata
@@ -176,7 +181,7 @@ double asci_pt2_constraint(ASCISettings asci_settings,
176181
size_t NPT2 = 0;
177182

178183
const size_t ncon_total = constraints.size();
179-
const size_t ncon_big = 250;
184+
const size_t ncon_big = asci_settings.pt2_bigcon_thresh;
180185
const size_t ncon_small = ncon_total - ncon_big;
181186

182187
// Global atomic task-id counter
@@ -333,7 +338,7 @@ double asci_pt2_constraint(ASCISettings asci_settings,
333338
while(ic < ncon_total) {
334339
// Atomically get the next task ID and increment for other
335340
// MPI ranks and threads
336-
size_t ntake = ic < 1000 ? 1 : 10;
341+
size_t ntake = ic < asci_settings.nxtval_bcount_thresh ? 1 : asci_settings.nxtval_bcount_inc;
337342
ic = nxtval_small.fetch_and_add(ntake);
338343

339344
// Loop over assigned tasks

tests/standalone_driver.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ int main(int argc, char** argv) {
225225
OPT_KEYWORD("ASCI.PT2_CONSTRAINT_LVL", asci_settings.pt2_constraint_level, int);
226226
OPT_KEYWORD("ASCI.PT2_PRUNE", asci_settings.pt2_prune, bool);
227227
OPT_KEYWORD("ASCI.PT2_PRECOMPUTE_EPS", asci_settings.pt2_precompute_eps, bool);
228+
OPT_KEYWORD("ASCI.PT2_BIGCON_THRESH", asci_settings.pt2_bigcon_thresh, size_t);
229+
OPT_KEYWORD("ASCI.NXTVAL_BCOUNT_THRESH", asci_settings.nxtval_bcount_thresh, size_t);
230+
OPT_KEYWORD("ASCI.NXTVAL_BCOUNT_INC", asci_settings.nxtval_bcount_inc, size_t);
228231

229232
bool mp2_guess = false;
230233
OPT_KEYWORD("MCSCF.MP2_GUESS", mp2_guess, bool);

0 commit comments

Comments
 (0)