Skip to content
Back to formatted view

Raw Message

Message-ID: <8cbea384-b1b7-f077-33a6-58acf42210be@prodsyse.com>
Date: 2023-02-18T14:50:05Z
From: Spencer Graves
Subject: macOS may not give R much time in a long compute
In-Reply-To: <aa5f220c-5428-e196-9628-c2920de6ca4b@stats.ox.ac.uk>

On 2/18/23 6:40 AM, Prof Brian Ripley wrote:
> Are you using R.app (you failed to say)?


	  I'm "using the newest version of RStudio" [Version 2022.12.0+353 
(2022.12.0+353)].  This means I am running R.app?

> 
> If so, have you acted on the documentation about 'app nap'?? E.g. ?4.1 
> of the R-admin manual.


	  Thanks for the term "app nap" and the reference to ?4.1 of the 
R-admin manual.  I had not previously heard of "app nap", but that 
sounds like what I've encountered, and that section of the manual 
suggests that if I encounter this problem again, I can open a terminal 
and enter:


defaults write org.R-project.R NSAppSleepDisabled -bool YES


	  Will it take effect immediately?  Or will I need to restart R?


	  I've changed the code since I reported this problem, and I have not 
encountered this problem since.  I'm not sure, but when I noticed this 
problem, I may have had "if(max(et3i)>1800)" [progress report every 30 
minutes] instead of "if(max(et3i)>180)" [progress report every 3 
minutes].[*]  With luck, this change may fix this problem.  If yes, 
might you have any idea what the threshold might be?


	  Thanks very much.
	  Spencer Graves


[*] I'm not sure what threshold I was using when I encountered this 
problem:  180 or 1800 seconds.  I foolishly didn't save the output that 
included lines like the following:


iscan =  22992 ; et3i =  180 26 104


iscan =  32124 ; et3i =  22 1 180

> 
> On 18/02/2023 12:31, Spencer Graves wrote:
>> Hello:
>>
>>
>> ?????? During a long compute (in a while loop), I've asked R to report 
>> progress via:
>>
>>
>> # Progress report every 3 minutes
>> ?? et3i <- proc.time()-startT3i
>> ?? if(max(et3i)>180){
>> ???? startT3i <- proc.time()
>> ???? cat('iscan = ', iscan3, '; et3i = ',
>> ???????? round(et3i[1:3]), '\n')
>> ?? }
>>
>>
>> ?????? When it's running properly, I get something like the following:
>>
>>
>> iscan =? 22992 ; et3i =? 180 26 104
>>
>>
>> ?????? However if I leave my computer running unattended, I can get 
>> reports like the following:
>>
>>
>> iscan =? 32124 ; et3i =? 22 1 180
>>
>>
>> ?????? Evidently, macOS 11.7.4 decided NOT to give time to R.
>>
>>
>> ?????? Suggestions?
>> ?????? Thanks,
>> ?????? Spencer Graves
>>
>>
>> ??sessionInfo()
>> R version 4.2.2 (2022-10-31)
>> Platform: x86_64-apple-darwin17.0 (64-bit)
>> Running under: macOS Big Sur 11.7.4
>>
>> Matrix products: default
>> LAPACK: 
>> /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
>>
>> locale:
>> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>>
>> attached base packages:
>> [1] stats???? graphics? grDevices utils???? datasets? methods?? base
>>
>> loaded via a namespace (and not attached):
>> [1] compiler_4.2.2 tools_4.2.2??? knitr_1.42???? xfun_0.37
>> ?>
> 
>