Skip to content

Commit 4063a46

Browse files
committed
update the roxygen, better memory control
1 parent af28593 commit 4063a46

5 files changed

Lines changed: 45 additions & 10 deletions

File tree

R/evaluation.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,21 @@
7171
#'
7272
#' # bootstrap variants (parallel via future/future.apply; can be slow)
7373
#'
74-
#' # optional: temporarily increase the maximum size of exported globals
74+
#' # Optional: if parallel bootstrap exports a large object, temporarily
75+
#' # increase the maximum size of exported globals.
7576
#' old_max <- getOption("PSTR.future.globals.maxSize")
76-
#' options(PSTR.future.globals.maxSize = 4 * 1024^3) # 4 GB
77-
#' on.exit(options(PSTR.future.globals.maxSize = old_max), add = TRUE)
77+
#' options(PSTR.future.globals.maxSize = 4 * 1024^3) # 4 GB, if needed
7878
#'
7979
#' pstr <- WCB_TVTest(use = pstr, iB = 4, parallel = TRUE, cpus = 2)
8080
#' pstr <- WCB_HETest(
8181
#' use = pstr,
8282
#' vq = as.matrix(Hansen99[, "vala"])[, 1],
8383
#' iB = 4, parallel = TRUE, cpus = 2
8484
#' )
85+
#'
86+
#' # Reset to the previous option value.
87+
#' options(PSTR.future.globals.maxSize = old_max)
88+
#'
8589
#' print(pstr, mode = "evaluation")
8690
#' }
8791
#'

R/specification.R

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,19 @@ sLMTEST <- function(iT, iN, vU, mX, mW, mM, s2, mX2, invXX)
181181
#' print(pstr, mode = "tests")
182182
#'
183183
#' \donttest{
184-
#' # Bootstrap tests (can be slow)
184+
#' # Bootstrap tests (can be slow).
185+
#' # For parallel execution, the exported object may exceed the default
186+
#' # size limit. If that happens, temporarily increase the limit below.
187+
#' old_max <- getOption("PSTR.future.globals.maxSize")
188+
#' options(PSTR.future.globals.maxSize = 4 * 1024^3) # 4 GB, if needed
189+
#'
185190
#' pstr$WCB_LinTest(iB = 200, parallel = TRUE, cpus = 2)
186191
#' # or
187192
#' pstr <- WCB_LinTest(use = pstr, iB = 200, parallel = TRUE, cpus = 2)
188193
#'
194+
#' # Reset to the previous option value.
195+
#' options(PSTR.future.globals.maxSize = old_max)
196+
#'
189197
#' print(pstr, mode = "tests")
190198
#' }
191199
#'

dev/smoke-test.R

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,19 @@ print(pstr0, mode="estimates")
5050

5151
#######
5252

53-
pstr = NewPSTR(Hansen99, dep = 'inva', indep = c(4:16, 17:20), indep_k = c('vala'),
54-
tvars = c('vala'), im = 1, iT = 14)
53+
pstr = NewPSTR( Hansen99, dep = 'inva',
54+
indep = c('dt_75', 'dt_76', 'dt_80', 'dt_83', 'dt_84', 'dt_85', 'dt_86',
55+
'vala', 'debta', 'cfa', 'sales'),
56+
indep_k = c('vala', 'debta', 'cfa', 'sales'),
57+
tvars = c('vala'),
58+
im = 1, iT = 14)
59+
pstr
60+
5561

5662
LinTest(pstr)
5763
print(pstr, mode="tests")
64+
65+
old_max <- getOption("PSTR.future.globals.maxSize")
66+
options(PSTR.future.globals.maxSize = 4 * 1024^3)
67+
pstr$WCB_LinTest(iB = 20, parallel = TRUE, cpus = 6)
68+
options(PSTR.future.globals.maxSize = old_max)

man/EvalTest.Rd

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/LinTest.Rd

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)