|
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 |
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 = 16width = 10branchesnumber = 5evaluationParallel: Calculating the aspect ratio of the individual G++GG[G]getAspectRatio_test: height 16.000000getAspectRatio_test: width 10.000000getAspectRatio_test: branchesnumber 5.000000getAspectRatio_test: targetaspectratio GG—GgetAspectRatio_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.664954Please, let me know if something else is needed of me.Thanks for your time!!!CheersMaria 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 ina basic concept that I hope someone could help me with.First, I’ll try to explain what my code is about. I’m doing EvolutionaryComputation and I have a large population of elements that represent thegenomes of modelled plants. This population should be evaluated by afitness function and then, some of the elements will evolve depending onthe probabilities of some genetic operators.The bottleneck happens when evaluating them so, I thought that I couldparallelise that part of the code.[...]However in the “inputparam2” and “inputparam3” parameters, theevaluationParallel function is receinving the second and third elementsof the population.Do you know what I am doing wrong? Perhaps I misunderstood theparallelisation concept but I thought I could apply it in a piece ofcode meanwhile there weren’t dependencies with the rest of the process.Thanks in advanceCheersMaria JUnfortunately, I have some trouble running your code. It requiresoctave-slf4o [1]. It would be nice to reduce it to simple "fprintf"statements to avoid potential helpers to install dependenciesunnecessary for the problem. Additionally, can you attach your code asfully self-contained m-files, rather than pasting it into the email.The code for generating "P" would also be nicer than a display of thecell array. Otherwise, I have to do the work to construct that cellarray myself.HTH,KaiAttachments:
- parallelisation_test.m
- evaluationParallel_test.m
- LsystemGeneratorNP_test.m
- getAspectRatioNP_test.m
[Prev in Thread] | Current Thread | [Next in Thread] |