作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我的 mpi 应用程序有一个信号处理程序来捕获 ctrl-C 或 ctrl-break 一个 Windows,当这个应用程序在 cmd 窗口中串行运行时,它可以正常工作。它被拦截,然后代码执行最后的输出,然后代码优雅地退出。
然而,当我并行运行它时,例如,“mpiexec -np 2 myparapp.exe”,并按下 ctrl-C 或 ctrl-break,信号似乎没有到达我的应用程序,因为它被突然杀死.我是否需要做一些特别的事情,比如确保我的信号处理程序在代码中的特定位置注册?
我正在使用 MSMPI,我知道它是 mpich 的一个分支。
最佳答案
Microsoft 的人好心地回复了我,
Currently it is not possible to pass the Ctrl-C/Ctrl-Break event directly to the child processes. Mpiexec is has Ctrl-C handler to deal with aborting the applications cleanly but it does not pass the Ctrl-C event to the processes.
我目前正在为 mpiexec 编写一个包装器,它将拦截信号并放置一个文件来向应用程序发出它应该退出的信号。
关于windows - 如何在 Windows 上通过 mpiexec 传递信号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39359230/
我是一名优秀的程序员,十分优秀!