On Fri, 27 Dec 2019, Sven Schreiber wrote:
Am 26.12.2019 um 21:00 schrieb Sven Schreiber:
> Hi,
> another MPI question or issue: Is the relatively new 'feval' meta-style
> function supported inside MPI? (Of course using the --send-functions
> option.)
OK, I have established that it does work when a native (gretl builtin)
function is called. However, with a user-defined function it seems to
fail, as in this example:
<hansl>
nproc = 1
function scalar mpifevaltest(void)
return $pi
end function
mpi --send-functions
scalar x = feval("mpifevaltest")
mpireduce(&x, "sum")
if $mpirank==0
print x
endif
end mpi --np=nproc
</hansl>
The fail was not due to the fact that mpifevaltest() is
user-defined, but just that it takes no arguments. (And it would
fail under feval for that reason even in regular, non-MPI usage.)
That's now fixed in git: feval can handle functions without any
parameters.
Allin