My situation
I want to run multiple R scripts on a Ubuntu server with which I connect via SSH. To run multiple R scripts I want to use tmux
and one session for each run.
My problem
When I start one R script it should use 4 cores, because I have specified it (one Markov Chain per Core with the Stan library). But when I observe the cores with htop
I see, that only one core is working at full capacity and the others are almost idle. When I run the same script outside of the tmux shell, it uses the 4 cores as it should do.
Furthermore, the code stops, when I exit the SSH session, even if I appropriately detach myself from tmux
session.
Question:
How can I enable multithreading in tmux
? If you know other ways of letting code run on the server even if I disconnect, I would also be thankful!
tmux
does not impose any limitations on multithreading. The issue must lie somewhere else. – Artur Meinild Sep 18 '23 at 12:25tmux
shell, I perfectly uses 4 cores – Marcello Zago Sep 18 '23 at 12:32systemd status <pid-of-R-script>
when you run the script inside and outside tmux? – muru Sep 19 '23 at 09:12systemctl status <pid>
– Marcello Zago Sep 19 '23 at 09:18