[R] Rcpp and mclapply
Jeff Newmiller
jdnewmil at dcn.davis.CA.us
Thu Oct 10 17:56:25 CEST 2013
I cannot imagine how the calling process will affect this. If you want further help I think you will need to provide a reproducible example and info as requested by the Posting Guide.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
sophie_brugieres at mpipsykl.mpg.de wrote:
>Dear Jeff,
>
>I had suspected something along those lines initially, however, as I
>had
>stated, this only happens sometimes ...
>
>Here is a partial top showing two of my calls:
>
>17404 sophie 20 0 12.4g 11g 1996 R 100 4.6 5:50.11 R
>17405 sophie 20 0 12.4g 11g 2016 R 100 4.6 5:49.86 R
>17408 sophie 20 0 12.4g 11g 2016 R 100 4.6 5:49.13 R
>17411 sophie 20 0 12.4g 11g 2016 R 100 4.6 5:48.39 R
>17412 sophie 20 0 12.4g 11g 2016 R 100 4.6 5:48.14 R
> 1461 sophie 20 0 12.7g 11g 2016 R 2 4.7 25:19.27 R
> 1465 sophie 20 0 12.7g 11g 2016 R 2 4.7 25:19.05 R
> 1476 sophie 20 0 12.7g 11g 2016 R 2 4.7 25:18.73 R
> 1486 sophie 20 0 12.7g 11g 2016 R 2 4.7 25:18.39 R
> 1491 sophie 20 0 12.7g 11g 2016 R 2 4.7 25:18.24 R
>
>the ones in the 1400 range come from one call, the ones with 17000 from
>another ...
>
>It seems to be linked to the console instance that the call is made
>from
>in a way that I cannot grasp yet.
>
>Still puzzled ...
>
> Sophie
>
>> I would bet that you are doing something in C++ that shares some
>resource
>> between the workers and blocks all but one worker at a time.
>>
>---------------------------------------------------------------------------
>> Jeff Newmiller The ..... ..... Go
>> Live...
>> DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live
>> Go...
>> Live: OO#.. Dead: OO#..
>Playing
>> Research Engineer (Solar/Batteries O.O#. #.O#. with
>> /Software/Embedded Controllers) .OO#. .OO#.
>> rocks...1k
>>
>---------------------------------------------------------------------------
>> Sent from my phone. Please excuse my brevity.
>>
>> sophie_brugieres at mpipsykl.mpg.de wrote:
>>>Dear all,
>>>
>>>I have an R script that uses Rcpp, and I have been trying to
>>>parallelize
>>>it using mclapply (I tried with the multicore and the parallel
>library)
>>>
>>>Sometimes (not always, interestingly), the CPU use for each core
>drops,
>>>usually so that the total over all cores reaches 100%, i.e., as fast
>as
>>>if
>>>using just one single core fully. I tried my code directly from
>within
>>>emacs, and also using a shell command - it happens either way.
>>>
>>>I suspect there might be some interaction between Rcpp and the
>>>multicore/parallel libraries. Did any R(cpp) user encounter such
>>>symptoms?
>>>
>>>Sophie
>>>
>>>______________________________________________
>>>R-help at r-project.org mailing list
>>>https://stat.ethz.ch/mailman/listinfo/r-help
>>>PLEASE do read the posting guide
>>>http://www.R-project.org/posting-guide.html
>>>and provide commented, minimal, self-contained, reproducible code.
>>
>>
>>
More information about the R-help
mailing list