Suppress 'starting worker pid...' output in rstan


I’m fitting the same stan model to a number of different data sets in a single, parallelised function. To keep the output on the command line clean I would like to suppress the messages printed when a new parallel worker is started (as below):

starting worker pid=29827 on localhost:11281 at 17:11:39.574

Is there any straightforward way to suppress these messages? I’ve tried a number of options including withCallingHandlers(), suppressMessages(), and capture.output() but these messages are still printed.

I’m parallelising across stan models rather than across chains, so the stan ‘cores’ param is set to 1L in all cases.


Hmm, if you’re setting cores=1 then I don’t think RStan should be emitting any messages like that. What does your code look like for parallelizing across models? I assume that’s where the messages are coming from.


Take a look at the approach I take here. You’d have to tweak it to load a different model per core, and I guess you’d still have the “starting worker” line when you run rstan::stan_model() to first compile each model in the main process, but possibly that’s ok?