hodgesse1 / rfortran

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

RFortran para Linux #52

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
*** Please provide a description of the enhancement you are requesting.

Buenos dias! Quiciera utilisar el metodo RFortran en un 'cluster' de
ordenadoras basadas en la plataforma 'Linux'.

Como entiendo el problema principal es la sustitucion del mecanismo COM.
Esa pagina le podria ayudar en esa mission:

http://www.linuxquestions.org/questions/programming-9/linux-equivalent-of-com-72
6006/

buena suerte,
d

Original issue reported on code.google.com by dmitri.k...@gmail.com on 9 Oct 2009 at 10:45

GoogleCodeExporter commented 8 years ago

Original comment by mark.th...@gmail.com on 4 Mar 2010 at 3:31

GoogleCodeExporter commented 8 years ago
It is possible: 

-----Original Message-----
From: Thomas Baier [mailto:thomas.baier@univie.ac.at] 
Sent: Thursday, 3 June 2010 7:54 AM
To: Mark Thyer
Cc: 'Guido Yactayo'; vazken.andreassian@cemagref.fr; Andras.Bardossy@iws.uni-
stuttgart.de; mp.clark@niwa.co.nz; f.fenicia@tudelft.nl; rfortran-
users@googlegroups.com
Subject: Re: Rfortran

Hi Mark,

you can simply replace rcom/statconnDCOM with statconnWS. This provides
a web-service (SOAP/http) interface to R and will work on Linux, too.

The current test version is compiled for Windows only, but the
implementation is 100% portable to Linux and MacOS X, too.

The nice thing about this is, that the semantics of the interface are
the same as for rcom/statconnDCOM (same functions, same parameters).

Best,
Thomas

Mark Thyer schrieb:
> Guido,
> 
>  
> 
> The current version of RFortran (v2.1.1) is dependent on Windows because
> it uses Thomas Baier’s rcom package which relies on the Windows COM
> model to transfer between R and Fortran.  As COM is Windows only, it
> will not work on Linux.
> 
>  
> 
> In the future I would like to find a COM-equivalent system to transfer
> from R to Fortran that works in Linux to remove this limitation. This
> requires finding someone who has experience using Linux to co-develop
> this because the rfortran development team has limited experience in
> using Linux.
> 
>  
> 
> If you know of anybody please  let me know.
> 
>  
> 
> Mark
> 
>  
> 
>  
> 
> *From:* Guido Yactayo [mailto:gyactayo@chesapeakebay.net]
> *Sent:* Wednesday, 2 June 2010 4:18 AM
> *To:* 'vazken.andreassian@cemagref.fr';
> 'Andras.Bardossy@iws.uni-stuttgart.de'; 'mp.clark@niwa.co.nz';
> 'f.fenicia@tudelft.nl'; 'thomas.baier@univie.ac.at'
> *Subject:* Rfortran
> 
>  
> 
> Rfortan users,
> 
>  
> 
> I found your manuscript in the Rfortan website and I found it really
> interesting. I have a question for you and hope you can help me.
> 
>  
> 
> Is possible to use R fortran under a linux platform? I used fortan and R
> but separately. I use fortan 77 under a linux platform to run a
> hydrologic model and I use R for windows. It would be a dream come true
> to use R from fortran, but from what I read in the Rfortan website is
> seem to be not possible in a linux platform.
> 
>  
> 
> Any advice would be appreciated,
> 
>  
> 
> -Guido
> 
>  
> 
>  

Original comment by mark.th...@gmail.com on 4 Jun 2010 at 3:45

GoogleCodeExporter commented 8 years ago
Initial Evaluation of StatconnWS 
(http://homepage.univie.ac.at/erich.neuwirth/php/rcomwiki/doku.php?id=statconnws
)

It uses a SOAP/http interface, to pass messages between process.

SOAP/http (http://en.wikipedia.org/wiki/SOAP) uses XML (ASCII) as the message 
format 

As noted (http://en.wikipedia.org/wiki/SOAP#Disadvantages) this has advantages 
in that it is human readable, but because it requires writing/reading an ASCII 
file it can be slow and cumbersome.

This could mean when using RFortran on Linux, the speed advantages of using 
Linux are negated by the additional processing cost of using statconnWS

To enable Linux implementation of RFortran that does not have significant speed 
disadvantages a possible option is to develop a hybrid approach, as follows:
1. R commands/small data (short arrays/scalars) (generally small) are passed 
via StatconnWS 
2. Larger data (arrays/vectors) are transferred between R and Fortran using 
binary format such as netcdf.

Original comment by mark.th...@gmail.com on 9 Jan 2013 at 10:42

GoogleCodeExporter commented 8 years ago
Another alternative for using R-Fortran on linux is consider the following:

Use netcdf as the primary transfer mechanism for information between Fortran 
and R.

For Commands: Netcdf - can pass commands as character strings from Fortran to 
R, and then R can process these character strings as commands.
For Data: Netcdf - use the common netcdf message passing interface. 

Advantages
----------
- No more need for statconn (no more administrator priveldges, easier 
installation etc.)
- Cross-platform (Windows/Linux), dependent only on availability of relevant 
netcdf binaries
- Uses a more commonly used "intermediary"  - netcdf
- It is potentially extensible, i.e. X-Fortran (where X = R, or another 
scripting language) where data/commands can be read from a netcdf file and 
executed
- Will save memory since data will be transferred via disk drive

Disadvantages
-------------
- Will be reading and writing a binary netcdf file - likely to be slower then 
statconnDCOM, but much faster than statconnWS, though this will be less of an 
issue with the increased use of solid-state drives. 
- Will require development of RFortran specific R-package that can read the 
RFortran netcdf files, and pass information and commands - this will not too 
complex

Original comment by mark.th...@gmail.com on 9 Jan 2013 at 11:22

GoogleCodeExporter commented 8 years ago
Mark,

Using netcdf to transfer data between Fortran and R is an interesting idea, 
especially in terms of speed of data transfer and degree of control over the 
implementation.

A key issue is the ability to send at least simple messages to R from within 
Fortran, to trigger R looking for netcdf files, etc. Without this your 
netcdf-based data-transfer approach will not work. Note that it is very 
important (arguably essential) for the R instance to retain its memory between 
calls (so that multiple variables can be passed/retrieved over the execution of 
a program).

This does *not* seem trivial - indeed that's the very purpose of statCONN!

As we discussed, a possible option is to figure out how this is done by R IDEs 
such as Tinn-R and/or Rstudio. 

Note that Tinn-R is Windows-only (suggesting it uses COM?).

RStudio seems to be Win/Mac/Linux, which is more promising. I had a quick look 
at its open source code (http://www.rstudio.com/ide/download/desktop  - see 
right at bottom of page). I just opened 'src/cpp/r/RExec.cpp' - looks relevant 
to executing R, but I dont know C++ enough to make any actual sense of this 
file.

So there is a bit of work to figure out the feasibility of doing this without 
being forced back into COM.

A possible fall-back option is to use the WS approach to pass short commands 
and then netcdf to pass data. In fact arguably thats the simplest way to 
proceed. You would just need some basic Fortran wrapper for passing commands 
such as the name of the netcdf communication file(s) to be used for subsequent 
transfers, and commands to trigger looking into the communication file(s).

The feasibility of this approach can be investigated using ASCII files - as 
long as you can get RFortran to work with WS+ASCII files you can get it to work 
with WS+netCDF.

cheers,
d

Original comment by dmitri.k...@gmail.com on 10 Jan 2013 at 10:14