Mid Semester Examination


  1. (10 points)
    Amdahl's Law and the conjectured end of Moore's Law impose a limit on Clustered Computing speedup. What are these theses Laws ? Describe the nature of that limit, providing appropriate arithmetic detail.

    Moore and Amdahl



  2. (10 pts)
    Discuss the difference between MPI and OpenMP in terms of Processes and Threads. Your answer should reference mpirun.

    MPI and OpenMP



  3. (5 points)
    What action does the following line of MPI code implement? What are the roles of the various arguments? (5 pts)
     
            MPI_Send(&thestr,strlen(thestr), MPI_CHAR, 7, 2, MPI_COMM_WORLD);

    The Six



  4. (10 pts)
    What action does the following lines of OMP code implement? The dotted lines just represent supporting code that need not be considered.
    #pragma omp parallel  
     {
        ...
        ...
    #pragma omp critical   
        ...
     }

    As OpenMP


  5. 
    
  6. (15 pts)
    Briefly, what is the function of each line of code in the following SBATCH script? You can reference a line in your answer by its line number.
    1   #! /bin/bash
    2   #SBATCH --partition=TC
    3   #SBATCH --job-name=hello-mpitest
    4   #SBATCH --error=hello-mpitest_%j.err
    5   #SBATCH --output=hello-mpitest_%j.out
    6   #SBATCH --time=00:00:05
    7   #SBATCH --mem=1G
    8   #SBATCH --ntasks=6
    9   #SBATCH --nodes=3
    10  #SBATCH --ntasks-per-node=2
    11  mpirun ./$1 $2
    12  exit 0

    SLURM



  7. (10 pts)
    Discuss the purpose of MPI Derived Data Types.

    Student



  8. (10 pts)
    Discuss the purpose of MPI Virtual Topologies.

    Cartesian Topologies


  9. (15 pts)
    Given:
       struct student and  MPI_Datatype MPI_STUDENT
     
    We define MPI_GSTU as follows:
     
    struct Gstudent {
        struct student  stu;
        char  program[20];   
    };
    struct Gstudent test_student;
    ...
    ...
    MPI_Datatype MPI_GSTU;
    MPI_Datatype gtype[2] = { MPI_STUDENT,MPI_CHAR};
    int gblocklen[2] = {1, 20};  
    MPI_Aint student_disp;   
    MPI_Aint start_address;
    MPI_Aint address;
    MPI_Get_address( &test_student, &start_address);
    MPI_Get_address( &test_student.program, &address);
    student_disp = address - start_address;
    MPI_Aint gdisp[2]={0,student_disp};  
    MPI_Type_create_struct(2, gblocklen, gdisp, gtype, &MPI_GSTU);
    MPI_Type_commit(&MPI_GSTU);

     
    Simplify this code significantly by reversing the order of fields in struct Gstudent .

    Graduate Student


  10. (15 pts)
    Discuss in detail the purpose of the following three lines of code. Draw the associated graph.
     
        int index[] = { 2,5,8,9,10,11,12,13};
        int edges[] = { 1,2,0,3,4,0,5,6,1,1,2,2,6};
        MPI_Graph_create(MPI_COMM_WORLD, 8, index, edges, reorder,&MPI_Tree_World);

    Trees