带扭矩运行程序
我有一个 Fortran 代码,我编译了它,然后将其作为 pbs 作业发送到 超级计算机。我想修改源代码并再次编译它,同时保留 已经运行的程序。我的问题是如果我修改源代码会发生什么 如果我有一个使用不同可执行文件运行的 pbs 作业,则创建一个新的可执行文件。 原始可执行文件的结果会被修改吗?
谢谢。
I have a code in fortran which I compiled and then sent to run as a pbs job in a
supercomputer. I want to modify the source code and compile it again while keeping
the already running program. My question is what happens if I modify the source code
and make a new executable if I have a pbs job running with a different executable.
Would the results from the original executable be modified?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果可执行文件的替换是通过 rename() 系统调用以原子方式发生的,那么它应该能够使正在运行的程序继续使用旧的可执行文件。 OTOH 如果通过将一些片段写入现有可执行文件来进行替换,则正在运行的可执行文件可能会受到影响。
FWIW,这与 fortran、pbs 或 Torque 无关,而是与 POSIX 文件系统语义有关。 POSIX 文件系统本质上是引用计数的对象存储,具有最后关闭时删除功能。当您使用 rename() 替换可执行文件时,旧可执行文件的引用计数会减一,因为该目录不再有对其的引用。但是,正在执行的程序仍然保留引用并可以继续使用它。新的可执行文件是一个单独的对象,具有自己的引用计数。
If the replacement of the executable happens atomically with the rename() system call, then it should work such that the running program keeps using the old executable. OTOH if the replacement happens by writing bits and pieces into the existing executable, the running executable might be affected.
FWIW, this has nothing to do with fortran, pbs, nor torque, but rather to do with POSIX filesystem semantics. POSIX filesystems are essentially reference-counted object stores, with delete-on-last-close. When you replace the executable with rename(), the reference count of the old executable is reduced by one since the directory no longer has a reference to it. However, the executing program still holds a reference and can keep using it. The new executable is a separate object with it's own reference count.