Giter Club home page Giter Club logo

mpi_examples's Introduction

MPICH Collective/One-Sided CommExamples

Supported primitives

  • Rank0->Rank1, Rank1->Rank2, RankN-1->Rank0 Send/Recv
  • Rank0->Rank1, RankN-1 Bcast
  • RankN-1->Rank0->Rank1 (send 0th, recvN-1th, ADD old + recv), Rank0->Rank1->Rank2 (send 1st, recv 0th, ADD old + recv) RingAllReduce(ADD)
  • RankN-1->Rank0->Rank1 (send 0th, recvN-1th), Rank0->Rank1->Rank2 (send 1st, recv 0th) RingAllgather

Tutorial

To install mpich

apt install mpich
# MPICH header should be found at /usr/include/<platform>/mpich/mpi.h
# Library dependency should be libmpich

To compiler examples using libmpich,

mkdir build && cd build
cmake ..

To run examples using mpirun,

$ mpirun -np 4 ./CommExamples
Rank [0], World Size [4]
Rank [2], World Size [4]
Rank [3], World Size [4]

============[64 bytes RANK 3 START]===========

[Rank(3) 0x0]: 03 	03 	03 	03 	03 	03 	03 	03 	
[Rank(3) 0x8]: 03 	03 	03 	03 	03 	03 	03 	03 	
[Rank(3) 0x10]: 03 	03 	03 	03 	03 	03 	03 	03 	
[Rank(3) 0x18]: 03 	03 	03 	03 	03 	03 	03 	03 	
[Rank(3) 0x20]: 03 	03 	03 	03 	03 	03 	03 	03 	
[Rank(3) 0x28]: 03 	03 	03 	03 	03 	03 	03 	03 	
[Rank(3) 0x30]: 03 	03 	03 	03 	03 	03 	03 	03 	
[Rank(3) 0x38]: 03 	03 	03 	03 	03 	03 	03 	03 	
============[RX 64 bytes RANK 3 END]=============
Rank [1], World Size [4]

============[64 bytes RANK 1 START]===========

[Rank(1) 0x0]: 01 	01 	01 	01 	01 	01 	01 	01 	
[Rank(1) 0x8]: 01 	01 	01 	01 	01 	01 	01 	01 	
[Rank(1) 0x10]: 01 	01 	01 	01 	01 	01 	01 	01 	
[Rank(1) 0x18]: 01 	01 	01 	01 	01 	01 	01 	01 	
[Rank(1) 0x20]: 01 	01 	01 	01 	01 	01 	01 	01 	
[Rank(1) 0x28]: 01 	01 	01 	01 	01 	01 	01 	01 	
[Rank(1) 0x30]: 01 	01 	01 	01 	01 	01 	01 	01 	
[Rank(1) 0x38]: 01 	01 	01 	01 	01 	01 	01 	01 	
============[RX 64 bytes RANK 1 END]=============

============[64 bytes RANK 2 START]===========

[Rank(2) 0x0]: 02 	02 	02 	02 	02 	02 	02 	02 	
[Rank(2) 0x8]: 02 	02 	02 	02 	02 	02 	02 	02 	
[Rank(2) 0x10]: 02 	02 	02 	02 	02 	02 	02 	02 	
[Rank(2) 0x18]: 02 	02 	02 	02 	02 	02 	02 	02 	
[Rank(2) 0x20]: 02 	02 	02 	02 	02 	02 	02 	02 	
[Rank(2) 0x28]: 02 	02 	02 	02 	02 	02 	02 	02 	
[Rank(2) 0x30]: 02 	02 	02 	02 	02 	02 	02 	02 	
[Rank(2) 0x38]: 02 	02 	02 	02 	02 	02 	02 	02 	
============[RX 64 bytes RANK 2 END]=============

============[64 bytes RANK 0 START]===========

[Rank(0) 0x0]: 04 	04 	04 	04 	04 	04 	04 	04 	
[Rank(0) 0x8]: 04 	04 	04 	04 	04 	04 	04 	04 	
[Rank(0) 0x10]: 04 	04 	04 	04 	04 	04 	04 	04 	
[Rank(0) 0x18]: 04 	04 	04 	04 	04 	04 	04 	04 	
[Rank(0) 0x20]: 04 	04 	04 	04 	04 	04 	04 	04 	
[Rank(0) 0x28]: 04 	04 	04 	04 	04 	04 	04 	04 	
[Rank(0) 0x30]: 04 	04 	04 	04 	04 	04 	04 	04 	
[Rank(0) 0x38]: 04 	04 	04 	04 	04 	04 	04 	04 	
============[RX 64 bytes RANK 0 END]=============

mpi_examples's People

Contributors

realarnavgoel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.