[MPICH] MPICH problem when using Windows API OpenFileMapping
赖俊杰
laijj02 at mails.tsinghua.edu.cn
Mon Mar 26 09:38:41 CDT 2007
Hi,I've got a problem with MPICH2 1.0.3,when using the API
OpenFileMapping.
the code is :
#include <mpi.h>
#include <iostream>
using namespace std;
#include <windows.h>
int main(int argc,char * argv[])
{
MPI_Init(&argc,&argv);
cout<<"here"<<endl;
TCHAR szName[]=TEXT("Global");
HANDLE h=OpenFileMapping(FILE_MAP_READ, false, szName);
cout<<h<<endl;
MPI_Finalize();
}
There is another process which creats the shared memory block whose
name is "Global". And I want to use this process to get large block of data
from the mpi process and plot it.
When i compile the code ,and run the exe file directly,there is no
problem the output is:
F:\>ShareFactory.exe
here
000006B0
But when i use the mpiexec.exe,the problem occurs,
F:\>mpiexec -n 1 ShareFactory.exe
here
00000000
Can anyone tell me where this problem is?
Thanks a lot.
More information about the mpich-discuss
mailing list