errtest.cxx
来自「MPICH是MPI的重要研究,提供了一系列的接口函数,为并行计算的实现提供了编程」· CXX 代码 · 共 28 行
CXX
28 行
#include "mpi.h"#include "mpicxxbase.h"#include <iostream.h>// This test trys the error handlingint main( int argc, char *argv[] ){ MPI::Init( argc, argv ); cout << "size= " << MPI::COMM_WORLD.Get_size() << "\n"; cout << "myrank = " << MPI::COMM_WORLD.Get_rank() << "\n"; MPI::COMM_WORLD.Set_errhandler( MPI::ERRORS_THROW_EXCEPTIONS ); try { size = MPI::COMM_NULL.Get_size(); } catch (MPI::Exception e) { cout << "Caught exception in get size with code " << e.Get_error_code() << " and message " << e.Get_error_string() << "\n"; delete e; } MPI::Finalize(); return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?