CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Posts
    45

    Help for parallel computing using MPI

    Hi All,
    I would like to implement my OOP C++ in computer cluster. But I dont know exactly how to do this. I am very new to this parallel computation. I tried as follows,
    Code:
    #include ..... 
    #include <mpi.h> 
    int main(int nargs, char** args) 
    { 
    int size, my_rank;
     MPI_Init (&nargs, &args); 
    MPI_Comm_size (MPI_COMM_WORLD, &size);
    MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); 
    //here I want to run three different independent job 
    
    make_pov(); 
    make_avs(); 
    make_vrml(); 
    
    MPI_Finalize ();
     return 0; 
    }

    Actually this is my first try, please give me how to do this job correctly with little explanation.

    Thanks a lot in advance..

    Sitha.
    Edit/Delete Message

  2. #2
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,725

    Re: Help for parallel computing using MPI

    I assume that use use the my_rank variable ...
    Code:
    if (my_rank == 0)
    {
       // whatever
    }
    if (my_rank == 1)
    {
       // whatever
    }
    if (my_rank == 2)
    {
       // whatever
    }
    How are you executing the run ? Are you using mpirun or some
    other method ?

  3. #3
    Join Date
    Jul 2006
    Posts
    45

    Re: Help for parallel computing using MPI

    Quote Originally Posted by Philip Nicoletti
    I assume that use use the my_rank variable ...
    How are you executing the run ? Are you using mpirun or some
    other method ?
    Thank you very much for your help.

    Actually I am very new to this. I dont know my explanation whether correct or not for questions.
    My cluster has 32 nodes.
    it has MPICH2 for parallel computing
    for executing we use
    Code:
    mpiexec -l filename -n 32 ./.out
    for above application if I want to use all nodes how can I do?

    Please give me the idea what is the best way to compile and run a program.

    Thanks a lot.

    Sitha.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured