octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MPI and private methods in octave::load_save_system


From: kingcrimson
Subject: Re: MPI and private methods in octave::load_save_system
Date: Sat, 16 Feb 2019 09:13:25 +0100

Hi John,

Thanks for looking into this.

> On 15 Feb 2019, at 23:29, John W. Eaton <address@hidden> wrote:
> 
> I'd be willing to make minor changes on stable (moving a declaration from 
> private to public, for example) if necessary.  As we discussed on IRC, I was 
> considering making more extensive changes to avoid making some messy 
> interfaces public again, but I'm not sure that we should do that.  We were 
> talking about providing functions like
> 
>  octave_value load_save_system::read_value (std::istream& is, std::string& 
> name, bool& global);
> 
> and
> 
>  void load_save_system::write_value (std::ostream& os, const octave_value& 
> val, const std::string& name, bool global, const load_save_format& fmt, bool 
> save_as_floats);
> 
> but when I started looking at what would be required to extract the the 
> read_value function from the load_vars function it was not as simple as I 
> assumed.  Some of the functions that ultimately write the data require extra 
> info that wouldn't be in the above interface.  We should probably clean all 
> of that up and use consistent interfaces.  But I think the changes are too 
> much to make just before the release.

I totally agree this is not a good moment to make invasive changes, I was 
actually going to say son IRC before my web client stopped working ;)

> Also on IRC, you said the functions that are required are
> 
>  write_header
>  save_binary_data
>  read_binary_file_header
>  read_binary_data

Yes, I thank that is all that is needed in the MPI package.

It is also an useful functionality to be able to read and write values to file 
without using the interpreter workspace, 
in order to import/export data in Octave format from independent applications. 
I use this often in standalone C++ or F90
applications in order to do pre- and post-processing with Octave while 
computation is done elsewhere.

I once documented how to do this here : https://wiki.octave.org/Fortran

That example doesn't work now, but it is quite easy to update. To make this 
work, 
the do_load method also needs to be public.


> The save_binary_data and read_binary_data functions are public and declared 
> in ls-oct-binary.h.  If you know that the data on the stream is Octave binary 
> data using a particular float format, do you really need to read and write 
> the header, or can you omit that?  If you can omit it, then I don't think we 
> need to change anything before the release.  If you do need it, what is it 
> used for?  If it really is necessary, then I would consider making those 
> functions public for this release.

I'm not sure whether they are actually needed, I'll look into this this evening.

> Longer term, however, I think it would be good to come up with better and 
> more consistent interfaces.

It would be great to have a stable and documented API for this.

> jwe

Thanks again,
c.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]