Code Monkey home page Code Monkey logo

syspro2's Introduction

This is the second of the total three assignments for the Systems Programming Course during my B.Sc in Informatics and Telecommunications. It is based on my first assignment.

Short Description:

The main purpose here, is to convert the monitor application to a server-client service. The server creates a number of children monitor-applications, which are responsible to answer all the user travel requests made to the server after that moment. The main goal here is to practice on fork-exec usage to create a multi-processing server. The communication between the entities is achieved through named pipes, while the application must also handle a set of different POSIX signals. The pipe messages are based on a custom communication protocol, with fixed-size packets. Each packet has a 2-byte header and a payload whose size is determined by the user.

Requirements:

  • Ubuntu-based linux distribution (Developed in Ubuntu 20.04 LTS)
  • GCC 7.5.0 or newer
  • GNU Make 4.2.1
  • Bash shell

Details & How to run:

You can run everything, in the root path of the project, using the Makefile. Type make help for all the available options. You can also run both the script and application with the appropriate make rules. All the run parameters can be changed through the Makefile.

Bash-Script:

You first need to produce an input_dir directory which contains subdirectories named after countries. Each country has a number of input record-files for the main application. For this purpose you need the citizenRecordsFile

To do this you have two options:

  1. make scriptRun or
  2. ./create_infiles.sh [citizenRecordsFile] [input_dir] [numFilesPerDirectory]

Notes: citizenRecordsFile is case-sensitive, however, it can be modified in the create_infiles.sh. input_dir is the target directory with the final input files for the main application. Number of files per directory is at least 1.

Application:

The application reads all the input files in the given input_dir. The server is responsible to spread the workload - based on countries - evenly among the available monitors. Each monitor initiates its database after reading its assigned record files. Afterwards, it notifies the server of its progress and sends a portion of its data to it. This data works as cache, and is used to answer user-requests fast, using only server resources. In case this cache fails to answer a request the server needs to promote the request to some or all the available monitors and wait the for the reply. The UI is sollely achieved through the server, via a terminal-menu. You can type /help to get all the available commands when using the application.

The above can be tested by compiling with make or make all. Then, run the application with:

  1. make run or
  2. ./travelMonitor -m [numMonitors] -b [bufferSize] -s [sizeOfBloom] -i [input_dir]

Notes:

  • All arguments are mandatory, case and order sensitive.
  • bufferSize is the number of bytes used in the custom communication protocol in the pipes.
  • Minimum sizeOfBloom is 1, optimal 1000 (for the current input file) and maximum tested is 100K bytes.
  • input_dir must be the same string as the argument given to the create_infiles.sh.
  • You can also run with make valgrind rule. It has been tested for multiple leak types.

Copyright and License:

© 2021 John Fotis
This project is licensed under the MIT License

syspro2's People

Contributors

john-fotis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.