On Fri, 13 Jan 2017, Sven Schreiber wrote:
Am 11.01.2017 um 23:01 schrieb Allin Cottrell:
> On Wed, 11 Jan 2017, Sven Schreiber wrote:
>
>> Am 11.01.2017 um 07:51 schrieb Sven Schreiber:
>>> Am 10.01.2017 um 21:27 schrieb Allin Cottrell:
>>>> I'm attaching a variant of your script which permits comparison with
>>>> MPI.
>>>
>>> Thanks, I will take a look.
OK, the attached uses MPI in the way that you suggested first, but still uses
different temp files for each of the parallel thingies. Works for me, and I
must say I already quite like its potential.
Glad you like it.
> Here's an update, now that bundles can be passed via MPI. See
what you
> think.
It's great to be able to pass bundles around. However, I still don't get how
the bundles (array) can be injected into the mpi block, in your example
you're constructing them on the fly within the block (your whole script being
the block here, obviously).
Why do you need them to be injected? That is, why not just do
everything "inside" MPI? (You can wrap my whole script in "mpi",
"end mpi" and run it in the GUI if you wish.) If, once the dust has
settled, you want to inspect result-bundles in the GUI, then you
could use bwrite to write them to disk (inside MPI) and bread (after
MPI) to pull them back. (BTW, maybe awrite and aread for arrays
would be nice to have?)
A couple of quick comments:
1) You don't need the "stillworking" apparatus with MPI. All the
relevant data-transfer functions are "blocking". This means that
while you might have got stillworking == 1 in the original version
of your script (one or more processes not finished yet), it can't
happen under MPI: either (a) you have all the results or (b) one or
more of the processes has failed in some way and therefore the whole
MPI section has automatically errored out or (c) the MPI section is
still running so the "stillworking" check is not reached yet.
2) I think you may find it's much nicer if you can put the common
working code block into the MPI section. That way you just have to
write hansl, not squirt it though printf as in
printf "printf \"Where TF am I?\\n\"\n"
There's some of that sort of thing in gretl_foreign.c (generating
startup code for Octave, R, etc.), and it was not much fun to write!
Allin