tags:

views:

60

answers:

1

I need to write an application using MPICH2 (64 bit, in case you're wondering). A GUI is entirely optional but would of course be a huge plus. Will mpiexec have any difficulties running managed VC++ code? Are there any other problems I might run into with compiling/linking (calling conventions, etc)?

Just to give you an idea, the general structure of the program would be like this:

int main(array<System::String ^> ^args)
{
    /* Get MPI rank */

    if ( rank == 0 )
    {
        // Enabling Windows XP visual effects before any controls are created
        Application::EnableVisualStyles();
        Application::SetCompatibleTextRenderingDefault(false); 

        // Create the main window and run it
        // Send/receive messages in Form1's code
        Application::Run(gcnew Form1());
    }
    else
    {
        /* Send/receive messages to/from process #0 only */
    }
    return 0;
}
A: 

MPI is just another library so no magic. Your code should look something like this:

init MPI

if(rank == 0) init your GUI;

while (1){

if(rank == 0)get input;

perform MPI computation on input

make sure rank 0 ends up with the final result

if(rank == 0) display result on GUI;

}

if(rank == 0) clean up GUI;

clean up MPI

Chad Brewbaker