End of Semester Examination


  1. (15 pts.)
      Supplying your own file and process names, write .sh script to be run under sbatch supporting 7 tasks, running on 4 nodes and 1 command line argument.
     

    Ans: Similar examples can be found in the SLURM tab.


    (5 pts.)
      Setting aside mpirun why would this not work for OpenMP?

    Ans :OpenMP spawns Threads not Processes.



  2. (10 pts.)
      Discuss the role of MPI_Irecv and MPI_Test in allowing non-blocking inter-task MPI communication.

    Ans: Execution continues past MPI_Irecv without waiting for the corresponding Send. MPI_Test is used to check that the corresponding Send has been Received.


     

  3. (20 pts.)
      Encode the Virtual Task Topology shown in the following image by filling in the question marks in the code outline below it.
        int reorder= ?;   /* The processes need to be reordered to  improve performance.*/
        int index[] = { ?};
        int edges[] = { ?};
        MPI_Comm MPI_Tree_World;
        MPI_Graph_create(MPI_COMM_WORLD, ?, index, edges, reorder,&MPI_Tree_World);

    The Answer
  4. (15 pts.)
      Provide a struct that would be supported by the following MPI code
     
        MPI_Datatype MPI_MYTYPE;
        MPI_Datatype type[2] = { MPI_CHAR,MPI_INT};
        int blocklen[2] = {30, 2};
        MPI_Aint disp[2];   
        MPI_Aint start_address;
        MPI_Aint address;
        MPI_Get_address( &example, &start_address);
        MPI_Get_address( &example.field1 , &address);
        disp[0] = address - start_address;
        MPI_Get_address( &example.field2 , &address);
        disp[1] = address - start_address;   
        MPI_Type_create_struct(2, blocklen, disp, type, &MPI_MYTYPE);
        MPI_Type_commit(&MPI_MYTYPE);
        MPI_Comm_rank(MPI_COMM_WORLD, &myrank);

    Answer: Something like:

    struct mytpe {
        char  field1[30];
        int     field2[2];
    };

  5. (20 pts.)
      

  6. (15 pts.)
      Discuss the Algorithmic Complexity of factoring a product of two primes to attack RSA.

    Ans: The number of divisions you need to perform growns as the square root of the number you are trying to factor.


     
     In particular, using the simple factoring method presented in class, suppose I double the number of nodes available to break an RSA instance in half the time, what "arithmetic" might an RSA practitioner use defeat my efforts?

    Ans: Adding 1 digit to the length of the number you are trying to factor multipies the number of divisions you need to perform by the square root of 10, more than 3 times the number.