cs205-lecture-examples

Example codes used during Harvard CS205 lectures
git clone https://git.0xfab.ch/cs205-lecture-examples.git
Log | Files | Refs | README | LICENSE

hello_mpi.cpp (273B)


      1 #include <iostream>
      2 #include <mpi.h>
      3 
      4 int main(int argc, char *argv[])
      5 {
      6     MPI_Init(&argc, &argv);
      7 
      8     std::cout << "Hello MPI\n";
      9 
     10     // for demonstration with system monitor
     11     volatile bool cond = true;
     12     while (cond) {
     13     }
     14 
     15     MPI_Finalize();
     16     return 0;
     17 }