[英]R Session on Linux - submit multiple batch jobs pointing to same session
1) Is it possible to start R sessions on Linux (eg Rsession1) and submit multiple jobs in batch mode to the same R Session (eg job1 to Rsession1 and then later on based on user action submit job2 to Rsession1)? 1) 是否可以在 Linux 上启动 R 会话(例如 Rsession1)并以批处理模式将多个作业提交到同一个 R 会话(例如,job1 到 Rsession1,然后根据用户操作将 job2 提交到 Rsession1)?
This is equivalent to opening interactive R Session and submitting job1 and the user can submit job2 in same session (which will be available until the user closes interactive R session)这相当于打开交互式R会话并提交job1,用户可以在同一个会话中提交job2(直到用户关闭交互式R会话才可用)
2) Is it possible to start two R sessions on Linux (eg Rsession1 and Rsession2) and submit multiple jobs in batch mode but specify session-id during job submission? 2) 是否可以在 Linux 上启动两个 R 会话(例如 Rsession1 和 Rsession2)并以批处理模式提交多个作业,但在作业提交期间指定 session-id?
This is equivalent to opening two interactive R Sessions and submitting jobs to different R sessions by clicking on the window manually submitting the job.这相当于打开两个交互式 R 会话并通过单击窗口手动提交作业将作业提交到不同的 R 会话。
I'm not sure what your end goal is, but have you considered something like the futures
package that will allow R to send work off to another thread to be completed?我不确定你的最终目标是什么,但你有没有考虑过像
futures
包这样的东西,它允许 R 将工作发送到另一个线程来完成? That way the work can be done but doesn't lock up the main R session while the work is being completed.这样可以完成工作,但不会在工作完成时锁定主 R 会话。 This way, via the main R session, you could launch job1 and then while that was still being worked on, launch job2.
这样,通过主 R 会话,您可以启动 job1,然后在仍在处理的时候启动 job2。
You can use save.image
at the end of each job to store the workspace and load
at the beginning of the following jobs to restore it.您可以在每个作业结束时使用
save.image
来存储工作区,并在以下作业开始时load
以恢复它。 By choosing different file names the session-id could be specified.通过选择不同的文件名,可以指定 session-id。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.