Hi,

I have a MFC project, and need to add mpi functions in it, and choose openmpi.
but I  searched all of mail list ,  not. find the answer.

And I try to call mpi functions under MFC, as follows,

int ompi_test(int *argc, char **argv)
{
    int rank, size;

    MPI_Init(argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    MPI_Comm_size(MPI_COMM_WORLD, &size);
    printf("Hello, world, I am %d of %d\n", rank, size);
    MPI_Barrier(MPI_COMM_WORLD);
    MPI_Finalize();

    return 0;
}
void CSchedulerDlg::OnBnClickedButton1()
{
    ompi_test(NULL, NULL);
}

but break at MPI_Init(argc, &argv);.

So what should I do?
Can anybody help me?

Thanks in advance.

Best Regards.



Reply via email to