How to use setMaxConcurrencyPerNode for MapReduce

We have a heavy machine learning algorithm to run (using a lot of memory) and we want to make sure to run a single map action per node.

The setMaxConcurrencyPerNode() seems to be what we are looking for but we are still getting several (up to 8 action per node) in the same time.

Here is the script we followed:

MapReduceQueue.pause();
var j = /// .. get the MapReduceJob here
j.start();
j.setMaxConcurrencyPerNode(1);
MapReduceQueue.resume();

We are on v7.8

@NabilKoroghli could you give a try setting the property maxConcurrencyPerNode in the mapreduce definition so you avoid to run the setMaxConcurrencyPerNode api.
Btw I have run it tons of time on 7.8 recently and worked like a charm - doing same steps you described

@marcosordi we have been experimenting maxConcurrencyPerNode, but it gets reset to -1 as soon as the job is started.

@NabilKoroghli - You need to make sure to include that property as part of the MapReduceOptions parameter passed in to the start method. Otherwise, many of the values available in the MapReduceOptions type will get set back to the default values if you call start w/ no parameters on an existing job.

@jonathonbraun I used j.start({ maxConcurrencyPerNode: 1 }) and indeed the field is not reset to -1.
But the behavior is still not as expected.
@jonathonbraun @marcosordi Which version of 7.8 are you using? In 7.8.10 it seems to be buggy.

we are on 7.8.10 as well, i have not used the perNode option on this build tho, only the job maxConcurrency option

Thanks for the answer @jonathonbraun . Last question, are you using JSMapReduceJob or a custom type ?

this would have been a RefreshNormalizationBatchJob i believe