<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<div>Hello, </div><div>I have a client/server program, and I run it in the same machine (I have already installed MPICH2 on my machine which have OS Windows 7 64-bits).</div><div>When I run the server program in commend line, this error appears: </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Fatal error in MPI_Open_port: Other MPI error, error stack:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>MPI_Open_port(124): MPI_Open_port(MPI_INFO_NULL, port=0x003CF6B4) failed</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>MPID_Open_port(69): Function not implemented </div><div>****here we have the server code : </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>#include "mpi.h" </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>#include <cstdio></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>#include "string.h"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>#define MAX_DATA 100</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>using namespace std;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>int main( int argc, char **argv ) </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>{ </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>MPI_Comm server; </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>double buf[MAX_DATA]; </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>char port_name[MPI_MAX_PORT_NAME]; </div><div> </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>MPI_Init( &argc, &argv ); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>strcpy(port_name, argv[1]); /* assume server's name is cmd-line arg */ </div><div> </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>MPI_Comm_connect( port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &server ); </div><div> </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>bool done = false; int tag, n = 0;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>while (!done) { </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>tag = 2; </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>MPI_Send( buf, n++, MPI_DOUBLE, 0, tag, server ); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>} </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>MPI_Send( buf, 0, MPI_DOUBLE, 0, 1, server ); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>MPI_Comm_disconnect( &server ); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>MPI_Finalize(); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>return 0; </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>} </div><div>****here we have the client code : </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>#include "mpi.h" </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>#include <cstdio></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>#include "string.h"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>#define MAX_DATA 100</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>using namespace std;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>int main( int argc, char **argv ) </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>{ </div><div><span class="Apple-tab-span" style="white-space:pre">        </span> MPI_Comm client; </div><div><span class="Apple-tab-span" style="white-space:pre">        </span> MPI_Status status; </div><div><span class="Apple-tab-span" style="white-space:pre">        </span> char por<span class="Apple-tab-span" style="white-space:pre">                </span>t_name[MPI_MAX_PORT_NAME]; </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> double buf[MAX_DATA]; </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>int size, again; </div><div> </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>MPI_Init( &argc, &argv ); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> MPI_Comm_size(MPI_COMM_WORLD, &size); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>//if (size != 1) error(FATAL, "Server too big"); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>MPI_Open_port(MPI_INFO_NULL, port_name); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>printf("server available at %s\n",port_name); </div><div> </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>while (1) { </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> MPI_Comm_accept( port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &client ); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> again = 1; </div><div> <span class="Apple-tab-span" style="white-space:pre">                </span> while (again) { </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> MPI_Recv( buf, MAX_DATA, MPI_DOUBLE, MPI_ANY_SOURCE, MPI_ANY_TAG, client, &status ); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> switch (status.MPI_TAG) { </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>case 0: MPI_Comm_free( &client ); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> MPI_Close_port(port_name); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> MPI_Finalize(); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> return 0; </div><div> <span class="Apple-tab-span" style="white-space:pre">                </span> case 1: MPI_Comm_disconnect( &client ); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> again = 0; </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> break; </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>case 2: /* do something */ </div><div><span class="Apple-tab-span" style="white-space:pre">                                                </span>break;</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>default: </div><div> /* Unexpected message type */ </div><div> MPI_Abort( MPI_COMM_WORLD, 1 ); </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>} </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>} </div><div> <span class="Apple-tab-span" style="white-space:pre">        </span> } </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>} </div><div><br></div><div><br></div><div>if you have any solution, please help me.</div>                                            </div></body>
</html>