Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Q: VMS FORTRAN LUN to channel mapping
@ 1998-12-18  5:00 miim
  1998-12-21  5:00 ` Steve Lionel
  0 siblings, 1 reply; 4+ messages in thread
From: miim @ 1998-12-18  5:00 UTC (permalink / raw)




I have quite a pile of RSX FORTRAN undergoing conversion to
Alpha OpenVMS.  Much of it is subroutines which accept a
Fortran LUN as a parameter, then do a QIO to the associated
LUN.

This worked great under RSX, but under VMS an HLL LUN is not
the same thing as a channel, and QIOs are done to channels.

Does anyone know how to peek into the Fortran OTS LUN to
channel mapping mechanism to get this information?

It has been suggested to do useropens, and then look in the
FAB.  This is quite a lot of work to convert each program,
and we don't want to open files; just change CALL ASSIGNs
to STATUS = SYS$ASSIGN ...

/s Bruce Mitchell
   miim - "at"               Editor Emeritus
   cvfn                      "The Multi-Tasker"
   dot org                   The once and future DECUS RSX SIG

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: VMS FORTRAN LUN to channel mapping
  1998-12-18  5:00 Q: VMS FORTRAN LUN to channel mapping miim
@ 1998-12-21  5:00 ` Steve Lionel
  1998-12-21  5:00   ` John Laird
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Lionel @ 1998-12-21  5:00 UTC (permalink / raw)


<miim@cvfn.org> wrote in message news:75eou2$qif$1@nnrp1.dejanews.com...

>I have quite a pile of RSX FORTRAN undergoing conversion to
>Alpha OpenVMS.  Much of it is subroutines which accept a
>Fortran LUN as a parameter, then do a QIO to the associated
>LUN.
>
>This worked great under RSX, but under VMS an HLL LUN is not
>the same thing as a channel, and QIOs are done to channels.
>
>Does anyone know how to peek into the Fortran OTS LUN to
>channel mapping mechanism to get this information?

You couldn't use it even if you got it - the channel is owned by RMS in exec
mode.

The way to do what you want is to set the FAB$V_UFO bit in the FAB before
the OPEN is done (you can do this in a USEROPEN routine) and then the
channel number will be in FAB$W_STV after the OPEN completes.  You can get a
pointer to the FAB by calling FOR$RAB and following RAB$L_FAB.  Here's an
off-the-cuff example:

    EXTERNAL UOPN
    OPEN (UNIT=1,FILE='file.dat',STATUS='OLD',USEROPEN=UOPN)
    ...
    INTEGER*4 FUNCTION UOPN (FAB,RAB,LUN)
    INCLUDE '($FABDEF)'
    INCLUDE '($RABDEF)'
    INCLUDE '($SYSSRVNAM)'
    RECORD /FABDEF/ FAB
    RECORD /RABDEF/ RAB
    INTEGER*4 LUN

    FAB.FAB$L_FOP = FAB.FAB$L_FOP .OR. FAB$M_UFO
    UOPN = SYS$OPEN (FAB)
    RETURN
    END

    ! Routine to return channel number for a UFO'd LUN
    INTEGER*2 FUNCTION GETCHAN (LUN)
    INCLUDE '($FABDEF)'
    INCLUDE '($RABDEF)'
    RECORD /FABDEF/ FAB
    RECORD /RABDEF/ RAB
    POINTER (P_FAB, FAB)
    POINTER (P_RAB, RAB)
    INTEGER*4 FOR$RAB, LUN

    P_RAB = FOR$RAB (LUN)
    IF (P_RAB .EQ. 0) THEN
      GETCHAN = -1 ! No channel available
      RETURN
      END IF
    P_FAB = RAB.RAB$L_FAB
    GETCHAN = FAB.FAB$W_STV
    RETURN
    END


Now... do you REALLY need to do this?  What kind of "file" are you doing
QIOs to and what kind of QIOs?

Steve Lionel                    mailto:Steve.Lionel@digital.com
DIGITAL Fortran Development     http://www.digital.com/info/slionel.html
Compaq Computer Corporation
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698           "Free advice is worth every cent"

DIGITAL Fortran web site: http://www.digital.com/fortran









^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: VMS FORTRAN LUN to channel mapping
  1998-12-21  5:00 ` Steve Lionel
