Skip to content
Snippets Groups Projects
helloworld.c 413 B
Newer Older
  • Learn to ignore specific revisions
  • jansik's avatar
    jansik committed
    #include <mpi.h>
    #include <stdio.h>
     
    int main(int argc, char *argv[])
    {
    int rank, nprocs, len;
    char   pname[MPI_MAX_PROCESSOR_NAME];
    
    
        MPI_Init();       //Work for you
        MPI_Comm_size();  //Work for you
        MPI_Comm_rank();  //Work for you
    
    
        MPI_Get_processor_name(); //Work for you
        printf("Hello world! from rank %d of %d on host %s\n", rank, nprocs,pname);
    
    
        MPI_Finalize();
    
        return 0;
    }