Am 13.01.2017 um 20:48 schrieb Allin Cottrell:
On Fri, 13 Jan 2017, Sven Schreiber wrote:
> 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?
Because I want to encapsulate the stuff in functions, to do something
like this:
<hansl-future>
include SVAR.gfn
include gretlparallel.gfn # doesn't exist yet
bundles bb = defarray( setupSVAR(...longrunrestr...), \
setupSVAR(...shortrunrest...) )
string content = "SVAR_estimate(&mybundle)"
content ~= sprintf("\nSVAR_boot(&mybundle)\n")
bundles bbout = gretlparallel(content, bb, "mybundle")
</hansl-future>
I'm not saying it is impossible to achieve this result without temp
files by making the whole thing into a big mpi block, but my point is
that in my example the user doesn't have to know anything about MPI.
(Well, apart from the fact that she needs to worry about installation
and adjusting gretl's settings.) It would just "magically" work in
parallel. I find this very attractive.
(BTW, I guess the MPI setup also supports accessing the same libraries
on the system concurrently from the different workers/threads, including
the R lib through 'foreign'?)
A couple of quick comments:
1) You don't need the "stillworking" apparatus with MPI.
Right, that's zombie code portions.
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
Yes, but: First it's already done, and not more needed. Also, again I
don't see how to inject the strings into the mpi block if that block is
hidden away from the user as pointed out above.
thanks,
sven