简体   繁体   English

在python程序完成matplotlib部分之前,SSH使用断开的管道关闭

[英]SSH shuts down with broken pipe before python program finishes matplotlib part

I am running a python 3 program via SSH which takes a few hours to finish. 我正在通过SSH运行python 3程序,这需要几个小时才能完成。 After all computations the program should save a matplotlib figure and then stop. 完成所有计算后,程序应保存一个matplotlib图形,然后停止。 What happens is that after all computations a Write failed: broken pipe error is shown and when I log back in the figure is not updated. 发生的情况是,在所有计算之后,“写入失败”:显示了管道破裂错误,并且当我重新登录时,该图未更新。

Another question mentioned the process spawns child processes for the figure which might be killed when the main program finishes computation, so I ran it with nohup to no avail. 另一个问题提到进程为该图形生成子进程,当主程序完成计算时,该子进程可能会被杀死,因此我以毫无用处的方式运行了该进程。 What other options can I try out? 我还可以尝试其他哪些选择?

If I had a guess here, it is that your SSH TCP connection is getting dropped. 如果我在这里有一个猜测,那就是您的SSH TCP连接正在断开。 On my systems, I set the following SSH client parameters to help in this situation. 在我的系统上,我设置了以下SSH客户端参数以在这种情况下提供帮助。

ServerAliveInterval = 300
ServerAliveCountMax = 300

This keeps data flowing over your connection even while your terminal is awaiting output from the running process. 即使您的终端正在等待正在运行的进程的输出,这也可以保持数据在连接上的流动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM