help-octave
[Top][All Lists]
Advanced

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

Re: Paralleling in Octave


From: Benson Muite
Subject: Re: Paralleling in Octave
Date: Thu, 23 Apr 2020 13:49:32 +0300
User-agent: Cyrus-JMAP/3.3.0-dev0-351-g9981f4f-fmstable-20200421v1

On Thu, Apr 23, 2020, at 1:12 PM, Maria Jose Casas Serrano wrote:
Hi!

Oh, yes, of course! I hoped for a theoretical answer so, that’s why my code proposal was more pseudocode than an executable one. 
I hope that the attached files are more helpful now.






Parallelisation_test.m file is the main program. evaluationParallel_test.m is the piece of code that I’m interested on parallelise, keeping LsystemGeneratorNP_test.m and getAspectRatioNP_test.m files as sequential execution. `outputparam1` and `outputparam2` ought to be the same size of P.  Would it be possible? 


This is the output I’m getting: 

evaluationParallel: individual G++GG[G]
evaluationParallel: inputparam2 GG—G      <——— Error 1: Here there is the first error because this value ought to be a float defined in parallelisation_test.m file (targetaspectratio) instead of the second element of P set.
evaluationParallel: inputparam3 GG[G[GG]G[GG]G]    <——— Error 2: The same mistake as Error 1. This value ought to be a float defined in parallelisation_test.m file (branchingweight) instead of the third element of P set.
evaluationParallel: Building the phenotype of the individual G++GG[G]
candidate = +
height =  16
width =  10
branchesnumber =  5
evaluationParallel: Calculating the aspect ratio of the individual G++GG[G]
getAspectRatio_test: height 16.000000
getAspectRatio_test: width 10.000000
getAspectRatio_test: branchesnumber 5.000000
getAspectRatio_test: targetaspectratio GG—G
getAspectRatio_test: branchingweight GG[G[GG]G[GG]G]
error: getAspectRatio_test: operator /: nonconformant arguments (op1 is 1x1, op2 is 1x15). <———— As `targetaspectratio` and `branchingweight` parameters are received as strings instead of float elements, the operation gives an error. 
parallelisation_test: Elapsed time 0.664954


Please, let me know if something else is needed of me. 
Thanks for your time!!!

Cheers

Maria J.


---------------------------------------------------------------------------------------------------------------------------------------



On 23 Apr 2020, at 09:49, Kai Torben Ohlhus <address@hidden> wrote:

On 4/21/20 2:46 AM, Maria Jose Casas Serrano wrote:
Hi,
It’s the first time I’m trying to parallelise some code and I’m stuck in
a basic concept that I hope someone could help me with.
 
First, I’ll try to explain what my code is about. I’m doing Evolutionary
Computation and I have a large population of elements that represent the
genomes of modelled plants. This population should be evaluated by a
fitness function and then, some of the elements will evolve depending on
the probabilities of some genetic operators.

The bottleneck happens when evaluating them so, I thought that I could
parallelise that part of the code. 

[...]
However in the “inputparam2” and “inputparam3” parameters, the
evaluationParallel function is receinving the second and third elements
of the population.

Do you know what I am doing wrong? Perhaps I misunderstood the
parallelisation concept but I thought I could apply it in a piece of
code meanwhile there weren’t dependencies with the rest of the process.

Thanks in advance

Cheers

Maria J


Unfortunately, I have some trouble running your code.  It requires
octave-slf4o [1].  It would be nice to reduce it to simple "fprintf"
statements to avoid potential helpers to install dependencies
unnecessary for the problem.  Additionally, can you attach your code as
fully self-contained m-files, rather than pasting it into the email.
The code for generating "P" would also be nicer than a display of the
cell array.  Otherwise, I have to do the work to construct that cell
array myself.

HTH,
Kai




Attachments:

If there is nothing proprietary, you may want to put your code online somewhere, eg.
* gist [1]
* pastebin [2]
or for longer lived projects Gitlab, Github or similar. Will you also run your code run on a cluster?

[1] https://gist.github.com
[2] https://pastebin.com/

reply via email to

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