#include <iostream>
#include <mpi.h>

using namespace std;

int main() {
    // initialize the MPI environment
    MPI_Init(NULL, NULL);

    // get the number of processes
    int worldSize;
    MPI_Comm_size(MPI_COMM_WORLD, &worldSize);

    // get the rank of the process
    int rank;
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);

    cout << "Hello world from process " << rank << " out of " << worldSize << endl;

    MPI_Finalize();
    return 0;
}
