debugging - 如何使用 CLion 调试 MPI?

标签 debugging mpi clion

如何用Clion调试mpi程序?
可执行文件设置为mpirun,这就是为什么我不能像往常一样调试,我想,那么该怎么办呢?谢谢

最佳答案

Zulan已经提到过,

  1. 在断点之前添加这些行并重建应用程序(来自 OpenMPI)

     int i = 0;
     while(0==i)
        sleep(5);
    
  2. 使用 mpirun 从终端启动程序

$mpirun -np 4 ./Application

  • Attach LLDB 或 GDB 到本地进程
  • Run-> Attach to Process

  • 暂停程序(程序将在 sleep(5) 时暂停)

  • 设置i!=0并恢复程序

  • 调试愉快

  • 您可能需要连接到其他进程来设置 i!=0 并继续调试。

    关于debugging - 如何使用 CLion 调试 MPI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37901231/

    相关文章:

    java - 无法理解 Spring Boot 代码流程

    android - 这是 Android GregorianCalendar 中的错误吗?

    c - 释放树,但 IDE 随着时间的推移会获得一些内存

    c++ - Ubuntu 20.04 中未找到 io.h CLion

    mpi - 为什么 MPI_Barrier 对于跨不同节点的工作人员不会同时停止?

    c++ - 尝试在 Windows 上的 CLion+CMake+MinGW 中编译 OpenGL 4 Helloworld。 "undefined reference to ` _imp____glewCreateShader'“错误

    c++ - 将源代码与反汇编代码匹配

    c++ - 修复 Visual C++ 中的编译错误

    emacs - Slime\Emacs comint 在启动 mpi 进程时挂起

    c - MPI 收集稀疏 vector