华为计算微信公众号
华为计算微博
华为计算今日头条
在进行精度调优或者查找程序运行bug时,有时会需要通过gdb attach pid去深入分析。
在Fortran程序中可以通过调用mpi的相关接口(MPI_Comm_rank)找出目标进程rank,再通过getpid打印出对应rank的pid。
如:
call MPI_Comm_rank(MPI_COMM_WORLD, rank0) if (rank0 .eq. 0) then print*,getpid() endif
在进行精度调优或者查找程序运行bug时,有时会需要通过gdb attach pid去深入分析。
在Fortran程序中可以通过调用mpi的相关接口(MPI_Comm_rank)找出目标进程rank,再通过getpid打印出对应rank的pid。
如:
call MPI_Comm_rank(MPI_COMM_WORLD, rank0) if (rank0 .eq. 0) then print*,getpid() endif