Question: Write a C or C++ program named berkeley.c or berkeley.cpp (executable name should be berkeley) to implement the Berkeley time synchronization algorithm using MPI for
Write a C or C++ program named berkeley.c or berkeley.cpp (executable name should be berkeley) to implement the Berkeley time synchronization algorithm using MPI for communication. The screenshot from jumpshot should be saved as berkeley.pdf. Read the values for the clocks at each processor and the coordinator processor from an input file specified as a command line argument. INPUT TO THE PROGRAM The input will be in the following format: coordinator process rank time for process with rank 0 time for process with rank 1 time for process with rank 2 ... time for process with rank n integer value (an abs(value) which deviated by more than this value is ignored) Example file named berkeley.txt. The content in brackets is not part of the input file. 3 (coordinator process) 16:20 (time at rank 0) 13:58 (time at rank 1) 14:12 (time at rank 2) 09:48 (time at rank 3) 02:12 (Ignore if the time difference between coordinator and another process is more than abs(2:12)) Sample Execution: mpirun -np 4 berkeley berkeley.txt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
