Write two small programs that contain loops

Assignment Help Programming Languages
Reference no: EM132232701

Question: Objective: Investigation of processes and the resources they use. Our focus is on multicore processors. Usage of ps an top. Preparation: We want to investigate the impact of running CPU and I/O intensive jobs on multi-core processors. For this use your own computer and only then the CS computers If you don't own a computer, you can use any other computer on campus (running linux). Write two small programs that contain loops and run for 5 minutes. The first program, called CPU-bound.c, should just perform simple arithmetic calculations, e.g. a counter. The second program, called IO-bound.c, should perform an I/O operation, e.g., open a file, write a character into the file and close it. Again, this should be done in a loop that will terminate after 5 minutes. Make sure the programs really terminate as we want to avoid having endless processes hogging resources! Read about top and ps and check out what information they provide, e.g., use the man pages to see what options are available.

Experiment 1: (using your computer)

1) Run top and see what processes the system is using. Try to understand what processes are running and interpret the information displayed for each process, i.e. interpret the columns.

2) Now start executing a single instance of your CPU-bound process in the background. Recall that a process can be executed in the background by using the "&", e.g. CPUbound &. Find out how to start a process, stop it, and start it again, run it in the foreground and send it to the background.

3) Next investigate the impact of the CPU-bound program using ps and top.

4) Now start the IO-bound in the background and again check using ps and top its impact. At this point you should have a single instance of both programs executing. What do you notice about the processes' CPU utilization?

5) Repeat the experiments with multiple instances of the processes:

1. Start multiple instances of your CPU-bound program to get the cores working.

a. What do you notice now about your CPU-bound processes?

b. How many instances of your CPU program did you run and what CPU utilization did you observe?

2. Start multiple instances of your UI-bound program.

a. What do you notice now about your mix of processes?

b. How many instances of your IO program should you (did you) run and what CPU utilization did you observe?

6) Once you are sure you can document your findings, kill the processes. How do you find out which processes you should kill? By now you should have figured out how to get the process ID (e.g., using top, ps) and use the man pages on the kill command.

IMPORTANT: Verify that you actually killed your programs!

Experiment 2: Do this only after you are done with Experiment 1, unless you do not own a computer. Gather the information from the experiment on the CS computers. Document differences between the two systems, i.e., did you observe any measurable differences between the CPU and I/O utilization between the target systems?

Deliverables: You need to turn in:

1) All source code of your programs in one tar file (via cscheckin). This means you should used the unix tar command, which will create the tar file called Ass1.tar. This tar file is what you need to turn in using cscheckin.

2) A hardcopy of 1) the assignment sheet as cover page, 2) your source code and 3) the report that shows and explains your findings, i.e. the impact of your executions and how they differ (or not) between the two target computers. Make sure you include screen shots of your programs in execution using ps and top. Your documentation should identify in the screen shots where the values of interest are, e.g., by highlighting, underlining. Make sure you clearly identify the support evidence! This report is the real delivery!

3) AGAIN: Use this assignment sheet as the cover-sheet for the hardcopy!

Reference no: EM132232701

Questions Cloud

How much was the original price of the mower : Josef purchased a lawn mower which was sold at 20% discount. He paid Php 14,500.00 for the lawn mower. How much was the original price of the mower
Write integer describing how raise will affect her paycheck : Mr. Bucham got a weekly raise of $145. If she gets paid every other week, write an integer describing how the raise will affect her paycheck
Create a schema that supports the company business : Create a schema that supports the company's business and processes. Explain and support the database schema with relevant arguments that support the rationale.
How should the comedians standpoint out : While arranging the unit, how toward development an area control flanked by the engineer, hostile to air ship administrators additionally enter experts.
Write two small programs that contain loops : Investigation of processes and the resources they use. Our focus is on multicore processors. Usage of ps an top. Preparation: We want to investigate.
How many different estimating techniques discussed in case : Barbara s firm has done enough research to know the benefits of many techniques that are used for estimation. Every business requires the best method.
Evaluate the requirements of the current project : The article presents multiple estimation techniques that Peter and the estimating group used. The methods are essential in determining the inputs of money.
Discuss the pros and cons of one method of transmission : What concerns should be understood about data communications being sent over wireless networks? Discuss the pros and cons of one method of transmission.
Are you currently using the word software properly : Are you currently using the Word software properly? When you read the article, what is the most striking thing you should never do?

Reviews

Write a Review

Programming Languages Questions & Answers

  Design a program that calculate the percentage

You have been asked to design a program that will allow a teacher to calculate the percentage and the final grade for students in a class

  Create and run the functions in the debug window

Create and run the following functions in the Debug Window. Do not close the Debug Window yet -

  Function to retrieve each of the private data members

Write a class called "Date" with month, day and year as private members. Have constructor that sets default date to 1st January 2000. Have accessor function which retrieves each of the private data members.

  Calculate and display optimal cost for cylindrical container

Compute and display the height and cost of container. Use the following formulas, where V is volume, r is radius, h is the height, and C is the cost.

  Identify two key object-oriented concepts

Identify two key OO concepts and explain them as if you were communicating with a nonprogrammer with a limited technology background, using non-programming, non-computing, real-world analogies.

  Aggregate planning for a bottling companya bottling company

aggregate planning for a bottling companya bottling company has decided to introduce a new line of premium bottled

  Write an hcs12 assembly sequence to load this element

Calculate the effective address of element myarray on our HCS12 system - write an HCS12 assembly sequence to load this element into the D register.

  Write a program that reads a string and outputs

Write a program that reads a string and outputs the number of times each lowercase vowel appears in it. The program must contain a function with one of it's parameters as a string variable and return the number of times each lowercase vowel appear..

  Write multiplication program make positive one-digit integer

Write down program which will aid the elementary school learn multiplication. Use Random object to make two positive one-digit integers.

  Calculate the current commission that the dealer receives

CSDP241 Spring, 2016 - Produce a sequential update program using techniques similar to the program given posted at the end of this homework.

  Develop two packages to accept information

Develop two packages, package1 comprises two classes manager and clerk.both classes having method to accept corresponding information.packages.

  Select a game that can be mapped by an automata

Select a game that can be mapped by an automata. This means the game will have a finite set of states (for whichcertain conditions are true) and an exit condition.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd