English 中文(简体)
采用消费物价指数的客户/客户申请
原标题:client/server application using MPI

i 有两个问题:第一个问题是:

i m gonna use msmpi and i meant by "only mpi" that we mustn t use sockets, my application is about a scalable distributed data structure; initially, we have a server contain a file which has a variable size (the size could be increased by insertions and decreased by deletion) and when the size of the file exceed certain limit the file will be splitted, the half remain in the first server and the second half will be moved to a new server and so on... and the client need to be always informed by the address of the data he want to retrieve so he should have an image of the split operation of the file. finally, i hope i make it clearer.

第二是:

i ve试图将简单的客户/服务器应用程序(密码来源是灯塔)与薄膜或mp子2相加,并给我“露天-露天(房间)和其他 st错误”的错误信息,即在乌汶至11.10安装了开放式小皮,并试图以与服务器部门合作的同一例子操作,给我一个港口名称,但在客户方面给我错误的信息:

[user-Compaq-610:03833] [[39604,1],0] ORTE_ERROR_LOG: Not found in file ../../../../../../ompi/mca/dpm/orte/dpm_orte.c at line 155
[user-Compaq-610:3833] *** An error occurred in MPI_Comm_connect
[user-Compaq-610:3833] *** on communicator MPI_COMM_WORLD
[user-Compaq-610:3833] *** MPI_ERR_INTERN: internal error
[user-Compaq-610:3833] *** MPI_ERRORS_ARE_FATAL (your MPI job will now abort)
--------------------------------------------------------------------------
mpirun has exited due to process rank 0 with PID 3833 on
node toufik-Compaq-610 exiting without calling "finalize". This may
have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).

so i m confused what the problem is, and i spent a while trying to fix it, i d be greatfull if any body could help me with it, and thank u in advance.

来源代码如下:

/* the server side */
#include <stdio.h>
#include <mpi.h>

main(int argc, char **argv)
{
    int my_id;
    char port_name[MPI_MAX_PORT_NAME];
    MPI_Comm newcomm;
    int passed_num;

    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &my_id);

    passed_num = 111;

    if (my_id == 0)
    {
    MPI_Open_port(MPI_INFO_NULL, port_name);
    printf("%s

", port_name); fflush(stdout);
    } /* endif */

    MPI_Comm_accept(port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &newcomm); 

    if (my_id == 0)
    {
    MPI_Send(&passed_num, 1, MPI_INT, 0, 0, newcomm);
    printf("after sending passed_num %d
", passed_num); fflush(stdout);
    MPI_Close_port(port_name);
    } /* endif */

    MPI_Finalize();

    exit(0);

} /* end main() */

在客户方面:

#include <stdio.h>
#include <mpi.h>

int main(int argc, char **argv)
{
    int passed_num;
    int my_id;
    MPI_Comm newcomm;

    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &my_id);

    MPI_Comm_connect(argv[1], MPI_INFO_NULL, 0, MPI_COMM_WORLD, &newcomm); 

    if (my_id == 0)
    {
    MPI_Status status;
    MPI_Recv(&passed_num, 1, MPI_INT, 0, 0, newcomm, &status);
    printf("after receiving passed_num %d
", passed_num); fflush(stdout);
    } /* endif */

    MPI_Finalize();

    return 0;   
    //exit(0);

} /* end main() */
问题回答




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签