question about using same unit number to open different files on a dual processor computer.

Martin Siegert siegert at sfu.ca
Wed Jun 12 22:52:18 EDT 2002


Hi,

On Wed, Jun 12, 2002 at 04:34:14PM -0500, gli at chem.wisc.edu wrote:
> Hi, everybody,
> i use MPICH to make a parallel program on one dual-processor computer.
> so there should be two processes on this computer i can use. id=0,1
> i want to open different files for different id processes but using the 
> same unit number, is it possible?
> if yes, how i can do it?
> 
> thanks very much!!

Since you are refering to "unit numbers" I am guessing that your program
is written in Fortran. In that case something like

if (id == 0) then
   open(8,file='file0')
else
   open(8,file='file1')
endif

should do the trick.
I hope this helps.

Cheers,
Martin

========================================================================
Martin Siegert
Academic Computing Services                        phone: (604) 291-4691
Simon Fraser University                            fax:   (604) 291-4242
Burnaby, British Columbia                          email: siegert at sfu.ca
Canada  V5A 1S6
========================================================================
_______________________________________________
Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf



More information about the Beowulf mailing list