1
嗨我有一個用C++編寫的程序,其中一個或兩個函數使用PETSc。PETSc和MPI COMM世界正確使用
當我調用這些功能,同時使用的PETSc
1) a)change all MPI_COMM_WORLD to PETSC_COMM_WORLD for my entire program
b)change MPI_Init to PetscInitialize
這將是正確的方法..
2)讓PETSc創建一個單獨的通訊世界,傳遞給了函數
MPI_Init(&argc, &argv);
..
//some many line of code
..
MPI_Comm_split(MPI_COMM_WORLD, rank, 0, &PETSC_COMM_WORLD);
petsc_function(PETSC_COMM_WORLD,.....
//some how reverting the comm_split here to continue as normal so all the non petsc functions work
..
3)或可我只是通過只使用MPI_得到具有Petsc功能的COMM_WORLD ..
4)還是有另一種方法我不知道?
非常感謝,文檔有點混亂,當第一次開始 – pyCthon