Dario Strbenac
2024-May-21 08:00 UTC
[Rd] confint Attempts to Use All Server CPUs by Default
Hello, Would a less resource-intensive value, such as 1, be a safer default CPU value for confint? I noticed excessive CPU usage on a I.T. administrator-managed server which was being three-quarters used by another staff member when the confidence interval calculation in an R Markdown document suddenly changed from two seconds to ninety seconds because of competition for CPUs between users. Also, there is no mention of such parallel processing in ?confint, so it was not clear at first where to look for performance degradation. It could at least be described in the manual page so that users would know that export OPENBLAS_NUM_THREADS=1 is a solution. -------------------------------------- Dario Strbenac University of Sydney Camperdown NSW 2050 Australia
? Tue, 21 May 2024 08:00:11 +0000 Dario Strbenac via R-devel <r-devel at r-project.org> ?????:> Would a less resource-intensive value, such as 1, be a safer default > CPU value for confint?Which confint() method do you have in mind? There is at least four of them by default in R, and many additional classes could make use of stats:::confint.default by implementing vcov().> Also, there is no mention of such parallel processing in ?confint, so > it was not clear at first where to look for performance degradation. > It could at least be described in the manual page so that users would > know that export OPENBLAS_NUM_THREADS=1 is a solution.There isn't much R can do about the behaviour of the BLAS, because there is no standard interface to set the number of threads. Some BLASes (like ATLAS) don't even offer it as a tunable number at all [*]. A system administrator could link the installation of R against FlexiBLAS [**], provide safe defaults in the environment variables and educate the users about its tunables [***], but that's a choice just like it had been a choice to link R against a parallel variant of OpenBLAS on a shared computer. This is described in R Installation and Administration, section A.3.1 [****]. -- Best regards, Ivan [*] https://math-atlas.sourceforge.net/faq.html#tnum [**] https://www.mpi-magdeburg.mpg.de/projects/flexiblas [***] https://search.r-project.org/CRAN/refmans/flexiblas/html/flexiblas-threads.html [****] https://cran.r-project.org/doc/manuals/R-admin.html#BLAS