From d|pter|x@w@ng @end|ng |rom gm@||@com  Wed Aug  7 13:47:38 2024
From: d|pter|x@w@ng @end|ng |rom gm@||@com (Dipterix Wang)
Date: Wed, 7 Aug 2024 07:47:38 -0400
Subject: [Rd] 
 Another issue using multi-processing linear algebra libraries
In-Reply-To: <mailman.54426.5.1723024802.5780.r-devel@r-project.org>
References: <mailman.54426.5.1723024802.5780.r-devel@r-project.org>
Message-ID: <8A410D3E-CE79-4151-99AC-9F7D574B31A4@gmail.com>

I also have this questions for this. I wonder if R initiates a system environment or options to instruct the packages on the number of cores to use?

It doesn't have to be mandatory for now, but at least package maintainers can have shared consensus and start to adopt this humble settings rather than abusing parallel::detectCores() to max out the number of threads by default. 

> On Aug 7, 2024, at 6:00?AM, r-devel-request at r-project.org wrote:
> 
>> Would it make sense to add a parameter somewhere, to mclapply(), say,
>> telling R to not use multiprocessing libraries?
> 
> It would be great if we had a way to limit all kinds of multiprocessing
> (child processes, OpenMP threads, pthreads, forks, MPI, PVM, 'parallel'
> clusters, <insert many more methods here>) in a single setting, but
> there is currently no such setting, and it may be impossible to
> implement. Particularly problematic may be nested parallellism:
> sometimes desirable (e.g. 4-machine cluster, each machine in it using
> OpenMP threads), sometimes undesired (e.g. your case). A single setting
> is probably far from enough.
> 
>> Does R even know whether a linked library is doing multi-processing?
> 
> Unfortunately, no, there is no standard interface for that. Best I can
> recommend is to link your R installation with FlexiBLAS and then use the
> 'flexiblas' CRAN package to talk to it.


	[[alternative HTML version deleted]]



[Rd] Another issue using multi-processing linear algebra libraries
Dipterix Wang