The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
Last updated on 2026-08-03 23:50:55 CEST.
| Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
|---|---|---|---|---|---|---|
| r-devel-linux-x86_64-debian-clang | 2.12.120 | 3.77 | 104.65 | 108.42 | OK | |
| r-devel-linux-x86_64-debian-gcc | 2.12.120 | 3.33 | 69.25 | 72.58 | NOTE | |
| r-devel-linux-x86_64-fedora-clang | 2.12.120 | 175.82 | OK | |||
| r-devel-linux-x86_64-fedora-gcc | 2.12.120 | 74.45 | OK | |||
| r-devel-windows-x86_64 | 2.12.120 | 6.00 | 124.00 | 130.00 | OK | |
| r-patched-linux-x86_64 | 2.12.120 | 7.24 | 102.93 | 110.17 | OK | |
| r-release-linux-x86_64 | 2.12.120 | 4.05 | 103.50 | 107.55 | OK | |
| r-release-macos-arm64 | 2.12.120 | 1.00 | 65.00 | 66.00 | ERROR | |
| r-release-macos-x86_64 | 2.12.120 | 4.00 | 172.00 | 176.00 | ERROR | |
| r-release-windows-x86_64 | 2.12.120 | 7.00 | 133.00 | 140.00 | OK | |
| r-oldrel-macos-arm64 | 2.12.120 | 1.00 | 71.00 | 72.00 | ERROR | |
| r-oldrel-macos-x86_64 | 2.12.120 | 3.00 | 168.00 | 171.00 | ERROR | |
| r-oldrel-windows-x86_64 | 2.12.120 | 8.00 | 147.00 | 155.00 | NOTE |
Version: 2.12.120
Check: for new files in some other directories
Result: NOTE
Found the following files/directories:
‘~/tmp/scratch/Rtmp08Lc5q’ ‘~/tmp/scratch/Rtmp3RL1TD’
‘~/tmp/scratch/Rtmp3V5k5H’ ‘~/tmp/scratch/Rtmp44t8Ao’
‘~/tmp/scratch/Rtmp7GPrFx’ ‘~/tmp/scratch/Rtmp8RU42v’
‘~/tmp/scratch/Rtmp8eUcsv’ ‘~/tmp/scratch/Rtmp9E4ztk’
‘~/tmp/scratch/Rtmp9th13b’ ‘~/tmp/scratch/Rtmp9zj3nh’
‘~/tmp/scratch/RtmpAAzDGW’ ‘~/tmp/scratch/RtmpBmaIgr’
‘~/tmp/scratch/RtmpCfjijm’ ‘~/tmp/scratch/RtmpEdRTAt’
‘~/tmp/scratch/RtmpF6Nm8e’ ‘~/tmp/scratch/RtmpFAjR6S’
‘~/tmp/scratch/RtmpFPsty3’ ‘~/tmp/scratch/RtmpFucY2o’
‘~/tmp/scratch/RtmpGKgXC2’ ‘~/tmp/scratch/RtmpGWIp4b’
‘~/tmp/scratch/RtmpHVeGMl’ ‘~/tmp/scratch/RtmpIHHBp7’
‘~/tmp/scratch/RtmpJDU7Bu’ ‘~/tmp/scratch/RtmpKb5vd9’
‘~/tmp/scratch/RtmpL8HAJv’ ‘~/tmp/scratch/RtmpLIdvlx’
‘~/tmp/scratch/RtmpLMHoGb’ ‘~/tmp/scratch/RtmpM4jFdD’
‘~/tmp/scratch/RtmpME0ymK’ ‘~/tmp/scratch/RtmpMjzn8D’
‘~/tmp/scratch/RtmpN5Hv6n’ ‘~/tmp/scratch/RtmpNNmX8A’
‘~/tmp/scratch/RtmpOFEeM5’ ‘~/tmp/scratch/RtmpOWipf2’
‘~/tmp/scratch/RtmpPtGzEe’ ‘~/tmp/scratch/RtmpR05gDk’
‘~/tmp/scratch/RtmpR9V3tz’ ‘~/tmp/scratch/RtmpRGdpxx’
‘~/tmp/scratch/RtmpRtvQQp’ ‘~/tmp/scratch/RtmpSOHAMZ’
‘~/tmp/scratch/RtmpSaazBG’ ‘~/tmp/scratch/RtmpTnO6PC’
‘~/tmp/scratch/RtmpVJlJrz’ ‘~/tmp/scratch/RtmpWViOaL’
‘~/tmp/scratch/RtmpWVnsQk’ ‘~/tmp/scratch/RtmpWngyzb’
‘~/tmp/scratch/RtmpWr1NNR’ ‘~/tmp/scratch/RtmpWxowFQ’
‘~/tmp/scratch/RtmpXpWAXn’ ‘~/tmp/scratch/RtmpY0DNPM’
‘~/tmp/scratch/RtmpY82Ly7’ ‘~/tmp/scratch/RtmpYklrQV’
‘~/tmp/scratch/RtmpZ2Kiin’ ‘~/tmp/scratch/Rtmpa18wo0’
‘~/tmp/scratch/RtmpaCf38y’ ‘~/tmp/scratch/RtmpaMv6HJ’
‘~/tmp/scratch/Rtmpb2YwJK’ ‘~/tmp/scratch/RtmpbiK7ln’
‘~/tmp/scratch/Rtmpbl87Fl’ ‘~/tmp/scratch/Rtmpbn2CQz’
‘~/tmp/scratch/RtmpbsPlSz’ ‘~/tmp/scratch/RtmpcATUzD’
‘~/tmp/scratch/RtmpcOT9Ch’ ‘~/tmp/scratch/Rtmpcd7bdj’
‘~/tmp/scratch/RtmpcrPzs2’ ‘~/tmp/scratch/Rtmpd6n1xv’
‘~/tmp/scratch/RtmpdZ2og4’ ‘~/tmp/scratch/RtmpdaVGNE’
‘~/tmp/scratch/RtmpeJP19l’ ‘~/tmp/scratch/RtmpeRNksb’
‘~/tmp/scratch/RtmpfDsEn5’ ‘~/tmp/scratch/RtmpfL2kd4’
‘~/tmp/scratch/RtmpfWrppS’ ‘~/tmp/scratch/RtmpfXAmBe’
‘~/tmp/scratch/RtmpgAykrl’ ‘~/tmp/scratch/RtmpgRDBiX’
‘~/tmp/scratch/Rtmph37sQP’ ‘~/tmp/scratch/RtmphUghqN’
‘~/tmp/scratch/RtmpiPZ8qw’ ‘~/tmp/scratch/Rtmpio2V90’
‘~/tmp/scratch/RtmpiwPFJI’ ‘~/tmp/scratch/RtmplpE59J’
‘~/tmp/scratch/Rtmplv08lG’ ‘~/tmp/scratch/Rtmplwa4Zs’
‘~/tmp/scratch/RtmplzJtPm’ ‘~/tmp/scratch/RtmpmHuH7k’
‘~/tmp/scratch/RtmpmTF2GO’ ‘~/tmp/scratch/Rtmpmnkow9’
‘~/tmp/scratch/RtmpmpgWi7’ ‘~/tmp/scratch/RtmpmsmM1o’
‘~/tmp/scratch/RtmpnVd4eB’ ‘~/tmp/scratch/RtmpnXTuG8’
‘~/tmp/scratch/RtmpnmX2hJ’ ‘~/tmp/scratch/RtmpoXYb71’
‘~/tmp/scratch/RtmpoujwTV’ ‘~/tmp/scratch/RtmppimMHu’
‘~/tmp/scratch/RtmppueWGI’ ‘~/tmp/scratch/RtmpqEUb12’
‘~/tmp/scratch/RtmpqEbVaE’ ‘~/tmp/scratch/RtmpqiSIrt’
‘~/tmp/scratch/Rtmpqwq3nA’ ‘~/tmp/scratch/RtmprSZeXW’
‘~/tmp/scratch/RtmprYNvvC’ ‘~/tmp/scratch/Rtmprwhwyt’
‘~/tmp/scratch/RtmpsDJmXS’ ‘~/tmp/scratch/RtmpsXzMir’
‘~/tmp/scratch/Rtmpsjk0FS’ ‘~/tmp/scratch/Rtmpt1fWks’
‘~/tmp/scratch/Rtmpt5lpy4’ ‘~/tmp/scratch/RtmptPknM1’
‘~/tmp/scratch/Rtmptjzeqn’ ‘~/tmp/scratch/RtmpuOaKUy’
‘~/tmp/scratch/RtmpunwEwK’ ‘~/tmp/scratch/RtmpvQ5LQQ’
‘~/tmp/scratch/RtmpvcNqtH’ ‘~/tmp/scratch/Rtmpw6kzMW’
‘~/tmp/scratch/Rtmpw8x2Jz’ ‘~/tmp/scratch/RtmpwCdUhk’
‘~/tmp/scratch/RtmpwbxzW6’ ‘~/tmp/scratch/RtmpwzesCg’
‘~/tmp/scratch/RtmpxjG7xk’ ‘~/tmp/scratch/Rtmpy3Pv3k’
‘~/tmp/scratch/Rtmpy9bowM’ ‘~/tmp/scratch/RtmpzEj22e’
‘~/tmp/scratch/RtmpzjYGw3’ ‘~/tmp/scratch/xvfb-run.20LE0r’
‘~/tmp/scratch/xvfb-run.28AIZI’ ‘~/tmp/scratch/xvfb-run.28DVUr’
‘~/tmp/scratch/xvfb-run.2Peew9’ ‘~/tmp/scratch/xvfb-run.2gGmfy’
‘~/tmp/scratch/xvfb-run.2h3KMY’ ‘~/tmp/scratch/xvfb-run.57RHPU’
‘~/tmp/scratch/xvfb-run.6Hlohs’ ‘~/tmp/scratch/xvfb-run.6SqanA’
‘~/tmp/scratch/xvfb-run.8x1yLC’ ‘~/tmp/scratch/xvfb-run.BMl8xi’
‘~/tmp/scratch/xvfb-run.BRwzwB’ ‘~/tmp/scratch/xvfb-run.DoppYs’
‘~/tmp/scratch/xvfb-run.EFH0YK’ ‘~/tmp/scratch/xvfb-run.ExmK0n’
‘~/tmp/scratch/xvfb-run.G68OTS’ ‘~/tmp/scratch/xvfb-run.GttUZt’
‘~/tmp/scratch/xvfb-run.HasPwF’ ‘~/tmp/scratch/xvfb-run.JUB1er’
‘~/tmp/scratch/xvfb-run.JcJV9J’ ‘~/tmp/scratch/xvfb-run.NXgd9C’
‘~/tmp/scratch/xvfb-run.OnOfHh’ ‘~/tmp/scratch/xvfb-run.OsO70h’
‘~/tmp/scratch/xvfb-run.PTPbYF’ ‘~/tmp/scratch/xvfb-run.QBFBrI’
‘~/tmp/scratch/xvfb-run.Ri0JKC’ ‘~/tmp/scratch/xvfb-run.SBCvWJ’
‘~/tmp/scratch/xvfb-run.UfU3kX’ ‘~/tmp/scratch/xvfb-run.W9bRHr’
‘~/tmp/scratch/xvfb-run.ZB3ILE’ ‘~/tmp/scratch/xvfb-run.blh2Mn’
‘~/tmp/scratch/xvfb-run.crPQgV’ ‘~/tmp/scratch/xvfb-run.d7rLAl’
‘~/tmp/scratch/xvfb-run.ddQIpl’ ‘~/tmp/scratch/xvfb-run.hToi7F’
‘~/tmp/scratch/xvfb-run.hsOsaJ’ ‘~/tmp/scratch/xvfb-run.iDrsM7’
‘~/tmp/scratch/xvfb-run.iLJmaD’ ‘~/tmp/scratch/xvfb-run.iZ7ekS’
‘~/tmp/scratch/xvfb-run.qSKZod’ ‘~/tmp/scratch/xvfb-run.sSlJpj’
‘~/tmp/scratch/xvfb-run.wnPk4N’ ‘~/tmp/scratch/xvfb-run.x2uvd0’
‘~/tmp/scratch/xvfb-run.xL2WBp’ ‘~/tmp/scratch/xvfb-run.yvI4bL’
Flavor: r-devel-linux-x86_64-debian-gcc
Version: 2.12.120
Check: examples
Result: ERROR
Running examples in ‘mvbutils-Ex.R’ failed
The error most likely occurred in:
> ### Name: numvbderiv_parallel
> ### Title: Economy numerical derivatives
> ### Aliases: numvbderiv_parallel numvbderiv
> ### Keywords: misc
>
> ### ** Examples
>
> # Complex numbers are OK:
> numvbderiv( function( x) x*x, complex( real=1, imaginary=3))
[1] 2+6i
> # [1] 2+6i
> # Parallel example... the whole point is to show speed and generality
> # Works fine on my machine
> # But if testing under CRAN, which I normally never do,
> # then CRAN's ludicrous 2-core limit, and deliberate inability to
> # check CRANality (or even number of cores _allowed_) while running,
> # makes this completely ridiculous
> # Not for the first time
> # I have used the function 'get_ncores_CRANal' to try to get round this...
> if( require( 'doParallel')){ # auto loads foreach, iterators, parallel thx2 "Depends"
+ ncores <- detectCores( logical=FALSE)
+ scatn( '%i cores really found', ncores)
+ if( ncores > 2 ){ # pointless otherwise
+ # Need a slowish example. 1e5 is too small; 1e7 better,
+ # ... but hard on auto builders eg R-universe
+ BIGGOVAL <- 1e5
+ slowfun <- function( pars, BIGGO)
+ sum( sqr( 1+1/outer( seq_len( BIGGO), pars)))
+ parstart <- rep( 2, 8)
+ system.time(
+ dscalar <- numvbderiv( slowfun, parstart,
+ BIGGO=BIGGOVAL # named extra param (part of ...)
+ )
+ ) # scalar
+ # Make "doPar back end". I do not know what I am doing ...
+ # NB I like to leave some cores spare, hence "-1"--
+ # superstition, really
+ ncores_target <- min( ncores-1, length( parstart))
+ # Anti CRANky: ignore on your own machine:
+ # ncores_target should just work
+ ncores_avail <- get_ncores_CRANal( ncores_target)
+ scatn( 'Using %i cores eg cozza CRAN', ncores_avail)
+ CLUSTO <- makeCluster( ncores_avail)
+ registerDoParallel( CLUSTO, ncores_avail)
+ # Next bit ensures slaves can find packages... sigh.
+ # Necessary _here_ coz example, but you may not need it
+ # clusterCall does not work properly :/, so the "obvious" fails:
+ # clusterCall( CLUSTO, .libPaths, .libPaths())
+ # Instead, we are forced into this nonsense:
+ print( # for debuggery with as-CRAN
+ eval( substitute(
+ clusterEvalQ( CLUSTO, .libPaths( lb)),
+ list( lb=.libPaths())))
+ )
+ # Need 'mvbutils::sqr', hence '.packages' arg
+ scatn( 'Starting parallel time test')
+ print( system.time(
+ dpara <- numvbderiv_parallel( slowfun, parstart,
+ BIGGO=BIGGOVAL, # named extra parameter
+ FOREACH_ARGS=list( .packages= 'mvbutils')
+ )
+ )
+ )
+ scatn( 'Done')
+ print( rbind( dscalar, dpara))
+ # To refer to other data (ie beside params)
+ # best practice is to put it into function's environment
+ # (generally true, not just for numvbderiv)
+ e <- new.env()
+ e$paroffset <- c( 6, -3)
+ fun2 <- function( pars) { # not a speed test, can be smaller
+ sum( sqr( 1+1/outer( 1:1e3, pars+paroffset)))
+ }
+ environment( fun2) <- e
+ scatn( 'Scalar, using extra data via environment')
+ print( numvbderiv( fun2, parstart))
+ # Parallel version should still work, coz function's environment
+ # is also passed to slaves
+ scatn( 'Trying parallel version...')
+ print( try({
+ numvbderiv_parallel( fun2, parstart,
+ FOREACH_ARGS=list( .packages= 'mvbutils')
+ )
+ })
+ )
+ # Sometimes you do need to explicitly export stuff to the slave processes
+ # Here's a version that will get paroffset from datenv
+ # datenv must exist...
+ alt_fun2 <- function( pars){
+ environment( fun2) <- list2env( datenv)
+ fun2( pars)
+ }
+ scatn( 'With explicit data (in parallel)')
+ datenv <- as.list( e)
+ print( numvbderiv_parallel( alt_fun2, parstart,
+ FOREACH_ARGS=list(
+ .packages= 'mvbutils',
+ .export= cq( datenv, fun2) # stuff that alt_fun2 refers to
+ )
+ )
+ )
+ # Always tidy up your clusters once you have finished playing
+ stopImplicitCluster()
+ stopCluster( CLUSTO)
+ rm( CLUSTO)
+ } # if ncores>2
+ } # parallel
Loading required package: doParallel
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
12 cores really found
Error in stopCluster(CLUSTO) : CRANtidote
Calls: get_ncores_CRANal -> stopCluster
Execution halted
Flavor: r-release-macos-arm64
Version: 2.12.120
Check: examples
Result: ERROR
Running examples in ‘mvbutils-Ex.R’ failed
The error most likely occurred in:
> ### Name: numvbderiv_parallel
> ### Title: Economy numerical derivatives
> ### Aliases: numvbderiv_parallel numvbderiv
> ### Keywords: misc
>
> ### ** Examples
>
> # Complex numbers are OK:
> numvbderiv( function( x) x*x, complex( real=1, imaginary=3))
[1] 2+6i
> # [1] 2+6i
> # Parallel example... the whole point is to show speed and generality
> # Works fine on my machine
> # But if testing under CRAN, which I normally never do,
> # then CRAN's ludicrous 2-core limit, and deliberate inability to
> # check CRANality (or even number of cores _allowed_) while running,
> # makes this completely ridiculous
> # Not for the first time
> # I have used the function 'get_ncores_CRANal' to try to get round this...
> if( require( 'doParallel')){ # auto loads foreach, iterators, parallel thx2 "Depends"
+ ncores <- detectCores( logical=FALSE)
+ scatn( '%i cores really found', ncores)
+ if( ncores > 2 ){ # pointless otherwise
+ # Need a slowish example. 1e5 is too small; 1e7 better,
+ # ... but hard on auto builders eg R-universe
+ BIGGOVAL <- 1e5
+ slowfun <- function( pars, BIGGO)
+ sum( sqr( 1+1/outer( seq_len( BIGGO), pars)))
+ parstart <- rep( 2, 8)
+ system.time(
+ dscalar <- numvbderiv( slowfun, parstart,
+ BIGGO=BIGGOVAL # named extra param (part of ...)
+ )
+ ) # scalar
+ # Make "doPar back end". I do not know what I am doing ...
+ # NB I like to leave some cores spare, hence "-1"--
+ # superstition, really
+ ncores_target <- min( ncores-1, length( parstart))
+ # Anti CRANky: ignore on your own machine:
+ # ncores_target should just work
+ ncores_avail <- get_ncores_CRANal( ncores_target)
+ scatn( 'Using %i cores eg cozza CRAN', ncores_avail)
+ CLUSTO <- makeCluster( ncores_avail)
+ registerDoParallel( CLUSTO, ncores_avail)
+ # Next bit ensures slaves can find packages... sigh.
+ # Necessary _here_ coz example, but you may not need it
+ # clusterCall does not work properly :/, so the "obvious" fails:
+ # clusterCall( CLUSTO, .libPaths, .libPaths())
+ # Instead, we are forced into this nonsense:
+ print( # for debuggery with as-CRAN
+ eval( substitute(
+ clusterEvalQ( CLUSTO, .libPaths( lb)),
+ list( lb=.libPaths())))
+ )
+ # Need 'mvbutils::sqr', hence '.packages' arg
+ scatn( 'Starting parallel time test')
+ print( system.time(
+ dpara <- numvbderiv_parallel( slowfun, parstart,
+ BIGGO=BIGGOVAL, # named extra parameter
+ FOREACH_ARGS=list( .packages= 'mvbutils')
+ )
+ )
+ )
+ scatn( 'Done')
+ print( rbind( dscalar, dpara))
+ # To refer to other data (ie beside params)
+ # best practice is to put it into function's environment
+ # (generally true, not just for numvbderiv)
+ e <- new.env()
+ e$paroffset <- c( 6, -3)
+ fun2 <- function( pars) { # not a speed test, can be smaller
+ sum( sqr( 1+1/outer( 1:1e3, pars+paroffset)))
+ }
+ environment( fun2) <- e
+ scatn( 'Scalar, using extra data via environment')
+ print( numvbderiv( fun2, parstart))
+ # Parallel version should still work, coz function's environment
+ # is also passed to slaves
+ scatn( 'Trying parallel version...')
+ print( try({
+ numvbderiv_parallel( fun2, parstart,
+ FOREACH_ARGS=list( .packages= 'mvbutils')
+ )
+ })
+ )
+ # Sometimes you do need to explicitly export stuff to the slave processes
+ # Here's a version that will get paroffset from datenv
+ # datenv must exist...
+ alt_fun2 <- function( pars){
+ environment( fun2) <- list2env( datenv)
+ fun2( pars)
+ }
+ scatn( 'With explicit data (in parallel)')
+ datenv <- as.list( e)
+ print( numvbderiv_parallel( alt_fun2, parstart,
+ FOREACH_ARGS=list(
+ .packages= 'mvbutils',
+ .export= cq( datenv, fun2) # stuff that alt_fun2 refers to
+ )
+ )
+ )
+ # Always tidy up your clusters once you have finished playing
+ stopImplicitCluster()
+ stopCluster( CLUSTO)
+ rm( CLUSTO)
+ } # if ncores>2
+ } # parallel
Loading required package: doParallel
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
6 cores really found
Error in stopCluster(CLUSTO) : CRANtidote
Calls: get_ncores_CRANal -> stopCluster
Execution halted
Flavors: r-release-macos-x86_64, r-oldrel-macos-x86_64
Version: 2.12.120
Check: R code for possible problems
Result: NOTE
cd.load: possible error in mget("tasks", pos = 2, ifnotfound =
list(character(0))): unused argument (pos = 2)
get.cd.from.menu: possible error in mget("tasks", pos = 1, ifnotfound =
list(structure(character(0), names = character(0)))): unused argument
(pos = 1)
make.new.cd.task: possible error in mget("tasks", pos = 2, ifnotfound =
list(character(0))): unused argument (pos = 2)
Flavors: r-oldrel-macos-arm64, r-oldrel-macos-x86_64, r-oldrel-windows-x86_64
Version: 2.12.120
Check: examples
Result: ERROR
Running examples in ‘mvbutils-Ex.R’ failed
The error most likely occurred in:
> ### Name: numvbderiv_parallel
> ### Title: Economy numerical derivatives
> ### Aliases: numvbderiv_parallel numvbderiv
> ### Keywords: misc
>
> ### ** Examples
>
> # Complex numbers are OK:
> numvbderiv( function( x) x*x, complex( real=1, imaginary=3))
[1] 2+6i
> # [1] 2+6i
> # Parallel example... the whole point is to show speed and generality
> # Works fine on my machine
> # But if testing under CRAN, which I normally never do,
> # then CRAN's ludicrous 2-core limit, and deliberate inability to
> # check CRANality (or even number of cores _allowed_) while running,
> # makes this completely ridiculous
> # Not for the first time
> # I have used the function 'get_ncores_CRANal' to try to get round this...
> if( require( 'doParallel')){ # auto loads foreach, iterators, parallel thx2 "Depends"
+ ncores <- detectCores( logical=FALSE)
+ scatn( '%i cores really found', ncores)
+ if( ncores > 2 ){ # pointless otherwise
+ # Need a slowish example. 1e5 is too small; 1e7 better,
+ # ... but hard on auto builders eg R-universe
+ BIGGOVAL <- 1e5
+ slowfun <- function( pars, BIGGO)
+ sum( sqr( 1+1/outer( seq_len( BIGGO), pars)))
+ parstart <- rep( 2, 8)
+ system.time(
+ dscalar <- numvbderiv( slowfun, parstart,
+ BIGGO=BIGGOVAL # named extra param (part of ...)
+ )
+ ) # scalar
+ # Make "doPar back end". I do not know what I am doing ...
+ # NB I like to leave some cores spare, hence "-1"--
+ # superstition, really
+ ncores_target <- min( ncores-1, length( parstart))
+ # Anti CRANky: ignore on your own machine:
+ # ncores_target should just work
+ ncores_avail <- get_ncores_CRANal( ncores_target)
+ scatn( 'Using %i cores eg cozza CRAN', ncores_avail)
+ CLUSTO <- makeCluster( ncores_avail)
+ registerDoParallel( CLUSTO, ncores_avail)
+ # Next bit ensures slaves can find packages... sigh.
+ # Necessary _here_ coz example, but you may not need it
+ # clusterCall does not work properly :/, so the "obvious" fails:
+ # clusterCall( CLUSTO, .libPaths, .libPaths())
+ # Instead, we are forced into this nonsense:
+ print( # for debuggery with as-CRAN
+ eval( substitute(
+ clusterEvalQ( CLUSTO, .libPaths( lb)),
+ list( lb=.libPaths())))
+ )
+ # Need 'mvbutils::sqr', hence '.packages' arg
+ scatn( 'Starting parallel time test')
+ print( system.time(
+ dpara <- numvbderiv_parallel( slowfun, parstart,
+ BIGGO=BIGGOVAL, # named extra parameter
+ FOREACH_ARGS=list( .packages= 'mvbutils')
+ )
+ )
+ )
+ scatn( 'Done')
+ print( rbind( dscalar, dpara))
+ # To refer to other data (ie beside params)
+ # best practice is to put it into function's environment
+ # (generally true, not just for numvbderiv)
+ e <- new.env()
+ e$paroffset <- c( 6, -3)
+ fun2 <- function( pars) { # not a speed test, can be smaller
+ sum( sqr( 1+1/outer( 1:1e3, pars+paroffset)))
+ }
+ environment( fun2) <- e
+ scatn( 'Scalar, using extra data via environment')
+ print( numvbderiv( fun2, parstart))
+ # Parallel version should still work, coz function's environment
+ # is also passed to slaves
+ scatn( 'Trying parallel version...')
+ print( try({
+ numvbderiv_parallel( fun2, parstart,
+ FOREACH_ARGS=list( .packages= 'mvbutils')
+ )
+ })
+ )
+ # Sometimes you do need to explicitly export stuff to the slave processes
+ # Here's a version that will get paroffset from datenv
+ # datenv must exist...
+ alt_fun2 <- function( pars){
+ environment( fun2) <- list2env( datenv)
+ fun2( pars)
+ }
+ scatn( 'With explicit data (in parallel)')
+ datenv <- as.list( e)
+ print( numvbderiv_parallel( alt_fun2, parstart,
+ FOREACH_ARGS=list(
+ .packages= 'mvbutils',
+ .export= cq( datenv, fun2) # stuff that alt_fun2 refers to
+ )
+ )
+ )
+ # Always tidy up your clusters once you have finished playing
+ stopImplicitCluster()
+ stopCluster( CLUSTO)
+ rm( CLUSTO)
+ } # if ncores>2
+ } # parallel
Loading required package: doParallel
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
16 cores really found
Error in stopCluster(CLUSTO) : CRANtidote
Calls: get_ncores_CRANal -> stopCluster
Execution halted
Flavor: r-oldrel-macos-arm64
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.