Skip to content

random1001guy/MPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Message Passing Interface (MPI)

Hey, this is my repo for some Message Passing Interface code snippets. I'm presently learning about this stuff, and will keep adding new things that I try out.

Installing MPI on Ubuntu

Use the following command on the terminal to install the MPI compiler on Ubuntu:

  sudo apt install lam4-dev 
  OR
  sudo apt install libmpich-dev 

Compiling MPI programs

To compile MPI programs, use the following commnad:

  mpicc foo.c

You can also use the following command to place the output in the file myfoo instead of a.out:

  mpicc -o myfoo foo.c

Running your MPI programs

To run your MPI programs you can either of the follwing commands:

    mpirun -np 2 ./myfoo  

OR

    mpiexec -np 2 ./myfoo  

Here -np specifies how many processses to create. In the above case, 2 processes are created and both run the myfoo
executable.

For more details, please see the man pages of the commands :

  man mpicc
  man mpiexec

About

Tags: Message Passing Interface ; Parallel Computing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages