Question: Regarding programming in C Implement a program in C , called distances, that uses OpenMP for parallelization and that: 1 : Reads coordinates of cells

Regarding programming in C
Implement a program in C, called distances, that uses OpenMP for parallelization and that:
1: Reads coordinates of cells from a text file "cells" in the current working directory.
2: Computes the distances between cells counting how often each distance occurs, approximating, i.e. rounding, truncating, or similar, to 2 decimal places.
3:Outputs to stdout a sorted list of distances with associated frequencies (including 0 frequencies at your will).
Your program should accept command line arguments
./distances -t5
The argument to -t give the number of OpenMP threads that you may use. You may only use OpenMP parallelism.
Input
Coordinates are given in a file, in which each row corresponds to one cell. The three coordinates are separated by exactly one blank space. Each coordinate is given exactly as follows: A sign '+' or '-', two digits, a decimal point '.', and three digits. For instance, the following is a valid input of 10 cells.
+01.330-09.035+03.489-03.718+02.517-05.995+09.568-03.464+02.645-09.620+09.279+08.828+07.630-02.290+00.679+04.113-03.399+05.299-00.994+07.313-06.523+03.376-03.614-06.657+01.304+09.381-01.559-04.238-07.514+08.942
Output
A valid output to the above input is
03.00105.54105.85105.91106.07106.54107.94108.58109.40109.59109.65109.98110.00111.18111.68111.77111.98113.46114.02114.11114.77114.78114.96115.07115.38115.71115.78115.84116.75116.94117.33117.63117.66117.72117.79118.00119.02119.10119.31120.65121.67122.00122.31123.85123.981

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!