Search code examples
razureazure-batch

R doAzureParallel and chunkSize. Is there a new R session per loop iteration?


Intend to use Azure Batch to run R in parallel with the do AzureParallel package. I intend leave the default chunkSize = 1.

Does it start a new R session for each iteration of the foreach() loop?

I do want it to start a new R session for each iteration of the foreach() loop. If the answer to the above question is "no", how can I make it restart the R session for each iteration?

Edit: Here is the link to the documentation of the chunkSize option, with example code.

https://github.com/Azure/doAzureParallel/blob/master/docs/80-performance-tuning.md#using-the-chunksize-option


Solution

  • Sharing the solution for the same question asked in MSDN

    On setting the chunkSize to 1, every foreach iteration will instantiate a new R session.