New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-thread experiment not using the specified number of threads #3658
Comments
I tried with GAMA version 1.9 (here) and it seems to work well. You should use this version rather than GAMA 1.8.2. However, with the default options, GAMA will not run 40 simulations in parallel, but only 15 corresponding to the number of repetitions. If you really want to run 40 in parallel, you have to set to "true" this preference: "Execution" -> "Parallelism" -> "In batch mode, allow to run simulations with different parameter sets..." Or can add this line in the init of the experiment: |
Hey, |
Thanks so much to both of you - it is working now!! 😄
|
Just tested:
|
@NaroaCS So even on GAMA 1.9, w/o the |
@AlexisDrogoul from what I understand, with the That's quite strange, but it seems quickly fixable by enabling |
OK. I agree with this change. At first, I thought that we might not need to set the preference (as it might have other side effects), but it appears that the exploration algorithms do not factorise a lot their calls to this preference, so there is no single place where we could write something like |
I've committed a solution -- please test and close the issue if it is the intended behaviour. |
The commit is here: gama-platform/gama@ba1f1ee (somehow, my first line has disappeared). |
I just tested it with this version Now, w/o
If I do it w/o |
@RoiArthurB if my understanding is correct, So we should probably work a bit on the priority of these options. Right now, we have:
In my opinion, when the modeler wants to limit the number of threads, |
@AlexisDrogoul I aggree and will commit something to apply it.
@NaroaCS If you still start the headless with the bash script, then the configuration file
This is because the headless is started with Java "by hand" (not through and binary as GAMA GUI) and we never tougth about reading this file... But it might be a great default behavior, will make it too 🤔 Also, we do not recommand to set RAM per thread (with -Xss or -Xmn) and let GAMA scale in the full RAM and max cores itself (it can allow GAMA to better dynamically allocate RAM to threads when needed, etc).
I think it's because you didn't allow max memory properly (and it was limited at 4GB). Also, if you want to make better use of the RAM over long batch, you can add the facet |
Thanks so much, @RoiArthurB !! :D |
That was it! I'm not getting the memory error anymore! |
I think that's enough for your initial problem, I'm closing this issue and leave @RoiArthurB open one new for the |
Describe the bug
I am running a batch experiment on a server that has 40 threads ( 2 CPU x 10 thread/CPU x 2 hyperthreading).
I have defined the parameter
parallel: 40
when defining the experiment in the .gaml script, but when I launch it, it only runs 4 threads in parallel.To Reproduce
I guess it is difficult to reproduce, but this is how I have defined the experiment:
experiment batch_experiments_pheromone type: batch parallel: 40 repeat: 15 until: (cycle >= numberOfDays * numberOfHours * 3600 / step) {
parameter var: evaporation among: [0.05, 0.1, 0.15, 0.2,0.25,0.3];
parameter var: exploitationRate among: [0.6,0.65,0.7, 0.75, 0.8];
parameter var: numBikes among: [150, 250, 350];
parameter var: WanderingSpeed among: [1/3.6#m/#s,3/3.6#m/#s,5/3.6#m/#s];
}
and here is the full code: https://github.com/CityScope/VehicleClustering.git
I am running the script with the following command, which I execute in the 'headless' folder of GAMA:
bash gama-headless.sh -batch batch_experiments_pheromone ../../VehicleClustering/CS_CityScope_GAMA/models/clustering.gaml
Expected behavior
I would expect GAMA to make use of all the threads available instead of only 4. The way that I see this is because it prints 'FINISH INITIALIZATION' four times in a row, runs the four experiments, and repeats the process once it is done. See the screenshot below.
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: