[SAGA-RG] Fwd (ceriel at cs.vu.nl): [saga-cvs] "SAGA-RG/SAGA-Bindings/Java/OGF/src/org/ogf/saga/file FileFactory.java"

Andre Merzky andre at merzky.net
Thu Jan 24 10:40:01 CST 2008


Hi Ceriel,

Quoting [Ceriel Jacobs] (Jan 24 2008):
> 
> Hi,
> 
> I'm really, really sorry ...

You better are!! ;-)


> I have some more remarks now on the iovec specifications and the
> readv and writev specifications: this all concerns the "offset" field.
> 
> - the set_offset method does not consider the current value of len_in.
>    Is it not an error if size >= 0 && len_in + offset > size?
>    Maybe only if the buffer is not implementation-managed?
> - the set_len_in method does not consider the current value of offset.
>    Is it not an error if size >= 0 && len_in + offset > size?
>    Maybe only if the buffer is not implementation-managed?
> - the readv notes mention that if no len_in is specified, the buffer size
>    is used as len_in. But what if offset > 0?
> - the above remark also holds for writev.

Yes - spec mostly ignores out-of-bound errors.

> As far as I am concerned, the "offset" field can completely be removed from the specs.
> POSIX iovec does not have an offset field, and I don't know why it
> made it to the SAGA specs.

To simplify the reuse of memory segments w/o the need for
pointer arythmetics:

  char mem[1024];
  saga::iovec iov_1 (mem, 1024,   0, 512);
  saga::iovec iov_2 (mem, 1024, 512, 512);

  std::vector <saga::iovec> iovecs;

  iovecs.push_back (iov_1);
  iovecs.push_back (iov_2);

  file.readv (iovecs);

without offset that woyuld work as well, as:

  char mem[1024];
  saga::iovec iov_1 (mem      , 512, 512);
  saga::iovec iov_2 (mem + 512, 512, 512);

  std::vector <saga::iovec> iovecs;

  iovecs.push_back (iov_1);
  iovecs.push_back (iov_2);

  file.readv (iovecs);

although size and len_in are somehwat redundant here.

If offsets are really needed can certainly be disputed.  In
C++, where pointer arithmetic is easy, one could certainly
do without.  I'd actually thought that it helps in Java.
Ah, well... ;-)

> Cheers,		Ceriel
> 
> P.S. Sorry that I keep on having remarks, but these are things that
> come up while actually implementing it. Apparently, just reading the
> specs is not good enough.

Yep, I guess so.  We are grateful for the comments: much
better to have fixes and errata than a faulty spec!  Thanks!

Cheers, Andre.


> Thilo Kielmann wrote:
> > Thank you, Ceriel! ;-)
> > 
> > Thilo
> > 
> > On Thu, Jan 24, 2008 at 03:42:14PM +0100, Andre Merzky wrote:
> >> From: Andre Merzky <andre at merzky.net>
> >> To: Thilo Kielmann <kielmann at cs.vu.nl>
> >> Cc: saga-rg at ogf.org
> >> Subject: Re: [SAGA-RG] Fwd (ceriel at cs.vu.nl): [saga-cvs]
> >> 	"SAGA-RG/SAGA-Bindings/Java/OGF/src/org/ogf/saga/file
> >> 	FileFactory.java"
> >>
> >> Yep, thats an error - all c'tors should be able to throe
> >> NotImplemented.
> >>
> >> So, thats a good occasion to test the errata procedure :-)
> >>
> >> Thanks, Andre.
> >>
> >>
> >> Quoting [Thilo Kielmann] (Jan 24 2008):
> >>> From: Thilo Kielmann <kielmann at cs.vu.nl>
> >>> To: saga-rg at ogf.org
> >>> Subject: [SAGA-RG] Fwd (ceriel at cs.vu.nl): [saga-cvs]
> >>> 	"SAGA-RG/SAGA-Bindings/Java/OGF/src/org/ogf/saga/file
> >>> 	FileFactory.java"
> >>>
> >>> Hmm,
> >>>
> >>> do we now have the first item for the "errata" document? ;-)
> >>>
> >>>
> >>> Thilo
> >>>
> >>> ----- Forwarded message from Ceriel Jacobs <ceriel at cs.vu.nl> -----
> >>>
> >>>> To: saga-cvs at cct.lsu.edu
> >>>> From: Ceriel Jacobs <ceriel at cs.vu.nl>
> >>>> Subject: [saga-cvs] "SAGA-RG/SAGA-Bindings/Java/OGF/src/org/ogf/saga/file
> >>>> 	FileFactory.java"
> >>>>
> >>>> Update of /projects/SAGA-RG/SAGA-Bindings/Java/OGF/src/org/ogf/saga/file
> >>>> In directory asylum.cct.lsu.edu:/tmp/cvs-serv30810/src/org/ogf/saga/file
> >>>>
> >>>> Modified Files:
> >>>> 	FileFactory.java 
> >>>> Log Message:
> >>>> Inconsistency in the SAGA specification: Buffer constructor throws
> >>>> NotImplemented, but IOVec does'nt? In the Java version, it does now!
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> saga-cvs mailing list
> >>>> saga-cvs at cct.lsu.edu
> >>>> https://mail.cct.lsu.edu/mailman/listinfo/saga-cvs
> >>> ----- End forwarded message -----
> >> -- 
> >> No trees were destroyed in the sending of this message, however,
> >> a significant number of electrons were terribly inconvenienced.
-- 
No trees were destroyed in the sending of this message, however,
a significant number of electrons were terribly inconvenienced.


More information about the saga-rg mailing list