Unable to delete previous doSMP queues

£可爱£侵袭症+ 提交于 2019-12-02 05:57:35

问题


I'm trying to use doSMP, and when I try w <- startWorkers(4), I get the error

1: In startWorkers(workerCount = 4) :

there is an existing doSMP session using doSMP1

(actually doSMP1,...doSMP8). Now, when I try to remove this using rmSessions('doSMP1') I get the error message

attempting to delete qnames: doSMP1

unable to delete queues: doSMP1

Any suggestions on how to get this to work. On my 8-core machine, doSNOW stopped working from version 2.11, and I would like to be able to parallel process locally without sending things out to a linux server.

I'm running R 2.12.1 (32-bit) on WinXP 64-bit on a 8-core machine.


回答1:


doSMP is actually developed to be used on the Revolution build, and is rather heavy on your system. In my experience it can crash R rather easily if you're not very, very careful about what you're doing. For parallel computing, I have far better experiences with the packages snow, snowfall (which is essentially a front-end to snow) and multicore.

Also make sure that you use the latest version of R (2.12.2), as the current build of doSMP is compiled for 2.12.2.

If you really need to get rid of those sessions, you can try to delete the files in the temporary directory specified when looking at the workers object :

>  w <- startWorkers(workerCount = 4)
> w
$taskq
<pointer: 0x05974f20>

$qname
[1] "doSMP1"

$workerCount
[1] 4

$tmpdir
[1] "C:\\Users\\JORISF~1\\AppData\\Local\\Temp\\RtmpXxLcTk\\doSMP44c815a1"

This directory you should clear. After you wrote down the temporary file, first stop the current workers and then try to delete all sessions :

stopWorkers(w)
rmSessions(all=TRUE)

Then clean out the directory. Then restart R. Sometimes it happens that after startup there is still a remainder of the sessions running, you'll see that if you use startWorkers() again. If so, again use first stopWorkers(w) without registering first! Then again do rmSessions(all=TRUE). Sometimes R will simply crash. Restart and continue as indicated here.

Finally, forget about doSMP and use one of the other mentioned packages. Snowfall will give you the least headaches if you have no previous experience. There's a nice introduction here.

UPDATE : From R2.14 on you have the built-in package parallel that combines the functionality of multicore and snow.



来源:https://stackoverflow.com/questions/5197619/unable-to-delete-previous-dosmp-queues

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!