Support Requests item #1576013, was opened at 2006-10-12 11:49
Message generated for change (Comment added) made by warnes
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=453022&aid=1576013&group_id=48422
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
>Group: None
>Status: Closed
Priority: 5
Private: No
Submitted By: R.J.V. Bertin (rjvbertin)
>Assigned to: Gregory Warnes (warnes)
Summary: threading
Initial Comment:
This is mostly a question. I'm trying to do some multithreaded analysis,
calculating the correlation coefficient of 1 independent dataset (array) with 4
dependent arrays. It'd be nice if that could be done in 4 parallel threads.
As long as I stick to pure Python code (using equivalents to R routines that
can be found in Numpy and SciPy), this works fine. However, when I call R
functions through rpy, a crash will occur at some point, with the error
*** caught segfault ***
address 0x5164000, cause 'memory not mapped'
(this is on Mac OS X 10.4.8), somewhere in Rf_Eval.
Is this because R itself isn't thread-safe? The R/Python wrapper functions I'm
using:
def vvar(a):
v=rpy.r.var(a, na_rm=True)
if isnan(v):
return 0
return v
R_spearmanr=rpy.r('function(a,b){ kk<-cor.test(a,b,method="spearman"); c(
kk$estimate[[1]], kk$p.value) ; }')
I'm taking care to make copies of the arrays I'm correlating when initialising
the threads.
thanks in advance,
René
----------------------------------------------------------------------
>Comment By: Gregory Warnes (warnes)
Date: 2008-05-14 13:54
Message:
Logged In: YES
user_id=9316
Originator: NO
Unfortunately, R is not thread safe , so only one python thread can safely
call R.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=453022&aid=1576013&group_id=48422
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
rpy-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rpy-list