Lab Writeup Answer the following questions in the comment box on Moodle: 1. What
ID: 3589734 • Letter: L
Question
Lab Writeup Answer the following questions in the comment box on Moodle: 1. What is the compiler option to enable level 2 optimization? 2. What is the compiler option to define a macro called CAPACITY with a value of 100? 3. Give the compiler line which will create an executable called 'lab1-18' from a source code file called 'lab1 18.cpp' using return-type warnings and pendantic- errors. 4. Look at the man page for g++ and pick one architecture-related compiler option not listed in this lab. Name the option and describe what the man page says it does. 5. What is the purpose of the time utility? 6. How does the time utility differ from the gprof utility? 7. Look at the man page for time. What format token is used to tell time to output the average total memory use of the executable? 8. What compiler option must you use to enable profiling with the gprof utility?Explanation / Answer
1. ANS:
Streamline. Upgrading aggregation takes fairly additional time, and significantly more memory for a vast capacity.
With - O, the compiler tries to lessen code size and execution time, without playing out any advancement that takes a lot of arrangement time
The execution tuning should be founded on a qualified application. You have to ensure the application rightness before you begin the execution tuning. Ordinarily we utilize - O0 alternative in this progression for simple troubleshooting. In the event that your application has just been checked either with GNU* compiler or Intel® C++ compiler, you can begin the following stage for execution tuning.
This alternative empowers advancements for speed. This is the for the most part suggested improvement level. The compiler vectorization is empowered at O2 and larger amounts. With this choice, the compiler plays out some essential circle advancements, in lining of inherent, Intra-document interprocedural enhancement, and most normal compiler improvement advances.
5. ANS:
Time-utility capacity. Time-utility capacities TUFs, likewise called time-esteem capacities) are required for ongoing processing when a due date happens. ... Accordingly, a TUF is a speculation of due date limitations in regular day to day existence. With TUF time requirements, convenience optimality criteria can be determined.
The time utility was extraordinary as there was a dry season and we were offering filtered water at the most minimal cost in the market.
You have to make sense of the time utility and how to respond to it with the goal that you can take full favorable position of it
6. Ans:
The utility 'time' takes a program name as info and showcases data about the planning insights and assets utilized by the program. It demonstrates to what extent an order takes to run. This is helpful on the off chance that you are a designer and you need to test the execution of your program or content
While, Gprof ascertains the measure of time spent in every normal. It enables you to realize where your program invested its energy and which capacities called which different capacities while it was executing. This data can demonstrate to you which bits of your program are slower than you expected, and may be contender for changing to influence your program to execute quicker. It can likewise reveal to you which capacities are being called pretty much frequently than you anticipated. This may enable you to spot bugs that had generally been unnoticed.
HOPE THIS IT WILL BE HELP YOU
THANK YOU
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.