Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Description This element of assessment consists of three questions. The source code needed is provided in the 'coursework' directory of the module's Github repository (https:/lgithub.com/kelefouras/COMP1001/treeewversion/COMP1001-master/COURSEWORK
Description This element of assessment consists of three questions. The source code needed is provided in the 'coursework' directory of the module's Github repository (https:/lgithub.com/kelefouras/COMP1001/treeewversion/COMP1001-master/COURSEWORK ). 1. Download the q1.cpp file from the module's Github page. A. Amend the above program so as to print the FLOPs (Floating Point Operations per Second) value achieved by the q10 routine. The FLOPs value is given by the following formula FLOPS =(2xN2)/Ex. Time, where N is the input size and Ex. Time is the execution time of the q10) routine [5 Marks]. B. Make a graph of Ex. Time vs N and a graph of FLOPs vs N, where N=[100,400,800, 1600,3000,6000,8000,10000,12000. The FLOPs and Ex. Time values must be shown in the y-axis while the N value must be shown in the x-axis [5 Marks]. C. Explain the two graphs in task B (in no more than 3 lines). For example, why the FLOPs value is decreased as N increases? Why the Ex.Time does not increase in a linear way? [10 Marks] D. Amend this program to allocate all the arrays dynamically, by using malloc() function. This should be implemented in a separate routine [10 Marks] E. Write a script in Linux (.sh file) which automates the experimental procedure of step B [10 Marks]. The script should do the following: - Print a message such as : This is a script that ... - Compile the q1.cpp program and generate the binary file (executable) - Run the executable by passing the ' N ' and 'Iteration' values as input to the executable, e.g., Jexec 10020. - Repeat the step above for all ' N ' and 'Iteration' values (do not use a loop) Note that question 1.E requires that q1.cpp should be compiled and run in Linux. To
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started