Closed TheSilverLinings closed 4 years ago
如题,请问博主是如何让主进程执行 创建文件,创建log文件,而其他进程不执行这些操作?如果将MPI封装到另一个类中,又要怎么运行程序?还是用mpiexec -n 5 python xx.py 吗?
你可以使用定义 analysis callback的时候设置master_only=1来强制只在主进程执行,参考: https://github.com/PytLab/gaft/blob/master/examples/ex01/ex01.py#L47
master_only=1
如题,请问博主是如何让主进程执行 创建文件,创建log文件,而其他进程不执行这些操作?如果将MPI封装到另一个类中,又要怎么运行程序?还是用mpiexec -n 5 python xx.py 吗?