HenrikBengtsson / parallelly

R package: parallelly - Enhancing the 'parallel' Package
https://parallelly.futureverse.org
128 stars 7 forks source link

R_PARALLELLY_AVAILABLECORES_FALLBACK stopped working after adding support for 'nproc' #53

Closed HenrikBengtsson closed 3 years ago

HenrikBengtsson commented 3 years ago

Issue

Environment variable R_PARALLELLY_AVAILABLECORES_FALLBACK stopped working after adding support for nproc, e.g.

$ R_PARALLELLY_AVAILABLECORES_FALLBACK=2 Rscript --vanilla -e "parallelly::availableCores()"
system 
     8 

Troubleshooting

This is because "nproc" is now also reported and the "fallback" setting is only used if the only other settings is "system";

$ R_PARALLELLY_AVAILABLECORES_FALLBACK=2 Rscript --vanilla -e "parallelly::availableCores(which='all')"
  system    nproc fallback 
       8        8        2