help-octave
[Top][All Lists]
Advanced

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

Re: clobbered (and parallelized Octave)


From: Andy Jacobson
Subject: Re: clobbered (and parallelized Octave)
Date: 02 Nov 2000 18:07:11 +0100
User-agent: Gnus/5.0806 (Gnus v5.8.6) Emacs/20.7

>>>>> "John" == John W Eaton <address@hidden> writes:

    John> After commenting out the <STUFF DELETED> lines in your
    John> example, it compiled fine on my system (gcc 2.95.2, Debian
    John> GNU/Linux).  Can you please provide a complete example that
    John> demonstrates the problem?  The details that you omitted are
    John> probably important...

Good idea, I should have thought of trying to compile that skeletal
fraction myself.  This led me to discover that it is the presence of
the following command which causes these compiler errors:

      F77_XFCN (dgenunf, DGENUNF, (0.0, 1.0, ranval));

My includes are:

#include <octave/pager.h>
#include <iostream.h>
#include <octave/oct.h>
#include <octave/pt-fvc.h>
#include <math.h>
#include <octave/f77-fcn.h>

I peaked under the hood of f77-fcn.h and I suppose this has something
to do with the setjmp call, but I've never worked with that before.
Anyway, I suppose the right question to ask is whether there might be
a different, standardized way of accessing Fortran routines from an
.oct file?

Different topic:

The parallelized Octave is coming along really well.  I got the SPMD
system running, and I am in the middle of implementing a way to send
octave_value objects back and forth between processes.  

One of the most frustrating things about MPI is that in order to send
structures or derived types, you have to go through a laborious and
error-prone procedure of defining an "MPI datatype", by specifying
each member's physical alignment within the structure.  Once this is
done by both sender and receiver, instances of the type can be sent to
and fro in convenient ways.  This is bad enough under C for
structures...defining C++ objects as MPI datatypes is a real bear.
There are some folks working on automating this, but their code seems
to be either experimental or tied to a particular MPI implementation.

All is not lost, however.  I think I can use the functions in
load-save.cc to just read/write octave_values to a simple buffer.
What I'm doing is setting up an ostream to write to a char* buffer.
(I sure hope that's what the functions defined in strstream.h are
for.)  I would like to call the do_save (or perhaps save_binary_data)
function with that ostream:

  symbol_record *sr=curr_sym_tab->lookup (variable_name,0,0);

  char buf[expected_length];
  
  strstreambuf ssbuf(buf,expected_length);
  ostream os(&ssbuf,NULL);

  do_save(os,sr,LS_BINARY,0);

And then transmit the buffer contents to a receiving member, which
will invert the process, using an istream tied to the received buffer.
I find it very appealing to use predefined interfaces in this manner,
because the system becomes very robust.

So some test code to do this is in place right now, but I can't get it
to link.  This I don't understand: if I give a prototype in my .cc
file, and a function which matches that prototype is in
liboctinterp.a, why can't I link to it?  And where IS the prototype
for, e.g., do_save() anyway?

The compile looks like the following (Debian GNU/Linux, gcc 2.95.2,
2.1.31 codebase).  I added -DPARALLEL and some -I and -L, -l stuff,
but that's it.  The call in question is in octave-mpi-client.o:

octave.o octave-mpi-client.o builtins.o ops.o ../libcruft/blas-xtra/xerbla.o  
balance.o  besselj.o  betainc.o  chol.o  colloc.o  dassl.o  det.o  eig.o  
expm.o  fft.o  fft2.o  filter.o  find.o  fsolve.o  gammainc.o  getgrent.o  
getpwent.o  getrusage.o  givens.o  hess.o  ifft.o  ifft2.o  inv.o  log.o  
lpsolve.o  lsode.o  lu.o  minmax.o  pinv.o  qr.o  quad.o  qz.o  rand.o  schur.o 
 sort.o  svd.o  syl.o  time.o ŠÜ
-L../liboctave -L../libcruft -L../src -Xlinker -rpath -Xlinker 
/opt/local/lib/octave-2.1.31 ŠÜ
../src/liboctinterp.a ../liboctave/liboctave.a  ../libcruft/libcruft.a  
../readline/libreadline.a ../kpathsea/libkpathsea.a ../glob/glob.o 
../glob/fnmatch.o  ŠÜ
 -lncurses  -ldl -lm  -lg2c -lm -L/usr/lib/gcc-lib/i386-linux/2.95.2 -lm 
-L/usr/local/lam/lib -lmpi -ltstdio -ltrillium -largs -lt
octave-mpi-client.o: In function `mpi_take_input_from_server(void)':
/home/jacobson/packages/octave-2.1.31/src/octave-mpi-client.cc:158: undefined 
reference to `do_load(istream &, basic_string<char, string_char_traits<char>, 
__default_alloc_template<true, 0> > const &, bool, load_save_format, 
oct_mach_info::float_format, bool, bool, bool, bool, string_vector const &, 
int, int, int)'
collect2: ld returned 1 exit status


Sorry for the lengthiness,

        Andy

-- 
address@hidden



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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