hodgesse1 / rfortran

Automatically exported from code.google.com/p/rfortran
0 stars 0 forks source link

drastic slowdown in Rxxx between v092 and v2.1.2, 100x loss of speed #87

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Mark,

Ben "The Fox" Renard and myself have found that RFortran 2.1.2 is operating 
vastly slower than v092 (dating back to 2007) in terms of passing the 
data/commands to (and perhaps from) R.

The slowdown is about a factor of 100 or more, and makes it infeasible to use 
RFortran in codes such as those where a simple R function is evaluated many 
times inside a Fortran DO loop. Here, the speed of transfer, rather than the 
complexity of the function, becomes the bottleneck.

Although such usage is non-ideal, it is sometimes highly desirable and other 
times unavoidable, especially during pilot research projects such those 
RFortran is useful for. Eg, we found that a task taking 10 sec or so using 
RFortran 092 takes >10mins with RFortran 2.1.2. This was found during actual 
work (for me in BATEA and for Ben in likelihood analysis)

We compared with MATFortran, and MATFortran is comparable to RFortran 092 
(probably because they are both limited by the inherent COM mechanism) and is 
quite efficient.

In order to be competitive, RFortran needs to be sped back up again.

*** What version of RFortran are you using?

2.1.2 compared to 092

*** On which Windows operating system?

Windows XP

*** What Fortran compiler (name and version number) are you using?

Intel Fortran 11.0.072

*** What version of R are you using?

R 2.11.1

*** If you have a coding solution to this defect please include the file
(or preferably a svn patch) as an attachment

You could have a careful look for what has changed since the earlier versions. 
I suspect there is a lot more error checking, which is useful, but there should 
be a clear documented way of switching it on/off, eg, as part of the Rinit 
command.

*** Please provide any additional information below.

I attach an IVF solution and code that allows comparing timings for RFortran, 
MATFortran, etc. Using this code is not straighforward (as it caters for 
several options) but you can modify it to make it easier for RFortran only.

Original issue reported on code.google.com by dmitri.k...@gmail.com on 3 Jan 2011 at 9:34

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by mark.th...@gmail.com on 14 Feb 2011 at 11:06

GoogleCodeExporter commented 8 years ago

Original comment by mark.th...@gmail.com on 14 Feb 2011 at 11:16

GoogleCodeExporter commented 8 years ago
Mark,

Just a reminder to have a look at this. I am increasingly using RFortran within 
BATEA, which now supports writing models, distributions and transformation in 
R/Matlab.

In fact soon Guillaume will be experimenting with different input error models, 
and it would be great if he could to that in R (to keep away from the Fortran 
core). However in order for this to be practical, RFortran needs to be restored 
to its previous speed (100 x).

cheers,
d

Original comment by dmitri.k...@gmail.com on 23 Jun 2011 at 4:19