@ 1998-12-21  5:00   ` John Laird
  1998-12-21  5:00     ` Steve Lionel
  0 siblings, 1 reply; 4+ messages in thread
From: John Laird @ 1998-12-21  5:00 UTC (permalink / raw)


In article <75lqh3$fjl@usenet.pa.dec.com>, "Steve Lionel" <Steve.Lionel@digital.com> writes:
> <miim@cvfn.org> wrote in message news:75eou2$qif$1@nnrp1.dejanews.com...
> 
>>I have quite a pile of RSX FORTRAN undergoing conversion to
>>Alpha OpenVMS.  Much of it is subroutines which accept a
>>Fortran LUN as a parameter, then do a QIO to the associated
>>LUN.
>>
>>This worked great under RSX, but under VMS an HLL LUN is not
>>the same thing as a channel, and QIOs are done to channels.
>>
>>Does anyone know how to peek into the Fortran OTS LUN to
>>channel mapping mechanism to get this information?
> 
> You couldn't use it even if you got it - the channel is owned by RMS in exec
> mode.
>(example snipped)
>
> Now... do you REALLY need to do this?  What kind of "file" are you doing
> QIOs to and what kind of QIOs?

I had to resort to doing this myself, back on a Pro/350 under P/OS (essentially
RSX11M+, as near as makes no difference).  If I recall correctly, either the
overhead in the Fortran I/O library was too high, or there was no buffering.
The files were simple fixed-length record "direct access" files, accessed
directly.  I implemented a simple 1-block buffer and used $QIOs for every
read/write operation barring those writes that extended the file.  Program
performance improved dramatically.

-- 
John Laird (john@yrl.co.uk)           "I have discovered a truly elegant sig,
Yezerski Roper Ltd                    sadly there is no room here to show it."
http://www.yrl.co.uk



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: VMS FORTRAN LUN to channel mapping
  1998-12-21  5:00   ` John Laird
@ 1998-12-21  5:00     ` Steve Lionel
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Lionel @ 1998-12-21  5:00 UTC (permalink / raw)


John Laird <john@yrl.co.uk> wrote in message news:+VIf5Vgj43A$@yrl.co.uk...
>In article <75lqh3$fjl@usenet.pa.dec.com>, "Steve Lionel"
>> Now... do you REALLY need to do this?  What kind of "file" are you doing
>> QIOs to and what kind of QIOs?
>
>I had to resort to doing this myself, back on a Pro/350 under P/OS
(essentially
>RSX11M+, as near as makes no difference).  If I recall correctly, either
the
>overhead in the Fortran I/O library was too high, or there was no
buffering.
>The files were simple fixed-length record "direct access" files, accessed
>directly.  I implemented a simple 1-block buffer and used $QIOs for every
>read/write operation barring those writes that extended the file.  Program
>performance improved dramatically.

I suggest you try it the "straight" way.  You may be pleasantly surprised.

If you want, you can do RMS block I/O - there's an example in the Fortran
User manual.

Steve Lionel                    mailto:Steve.Lionel@digital.com
DIGITAL Fortran Development     http://www.digital.com/info/slionel.html
Compaq Computer Corporation
110 Spit Brook Road, ZKO2-3/N30
Nashua, NH 03062-2698           "Free advice is worth every cent"

DIGITAL Fortran web site: http://www.digital.com/fortran







^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-12-21  5:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-12-18  5:00 Q: VMS FORTRAN LUN to channel mapping miim
1998-12-21  5:00 ` Steve Lionel
1998-12-21  5:00   ` John Laird
1998-12-21  5:00     ` Steve Lionel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox