Distributed Computing Systems

Slides:



Advertisements
Similar presentations
CS 450 Module R4. R4 Overview Due on March 11 th along with R3. R4 is a small yet critical part of the MPX system. In this module, you will add the functionality.
Advertisements

Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
Utilizing the GDB debugger to analyze programs Background and application.
1 Week 12 FAT32 Utility Operations Guide Classes COP4610 / CGS5765 Florida State University.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
CSE 222 Systems Programming Time, Errors, and File Access Dr. Jim Holten.
CS 333 Introduction to Operating Systems Class 18 - File System Performance Jonathan Walpole Computer Science Portland State University.
Linux+ Guide to Linux Certification, Second Edition
6/24/2015B.RamamurthyPage 1 File System B. Ramamurthy.
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
Distributed Computing Systems Project 1 – Dumpster Diving Due: Tuesday, March 25 th.
Distributed Computing Systems Project 2 – Distributed Shell Due: Friday, April 4 th.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Lucas Bang Lecture 15: Linked data structures.
Lesson 11-Locating, Printing, and Archiving User Files.
Linux Operations and Administration
Linux+ Guide to Linux Certification, Second Edition
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 12: Pointers continued, C strings.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
CS 590 Programming Environments with UNIX. Computer Lab Account Course Homepage
Managing Files. Module 5 Managing Files ♦ Introduction “On a Linux system, everything is a file; if something is not a file, it is a process.” ♦ Topics.
Algorithms  Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Project 6 Unix File System. Administrative No Design Review – A design document instead 2-3 pages max No collaboration with peers – Piazza is for clarifications.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Manage Directories and Files in Linux Part 2. 2 Identify File Types in the Linux System The file types in Linux referred to as normal files and directories.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Files Tutor: You will need ….
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop III - Part B Shell Commands Professional Training.
Sed. Class Issues vSphere Issues – root only until lab 3.
Lab 8 Overview Apache Web Server. SCRIPTS Linux Tricks.
Dynamic Programming & Memoization. When to use? Problem has a recursive formulation Solutions are “ordered” –Earlier vs. later recursions.
Chapter Linux Basics. Acknowledgements This presentation was prepared by – Banyat Settapanich – Bahran Madaen This presentation will be updated later.
Learning basic Unix command It 325 operating system.
Lesson 6-Using Utilities to Accomplish Complex Tasks.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
L071 Introduction to C Topics Compilation Using the gcc Compiler The Anatomy of a C Program Reading Sections
NXT File System Just like we’re able to store multiple programs and sound files to the NXT, we can store text files that contain information we specify.
Learning Unix/Linux Based on slides from: Eric Bishop.
Agenda The Linux File System (chapter 4 in text) Linking Files Hard Links / Symbolic Links Disk Storage Checking for Disk Space (df / du) Archiving (Backing.
What type of project? I tried three type of project and the only one I managed to obtain the results I wanted was this one. It is more flexible and much.
Linux Filesystem Management
Introduction to Unix – CS 21
File System Interface CSSE 332 Operating Systems
Jonathan Walpole Computer Science Portland State University
Chapter 11 Command-Line Master Class
5.13 Recursion Recursive functions Functions that call themselves
Some Linux Commands.
The Command Prompt Commands are the way to “do things” in Unix
Algorithms Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Introduction to C Topics Compilation Using the gcc Compiler
Introduction to C Topics Compilation Using the gcc Compiler
UNIX PROCESSES.
Lab 1 introduction, debrief
Using Linux Commands Lab 3.
LING 408/508: Computational Techniques for Linguists
Fork and Exec Unix Model
Computer Science 2 Hashing
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
Winter 2018 CISC101 12/5/2018 CISC101 Reminders
CSE 333 – Section 3 POSIX I/O Functions.
CISC101 Reminders Assn 3 sample solution is posted.
Functions continued.
Module 6 Working with Files and Directories
ITM 352 Functions.
Review.
SPL – PS1 Introduction to C++.
Race Condition Vulnerability
Presentation transcript:

Distributed Computing Systems Project 1 – Dumpster Diving Due: Sunday, January 24th

Three Utilities rm dv dump “Remove” files to dumpster “Dive” to restore files that were “removed” dump Permanently remove files from dumpster

RM Transparently replace /bin/rm Moves files to “dumpster" directory Actually, just earlier in users PATH Moves files to “dumpster" directory Specified by user in DUMPSTER environment variable Use rename(), link(), unlink(), as appropriate Note, need to pay attention to partitions for file and dumpster Same name? Add extension .1, .2, .3 ... .9 If already .9? Then report dumpster full File permissions, including access times, should be preserved Use the stat(), chmod(), utime(), as appropriate Command line options: f : force complete remove, do not move to dumpster directory r : recurse directories (requires directory commands and traversal)

DV Restore “deleted” files from dumpster to current directory (not origin) Use getcwd() to get current working directory File permissions, including access times, should be preserved Feel free to support any command line options that you think are useful e.g., -a option restores all files with same name, and .1, .2, ... extension

DUMP Permanently remove files from dumpster directory Use unlink() and rmdir(), as appropriate Recursive, until whole dumpster is empty

Linux Must be coded in C or C++ Must work in Linux Specifically, CCC machines Development can be elsewhere, but must ensure works on CCC machines

Hints (1 of 6) See get-opt.c  for help in parsing command line parameters See stat.c for sample code on how to get status (e.g., permissions) information See env.c for sample code on how to (more easily) access environment variables See ls.c for sample code on how to do a directory listing See touch.c for sample code on how to set modification times Other system calls that may be useful: chmod() - change (user, group, other) permissions chown() - change ownerships link() - add a hard link to a file unlink() - delete a file rmdir() - remove a directory remove() - delete a file or directory rename() - change the name or location of a file getcwd() - get current working directory for a process perror()  - print appropriate text-based strings for system call errors access() - can be used to check for existance of a file basename() and dirname() - split full path to dir and filename (warning! can modify incoming string so copy first)

Hints (2 of 6) In general … Proceed incrementally, write SMALL pieces of code first and then test When appropriate, place code in separate function to aid readability and testing e.g., int getExtension(const char *name) Do not worry about efficiency nor elegance initially e.g., static arrays vs. malloc() fine to start Refactor code as appropriate as proceed More than one way to do something e.g., checking partition can be done using the stat() call, looking at st_dev or by doing the rename() call, looking for EXDEV

Hints (3 of 6) Error check all system calls! Can fail for a variety of reasons Can use perror() to print appropriate text-based strings for system call errors Or strerror() Or errno Man pages indicate return values at end

Hints (4 of 6) Suggested development steps: Setup program, take in 1+ arg (argv[1]) and DUMPSTER with getenv() Move file in current working directory to DUMPSTER on same partition using rename() Add check for same name using access(), adding extension .num Add support for single file in another directory (e.g., /tmp), using dirname() and basename() Check if file to be moved is on another partition using stat() with st_dev or EXDEV error set by rename() call For files on another partition, write copy function to move across partitions, using link() and unlink() Modify copy to preserve permissions using stat() and utime() Check if file to be moved is a directory using stat() and S_ISDIR() For directories on another partition, write function to iterate through directory using opendir() and readdir(), providing each file name for moving Parse additional command line arguments (e.g., "-r") using getopt() Modify code to recurse through sub-directories, as appropriate, moving all to DUMPSTER Enable iterations through all filenames passed in Error check many test cases thoroughly

Hints (5 of 6) Final flow of rm may look like: Parse command line arguments Check environment setup (for dumpster) For each file to be removed If file does not exist Report error If file is directory Create directory in dumpster For each file to be removed ... (recursive) If file is on another partition Copy file to dumpster If file is on same partition Link file to dumpster Unlink old file End for

Hints (6 of 6) Already installed on the Zoo lab Or, can install in user space anywhere http://www.cygwin.com/

Experiments Measure time to link()+unlink() or rename() Small operation so repeat and divide Measure throughput (bytes/sec) for copy Large file Use sync() to be sure flushed and not in RAM Put together have per-file cost and per-byte cost. Use to predict time to rm for large dir with many files Measure time for many files (large and small) and compare to predicted

Writeup Design - describe your experiments Programs/scripts (pseudo-code) Number of runs Data recording method System conditions Other … Results - depict your results clearly Tables or graphs At least mean and standard deviation Analysis - interpret the results Describe what results mean How does your prediction match measured? If there is a difference, why do you think there is?

Hand In Source code package Experimental writeup tar and gzip rm.c, dv.c, dump.c Support files (*.h) Makefile Experimental writeup tar and gzip See Web page for turn in instructions

Grading Support for all command line args (10 points) Proper checking of DUMPSTER env (2 points) Support for rename() of single files (5 points) Support for copy and unlink() when needed (15 points) Preserving permissions during copy and unlink() (5 points) Support for directories (10 points) Support for recursive directories (5 points) Support for name collision with .num extension (8 points) Proper working dump (15 points) Proper working dv (15 points) Experiments: Design (4 points) Results (3 points) Analysis (3 points) See rubric on Web page, too