Re: Parallel package suggestion

Olaf Till <[email protected]> Fri, 12 Feb 2021 15:28:43 +0100
Newsgroups gmane.comp.gnu.octave.maintainers
Message-ID <20210212142843.GA30105@till>
On Wed, Feb 10, 2021 at 07:53:36PM +0100, Olaf Till wrote:
> On Sat, Feb 06, 2021 at 12:46:40PM -0600, vrozos wrote:
> > Regarding Parallel package [1], I have a suggestion.  On my understanding
> > (from applications on a single machine), Parallel starts Octave sub-engines.
> > When the whole job is finished, the sub-engines do not die. This can create
> > problems in cases where a kind of re-initialization is needed.
> > 
> > Consider this case. I am using Parallel along with the expansion of the
> > Genetic Algorithm package for GNU Octave that supports parallelization and
> > bounds [2]. After finishing the first optimization, I want to change the
> > loss-function. In this case, it seems that the sub-engines are not informed
> > about the change. They keep using the version of the loss-function they
> > first encountered.

Thinking about this -- probably the sub-engine Octaves should see such
a change, just as the main Octave session should see it, without
re-initialization. You could test if the main Octave session sees the
change.

Olaf

> > I would suggest adding a function to Parallel package that would perform
> > some kind of re-initialization of the created sub-engines, or at least kill
> > them.
> 
> But there is such a function:
> 
> https://octave.sourceforge.io/parallel/package_doc/parcellfun_005fset_005fnproc.html#XREFparcellfun_005fset_005fnproc
> 
> Olaf
> 
> -- 
> public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net



-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEPFKvIAg6x7IzHVgawOS+xer+BZEFAmAmkJYACgkQwOS+xer+
BZFg0xAAnutpNpx+tcy8XlcjWLB5IPLw5mqqFKKa268TrfRMcjNEkwYbCM9BXCB7
scgnsR6FHsApGjdstDipi82eq/7s/eT+gpMdbv7cq8cJQpN2vX90F/pVqag1ftuc
P2WBng4GwqBLioe1zPCeuiS+Z4eN03jfl0lOWwnm0kHwhFr0weUWLqnCe5NBAtFQ
x53FGmPu0SP0hHfdG76/oLX6mP8ja+cj+7HuptjLLNUGnZTuxm3flP/vVAq3RMKI
YOfE/r+cKu8CTLlwfg3cjbIdOvvuoTxsQuJYK7jDhnoaRXK8kuiOmYO1kYxgGJgS
N/Q1f4G7EIXJgjDLGPbS33R/L4jA6AaVqgTxe0O+ato4ZieGVJ/mgYgtJnjVyZ13
3pTLKst8hVnSV0UVK/8/S2+CWRY8p91fc+D+TYMtGVxFozySIg6hGvNR3qqHZjaE
GyZxpMVQwcBW5/mKcULHFAX2ERcjTuh+/cJuO72KUodUPJvq+j/TUAYFs5NhkBpW
IaZw4A+cXh1WO9q7PEPZIDqhU35KMx9yImQ7X0qARRp3m8Pls66kAmA7ZfQsF9j7
Fa9fy2T80lNolD8Km7vKdo5aN7TneNASG1pAdKLh5rAbVSZPdtMKW5rJImFTk/GK
tnI9i9DiqCAUvLR+dE9xwwcz5vpCvAZNy4pfde/9I0bUWQFhAzw=
=JIWb
-----END PGP SIGNATURE-----