Title: | Digital Fortran |
Notice: | Read notes 1.* for important information |
Moderator: | QUARK::LIONEL |
Created: | Thu Jun 01 1995 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 1333 |
Total number of notes: | 6734 |
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
1146.1 | QUARK::LIONEL | Free advice is worth every cent | Thu Jan 23 1997 15:06 | 10 | |
1146.2 | SEAWLF::FOHLIN | Thu Jan 23 1997 16:52 | 7 | ||
1146.3 | QUARK::LIONEL | Free advice is worth every cent | Thu Jan 23 1997 21:26 | 8 | |
1146.4 | SEAWLF::FOHLIN | Fri Jan 24 1997 00:34 | 5 | ||
Why use implied DO loops? Why not just set the recl = array size and read one record? Jim Fohlin | |||||
1146.5 | QUARK::LIONEL | Free advice is worth every cent | Fri Jan 24 1997 09:18 | 4 | |
You can do that too, though I'm not 100% sure the RTL can handle reading a 3GB array in one swell foop. Steve | |||||
1146.6 | Aren't two copies implied when using the Fortran RTL? | SUBPAC::FARICELLI | Fri Jan 24 1997 12:59 | 8 | |
Won't using the Fortran RTL imply two copies: one from the Unix IO subsystem to the RTL internal buffer, and then from the RTL buffer to to the target array? Sounds like mmap() would be your best bet, if it were allowed. -- John Faricelli | |||||
1146.7 | SEAWLF::FOHLIN | Mon Jan 27 1997 01:29 | 15 | ||
Could someone confirm that two copies are required? If they are, that could help explain the comments I have heard about slow Fortran I/O. mmap() is a good idea. I have used it for other benchmarks. But the current RFP requires that I only use Fortran and COTS/GOTS/PD libraries. So unless the mmap() Fortran binding is generally available, I can't use it. Nor can I use my open/close/read/write Fortran bindings. How do I contribute code that would appear as an unsupported subset as part of the Fortran kit? That would solve the problem for this RFP and maybe help other people. Jim Fohlin | |||||
1146.8 | Might get by with just a jacket to read/write | SUBPAC::FARICELLI | Mon Jan 27 1997 08:17 | 11 | |
You can get the underlying file descriptor that corresponds to a Fortran IO unit number via getfd(3f). That should avoid needing a jacket to open(2)/close(2). You'd just need a jacket to read(2)/write(2). At one point, there was/is an IEEE standard for interfaces to POSIX from Fortran. If they had interfaces to read(2)/write(2), then you might want to use their calling semantics. -- John Faricelli | |||||
1146.9 | posix fortran bindings | SEAWLF::FOHLIN | Tue Jan 28 1997 23:51 | 5 | |
Could you please provide more info on the IEEE/POSIX Fortran bindings? Does Digital have an implementation? Is it publically available? Jim Fohlin | |||||
1146.10 | QUARK::LIONEL | Free advice is worth every cent | Wed Jan 29 1997 10:50 | 3 | |
We don't have an implementation. Almost noone uses them. Steve | |||||
1146.11 | Posix binding for read()/write() | SUBPAC::FARICELLI | Wed Jan 29 1997 11:18 | 32 | |
The relevant Posix standard for f77 is P1003.9, dated 1992. According to a Digital internal chart, the f90 standard was withdrawn. According to an old draft, the bindings for read(2) and write(2) are: PFXREAD(ifildes, buf, nbyte, nread, ierror) integer ifildes ! file descriptor character buf(*) ! character buffer integer nbyte ! bytes to read integer nread ! bytes actually read integer ierror ! error condition, zero if successful PFXWRITE(ifildes, buf, nbyte, nwritten, ierror) integer ifildes ! file descriptor character buf(*) ! character buffer integer nbyte ! bytes to write integer nwritten ! bytes actually written integer ierror ! error condition, zero if successful You might do an external AltaVista search, some place like NIST might have done a PD implementation of this binding... Anyway, from what Steve indicates, sounds like not many vendors bought into providing this binding. -- John Faricelli | |||||
1146.12 | Example of Fortran read(2)/write(2) without bindings | SUBPAC::FARICELLI | Thu Jan 30 1997 08:53 | 65 | |
Come to think of it, you don't need extra bindings at all to call read(2) or write(2). Just use the cdec$ alias avoid the trailing underscores, and %val() where needed. Here are some examples, would they be "OK" since they only use Fortran (albeit, using nonstandard extensions to Fortran, but your bindings would be nonstandard as well). -- John Faricelli ** f77_write.f implicit none integer getfd, fd integer IARRAY parameter (IARRAY=10) integer ibuf(IARRAY), i, nbytes, nwritten, write c cdec$ alias write,"write" c do i=1,IARRAY ibuf(i) = i end do c open(unit=10,file='bintest',status='unknown') fd = getfd(10) nbytes = IARRAY*sizeof(i) nwritten = write(%val(fd),ibuf,%val(nbytes)) close(unit=10) c write(6,*) 'Number of bytes written: ', nwritten c end ** f77_read.f implicit none integer getfd, fd integer IARRAY parameter (IARRAY=10) integer ibuf(IARRAY), i, nbytes, nread, read c cdec$ alias read,"read" c open(unit=10,file='bintest',status='unknown') fd = getfd(10) nbytes = IARRAY*sizeof(i) nread = read(%val(fd),ibuf,%val(nbytes)) close(unit=10) c write(6,*) 'Number of bytes read: ', nread c do i=1,IARRAY write(6,*) ibuf(i) end do c end |