Skip to content

Commit

Permalink
remove useless warning in roll and expand forecast
Browse files Browse the repository at this point in the history
  • Loading branch information
ygeunkim committed Oct 7, 2024
1 parent 2eb2f57 commit 1ba477a
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions R/summary-forecast.R
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,8 @@ forecast_roll.ldltmod <- function(object, n_ahead, y_test, num_thread = 1, spars
# if (num_thread > num_chains && num_chains != 1) {
# warning(sprintf("'num_thread' > MCMC chain will use not every thread. Specify as 'num_thread' <= 'object$chain' = %d.", num_chains))
# }
if (num_horizon * num_chains %/% num_thread == 0) {
warning(sprintf("OpenMP cannot divide the iterations as integer. Use divisor of ('nrow(y_test) - n_ahead + 1') * 'num_thread' <= 'object$chain' = %d", num_horizon * num_chains))
}
# chunk_size <- num_horizon * num_chains %/% num_thread # default setting of OpenMP schedule(static)
# if (chunk_size == 0) {
# chunk_size <- 1
# if (num_horizon * num_chains %% num_thread != 0) {
# warning(sprintf("OpenMP cannot divide the iterations as integer. Use divisor of ('nrow(y_test) - n_ahead + 1') * 'num_thread' = %d", num_horizon * num_chains, num_chains))
# }
ci_lev <- 0
if (is.numeric(sparse)) {
Expand Down Expand Up @@ -464,9 +460,9 @@ forecast_roll.svmod <- function(object, n_ahead, y_test, num_thread = 1, use_sv
# if (num_thread > num_chains && num_chains != 1) {
# warning(sprintf("'num_thread' > MCMC chain will use not every thread. Specify as 'num_thread' <= 'object$chain' = %d.", num_chains))
# }
if (num_horizon * num_chains %/% num_thread == 0) {
warning(sprintf("OpenMP cannot divide the iterations as integer. Use divisor of ('nrow(y_test) - n_ahead + 1') * 'num_thread' <= 'object$chain' = %d", num_horizon * num_chains))
}
# if (num_horizon * num_chains %/% num_thread == 0) {
# warning(sprintf("OpenMP cannot divide the iterations as integer. Use divisor of ('nrow(y_test) - n_ahead + 1') * 'num_thread' <= 'object$chain' = %d", num_horizon * num_chains))
# }
# chunk_size <- num_horizon * num_chains %/% num_thread # default setting of OpenMP schedule(static)
# if (chunk_size == 0) {
# chunk_size <- 1
Expand Down Expand Up @@ -834,9 +830,9 @@ forecast_expand.ldltmod <- function(object, n_ahead, y_test, num_thread = 1, spa
# if (num_thread > num_chains && num_chains != 1) {
# warning(sprintf("'num_thread' > MCMC chain will use not every thread. Specify as 'num_thread' <= 'object$chain' = %d.", num_chains))
# }
if (num_horizon * num_chains %/% num_thread == 0) {
warning(sprintf("OpenMP cannot divide the iterations as integer. Use divisor of ('nrow(y_test) - n_ahead + 1') * 'num_thread' <= 'object$chain' = %d", num_horizon * num_chains))
}
# if (num_horizon * num_chains %/% num_thread == 0) {
# warning(sprintf("OpenMP cannot divide the iterations as integer. Use divisor of ('nrow(y_test) - n_ahead + 1') * 'num_thread' <= 'object$chain' = %d", num_horizon * num_chains))
# }
# # chunk_size <- num_horizon * num_chains %/% num_thread # default setting of OpenMP schedule(static)
# chunk_size <- num_chains # use inner loop for chain as a chunk in dynamic schedule
# if (chunk_size == 0) {
Expand Down Expand Up @@ -1053,9 +1049,9 @@ forecast_expand.svmod <- function(object, n_ahead, y_test, num_thread = 1, use_s
# if (num_thread > num_chains && num_chains != 1) {
# warning(sprintf("'num_thread' > MCMC chain will use not every thread. Specify as 'num_thread' <= 'object$chain' = %d.", num_chains))
# }
if (num_horizon * num_chains %/% num_thread == 0) {
warning(sprintf("OpenMP cannot divide the iterations as integer. Use divisor of ('nrow(y_test) - n_ahead + 1') * 'num_thread' <= 'object$chain' = %d", num_horizon * num_chains))
}
# if (num_horizon * num_chains %/% num_thread == 0) {
# warning(sprintf("OpenMP cannot divide the iterations as integer. Use divisor of ('nrow(y_test) - n_ahead + 1') * 'num_thread' <= 'object$chain' = %d", num_horizon * num_chains))
# }
# # chunk_size <- num_horizon * num_chains %/% num_thread # default setting of OpenMP schedule(static)
# chunk_size <- num_chains # use inner loop for chain as a chunk in dynamic schedule
# if (chunk_size == 0) {
Expand Down

0 comments on commit 1ba477a

Please sign in to comment.