Hi,
A possibility could be to create say /dev/null13 and /dev/null14 and
assign 13 and 14 to them in the open statement.
See "man null" or "man mknod".
Bye. Roberto
On Thu, 25 Mar 2004, Hwanho Kim wrote:
> It is about Fortran (ifc compiler and lam-MPI) Redhat Linux 8 or 9
> I am trying to use the file /dev/null as many times as possible. Current
> fortran routines open several files to read and/or write. Especially, for
> the files to be opened for write, I do not want for slave nodes to write
> data to the same files which have assigned with unit numbers. That is,
> openning/redirecting those files for write to the file '/dev/null' more
> than once in a routine or in many routines with different unit numbers
> cause problems in fortran:
>
> For example,
> if (my_id .eq. 0) then
> open(13, file='abc.dat', .......)
> open(14, file='xyz.dat', .......)
> else
> open(13, file='/dev/null', .......)
> open(14, file='/dev/null', .......)
> endif
>
> The reason I am doing the way above is that so many routines(hundreds)
> have been written with the following writestatements (thousand times):
>
> write(13, .......)
> write(14, .......) (most files should be opened entire run time)
>
> and I do not want to rewrite them all in the following way,
>
> if (my_id .eq. 0) then
> write(13, .......)
> write(14, .......)
> endif
>
> Does anyone know about a better solution to handle this sort of issues? By
> the way, IRIX compilers do not cause such problems openning '/dev/null'
> file several times with different unit numbers without closing the
> '/dev/null' file.
>
> Thanks,
> Hwanho Kim
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>
|