The question is: how does the commercial package provide its data?
If it writes files, it might bring a considerable speed-up to write these files not to a real hard disk, but to a RAM Disk. This should work without modifying the program.
You can call C code from Fortran, and you can interface C from Perl too, so you could also interface Fortran an Perl, but I don't see how that's going to help unless you can actually change the commercial package you're interfacing.
Perl 6 - links to (nearly) everything that is Perl 6.
| [reply] |
Dear moritz:
Thank you for your kind help. To write data both from the commerical package and my Fortran code to a RAM Disk is possible, but I don't know how to read the data from a RAM disk for a fortran code, which is embedded as a part of a PERL code.
Shin-Pon
| [reply] |
| [reply] |
Maybe there are modules available for that purpose: a quick search on CPAN gave me:
Fortran::Format for F77 format and
Fortran::F90Format for F90 I/O formatting. There are many more Fortran related modules however. You might be able to use them as building blocks to solve your problem or take a look at the source code for inspiration.
Maybe you should give some more (technical) details on how you envisage the interface to work.
HTH
Harry
| [reply] |
Dear Harry:
Thank you for your kind help, and I feel your comments will be very helpful for my case.
Best Regards,
Shin-Pon
| [reply] |
You don't say what your "commercial package" is, but if you haven't searched CPAN yet for modules that relate to that package, you should try that.
If there is a module that provides direct data i/o between a perl script and your commercial package -- or if that tool can be run via any sort of "inter-process communication" already supported by perl (cf. perlipc) -- you might be able to avoid some amount of disk i/o using a process that manages in-memory data transfer from one process to the other.
(Then again, the RAM-disk idea sounds like the easiest way to get a noticeable speed-up.) | [reply] |