[MPICH] MPICH problem when using Windows API OpenFileMapping

赖俊杰 laijj02 at mails.tsinghua.edu.cn
Wed Apr 4 12:48:33 CDT 2007



Thank you for your advice,and I've solved this problem by add the"-localonly" option.

But I still don't know why this will happen.

I'll give you the souce code as soon as i can.

Thank you again.

> -----Original Message-----
> From: "Jayesh Krishna" <jayesh at mcs.anl.gov>
> Date: Mon, 26 Mar 2007 16:16:04 -0500
> To: "'???'" <laijj02 at mails.tsinghua.edu.cn>, <mpich-discuss at mcs.anl.gov>
> Cc: <mpich2-maint at mcs.anl.gov>
> Subject: RE: [MPICH] MPICH problem when using Windows API OpenFileMappin
>  Hi,
>   Can you try running your program using the "-localonly" option of mpiexec
> ? (mpiexec -localonly 1 SharedFactory.exe)
>   Can you provide us with a test program (with source - so that we know the
> permission/security attributes of each system call) which demonstrates the
> problem ?
> 
> Regards,
> Jayesh
> 
> ----------------------------------
>  Jayesh Krishna
>  Argonne National Laboratory
>  Mathematics and Computer Science
>  Email: jayesh at mcs.anl.gov
> ----------------------------------
> -----Original Message-----
> From: owner-mpich-discuss at mcs.anl.gov
> [mailto:owner-mpich-discuss at mcs.anl.gov] On Behalf Of ???
> Sent: Monday, March 26, 2007 9:39 AM
> To: mpich-discuss at mcs.anl.gov
> Subject: [MPICH] MPICH problem when using Windows API OpenFileMapping 
> 
> 
> 
> 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. 
> 
> 
> 
> 
> 

赖俊杰
HSP,EE Dept
Tsinghua University





More information about the mpich-discuss mailing list