/PDC-Codes

Parallel and Distributed Computing Codes

Primary LanguageC

PDC-Codes

Parallel and Distributed Computing Codes

To run OpenMP codes (in cmd line)

gcc -o <file_name> -fopenmp <file_name>.c
./<file_name>
  1. Implement the OpenMP standard includes the following functions and data types using C and include the appropriate declarations of the routines in your source code and explain it.

    • omp_destroy_lock
    • omp_get_dynamic
    • omp_get_max_threads
    • omp_get_nested
    • omp_get_num_procs
    • omp_get_num_threads
    • omp_get_thread_num
    • omp_get_default_device()
    • omp_get_wtick
    • omp_get_wtime
    • omp_in_parallel
    • omp_init_lock
    • omp_init_nest_lock
    • omp_set_dynamic
    • omp_set_lock
    • omp_set_nest_lock
    • omp_set_nested
    • omp_set_num_threads
    • omp_test_lock
    • omp_unset_lock
  2. Using OpenMP, Design, develop and run a multi-threaded program to perform dot product and explain it.

  3. Using OpenMP, Design, develop and run a multi-threaded program to perform sum of N elements (N=100) using Loop work Sharing with different schedule clause.

  4. Write a parallel loop that computes the maximum and minimum values in an array using openMP.

  5. Using MPI, Design, develop and run Broadcast communication (MPI_Bcast) using MPI_Send and MPI_Recv.

  6. Write an MPI program to compute the value of Euler's number or Napier's constant (e = 2.718281828459046). Use a suitable collective communication function in it.