A) Write a small C program that copies data from a file A to a file B byte-by-byte. For different file sizes 1MB - 128MB (doubling the file size in each step), record the time your program requires to complete the file copy when using read() and write() system calls. Generate a graph that depicts the program performance. Use the Unix time(1) command. B) Repeat this experiment, but instead of copying individual bytes, use larger size portions of the file that are copied in each read() and write() system call. For instance, you may choose to copy the file in chunks of 2, 4, 8, ..., 1024 byte units. Use a 128MB file for each test. Generate a performance graph of transfer size vs execution time and interpret your experimental results. What do you observe? Why do you think the system shows the observed behavior? Note: For these programs, it is imperative that file A and file B are located on the local disk. On Linux, the /tmp directory is located on the local file system. You must submit your program, the graphs of the corresponding experiments, and your analysis. Failure to follow this direction will invalidate your results as your home directory is on a network mounted drive and I/O times are influenced by network load. You are asked to run a couple of short experiments. I assume that anyone who is stuck on this will ask questions. Everyone should have taken 3600 and had experience with this sort of stuff, but you might be a bit rusty. It might be helpful to tell you how to create files of specific sizes quickly. Please look at the dd(1) command. That means the dd command in section 1 of the online manual. "man 1 dd" will bring this up. This is a pretty complicated command, but pretty powerful. dd if=/dev/zero of= bs=1M count=1 This will create a 1MB file (exactly) filled with all zeros. The /dev/zero device is a special pseudo-device that returns an infinite number of zeros. As crazy as it seems, it has a use. You can change that blocksize to 2M, 4M, etc. Please delete these files when you are done with them. Note that the assignment REQUIRES that you run this in the /tmp filesystem. Create a directory /tmp/your_name_here and put a copy of your program inside. Create your data files here. Delete the directory when you are done. Please do not leave large files in /tmp. The administration will delete them anyways, but it just makes work for them.
A) Write a small C program that copies data from a file A to a file B byte-by-byte. For different file sizes 1MB - 128MB (doubling the file size in each step), record the time your program requires to complete the file copy when using read() and write() system calls. Generate a graph that depicts the program performance. Use the Unix time(1) command. B) Repeat this experiment, but instead of copying individual bytes, use larger size portions of the file that are copied in each read() and write() system call. For instance, you may choose to copy the file in chunks of 2, 4, 8, ..., 1024 byte units. Use a 128MB file for each test. Generate a performance graph of transfer size vs execution time and interpret your experimental results. What do you observe? Why do you think the system shows the observed behavior? Note: For these programs, it is imperative that file A and file B are located on the local disk. On Linux, the /tmp directory is located on the local file system. You must submit your program, the graphs of the corresponding experiments, and your analysis. Failure to follow this direction will invalidate your results as your home directory is on a network mounted drive and I/O times are influenced by network load. You are asked to run a couple of short experiments. I assume that anyone who is stuck on this will ask questions. Everyone should have taken 3600 and had experience with this sort of stuff, but you might be a bit rusty. It might be helpful to tell you how to create files of specific sizes quickly. Please look at the dd(1) command. That means the dd command in section 1 of the online manual. "man 1 dd" will bring this up. This is a pretty complicated command, but pretty powerful. dd if=/dev/zero of= bs=1M count=1 This will create a 1MB file (exactly) filled with all zeros. The /dev/zero device is a special pseudo-device that returns an infinite number of zeros. As crazy as it seems, it has a use. You can change that blocksize to 2M, 4M, etc. Please delete these files when you are done with them. Note that the assignment REQUIRES that you run this in the /tmp filesystem. Create a directory /tmp/your_name_here and put a copy of your program inside. Create your data files here. Delete the directory when you are done. Please do not leave large files in /tmp. The administration will delete them anyways, but it just makes work for them.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
PLEASE INCLUDE THE graphs of the corresponding experiments AND THE analysis. I have a macbook and use terminal. Please guide me step by step + the answer!!
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education