我在文件中写入二维块循环分布式数组时遇到问题。
我试过这些东西:
rc=MPI_File_open(MPI_COMM_WORLD, rez, MPI_MODE_WRONLY, MPI_INFO_NULL, &cFile);
if(rc){printf("Failed to open file! Error: %d \n", rc);MPI_Finalize();
fflush(stdout);}
else
{
MPI_File_write_all(cFile, MatC, loccC*locrC, compa, &status);
}
...
rc=MPI_File_open(MPI_COMM_WORLD, rez, MPI_MODE_WRONLY, MPI_INFO_NULL, &cFile);
if(rc){printf("Failed to open file! Error: %d \n", rc);MPI_Finalize();
fflush(stdout);}
else
{
MPI_File_write_ordered(cFile, MatC, loccC*locrC, compa, &status);
}
...
rc=MPI_File_open(MPI_COMM_WORLD, rez, MPI_MODE_WRONLY, MPI_INFO_NULL, &cFile);
if(rc){printf("Failed to open file! Error: %d \n", rc);MPI_Finalize();
fflush(stdout);}
else
{
MPI_File_write_shared(cFile, MatC, loccC*locrC, compa, &status);
}
我在这篇文章中什么也找不到(但只是如何读取文件并将其格式化为 2d 块循环分布式数组(我已成功使用该帖子)): MPI IO Reading and Writing Block Cyclic Matrix
对不起我糟糕的英语:(