Re: Writing output files to memory



justabeginner <nom_de_plume79@xxxxxxxxxxx> wrote:
> Hi, is it possible for me to get Fortran to write its output files to
> memory instead of to a file on the hard drive? If so, what is the
> command I should use so I can look it up? I am using SuSE 9.2 with the
> Intel Fortran compiler.

This is not a Fortran question but: probably yes, because your
operating system has a "tmpfs" filesystem. You can create something
that looks like a directory but is kept in memory (or swap, if it
gets too big). You need the root password for that. If you run
your Fortran program in this directory it will probably save its
files there with no change. Of course the tmpfs is lost if you
shut down.

Google for "tmpfs howto" and you will find links like this one:
http://www-106.ibm.com/developerworks/library/l-fs3.html

Also, check whether your computer already has a tmpfs setup.
On my Gentoo laptop, the "mount" command shows that /dev/shm
is a tmpfs.


> Some people told me I need to write to
> /dev/null, but they weren't sure how to proceed beyond that.

That's to throw things away.


> If I do get Fortran to write to memory, I will then require a 3rd
> party program (I have no access to this program's source code) to
> locate the output file in memory so that it can read/write to it. How
> do I know what memory address Fortran has written to?

They're in memory, but they look like files. Just don't poweroff!


> The next step for me will be to send these output files from Fortran
> over a distributed computing network. I suppose it is unavoidable that
> I will need to write the files to the hard disks then?

Again, that's not a Fortran question. Most people use NFS to share files
across computational nodes.


--
pa at panix dot com
.



Relevant Pages

  • Re: allocatable non-dummy local variables and pointers to them
    ... must release the memory used by a process when the process terminates. ... I do remember that Fortran Powerstation 4.0 did have a memory leak ... digging to find whether it claims to be an f90 or f95 compiler. ... compiler has to behave for allocatables that get undefined allocation ...
    (comp.lang.fortran)
  • Re: Handling large datasets in Fortran
    ... Obviously, when you have too much data to fit in memory, you have to ... I have read that Fortran has exceptional abilities in the ... I then need to retrieve comparisons for a set of ... and subset the internal file using intrisics like WHERE and PACK? ...
    (comp.lang.fortran)
  • Re: segmentation fault on calloc
    ... It was written in Fortran and later translated by someone in C. ... segmentation comes in vcalc when it is called by my fortran sub. ... of calloc, it failed... ... Maybe I am calling my added function in a part that some memory have been ...
    (comp.unix.programmer)
  • Re: recursion, stack, fortran
    ... technology has gone that I have just purchased a 4MByte memory stick ... One thing I found on arrival here in NM was an old IBM fortran manual. ... it was a Pound sign ... Dave Flower ...
    (comp.lang.fortran)
  • Re: Writing output files to memory
    ... your data lives in memory. ... > Intel Fortran compiler. ... > party program to ... won't see any difference between a ramdisk and a normal disk. ...
    (comp.lang.fortran)