Credits
6
Types
Compulsory
Requirements
This subject has not requirements
, but it has got previous capacities
Department
CS;DAC
Web
https://mwiki.fib.upc.edu/cpds-miri
Following a set of introductory sessions, the course has three modules: concurrency, parallelism and distribution. The student has to select two of the three modules. The lectures are complemented with programming exercices to illustrate the problems and evaluate the solutions.
Teachers
Person in charge
- Jordi Guitart Fernandez ( jguitart@ac.upc.edu )
Others
- Jorge Castro Rabal ( castro@cs.upc.edu )
- Josep Ramon Herrero Zaragoza ( josepr@ac.upc.edu )
Weekly hours
Theory
2
Problems
0
Laboratory
2
Guided learning
0.5
Autonomous learning
8
Competences
Computer networks and distributed systems
High performance computing
Generic
Teamwork
Reasoning
Objectives
-
Understand the definition of distributed system and its possible applications, as well as challenges to be faced to design and implement it.
Related competences: CEE2.1, CG5,
Subcompetences- Know the possible applications of a distributed system
- Understand the challenges to design and implement a distributed system: heterogeneity, lack of global view, concurrency, lack of a single point of control, security, asynchrony, openness, transparency, fault tolerance, scalability
- Put examples of distributed systems
- Understand the definition of distributed system
-
Understand the problem of time and events ordering in a distributed system and explain and implement the mechanisms of logic clocks to attack this problem and algorithms to synchronize physical clocks in a distributed system.
Related competences: CEE2.3, CEE2.1,
Subcompetences- Understand the problem of time and events ordering in a distributed system
- Explain and implement logical clocks mechanisms to attack this problem: happened-before relation, Lamport logical clocks (scalar, vector)
- Explain and implement algorithms to synchronize physical clocks in a distributed system: Cristian (NTP), Berkeley
-
Understand the problem of obtaining a consistent global state in a distributed system and explain the distributed snapshot mechanism to attack this problem, as well as define predicates for global assessment of properties in a distributed system.
Related competences: CEE2.3, CEE2.1,
Subcompetences- Understand the problem of obtaining a consistent global state in a distributed system
- Define global predicates for evaluating properties in a distributed system: properties of predicates (stability), occurrence of predicates (possibly, definitely)
- Explain the Chandy and Lamport's mechanism of distributed snapshot to attack this problem
-
Describe, compare and implement algorithms for the coordination of processes in a distributed system, including the coordination necessary for leader election, multicast group communication and consensus.
Related competences: CEE2.3, CEE2.1, CTR3,
Subcompetences- Describe, compare, and implement algorithms for the coordination of processes in a distributed system for multicast group communication: basic reliable multicast, scalable reliable multicast, ordered multicast (FIFO, causal, total), atomic multicast
- Describe, compare, and implement algorithms for the coordination of processes in a distributed system to ensure consensus: the two army problem, Dolev & Strong's algorithm, the Byzantine generals problem, Paxos
- Describe, compare, and implement algorithms for the coordination of processes in a distributed system for the election of leader: Bully, Chang & Roberts, Ring
-
Understand the problem of concurrent execution of transactions and describe, compare, and implement different concurrency control mechanisms.
Related competences: CEE2.3, CEE2.1, CTR6,
Subcompetences- Describe, compare, and implement different concurrency control mechanisms: two-phase locking (including deadlock detection and treatment), optimistic concurrency control, timestamp ordering
- Understand the problem of concurrent execution of transactions: lost update, inconsistent retrievals, serial equivalence, recovery of aborts (dirty read, write premature)
-
Extend the concept of transaction, the commit protocol, and the concurrency control mechanisms in a distributed system.
Related competences: CEE2.3, CEE2.1,
Subcompetences- Extend concurrency control mechanisms in a distributed system: two-phase locking (including distributed deadlock detection and treatment), optimistic concurrency control, timestamp ordering
- Extend the concept of transaction in a distributed system
- Describe, compare, and implement various distributed commit protocols: one and two-phase
-
Understand the application of replication in a distributed system, as well as the consistency problems introduced, and describe the corresponding consistency models and their implementation.
Related competences: CEE2.3, CEE2.1,
Subcompetences- Describe specific implementations of consistency models: primary-based protocols (remote-write, local-write) and replicated-write protocols (active replication, quorum-based protocols)
- Describe the data-centric strong consistency models: strict, linearizability, sequential
- Describe the data-centric relaxed consistency models: usage of synchronization variables
- Understand the application of replication in a distributed system, in addition to the consistency problems introduced
- Describe the client-centric consistency models: eventual, monotonic-read, monotonic-write, read-your-writes, writes follow-reads
-
Understand the problem of concurrent access to resources by different agents (threads, processors), and the design principles to ensure a correct coordination to avoid deadlocks
Related competences: CG1, CEE4.2,
Subcompetences- Use the formalism of transition systems to describe the semantics of a concurrent system. Employ a modeling tool to analyze properties.
- Understand the modeling of a concurrent system, the description and analysis of properties.
- Understand and carry out the modeling of a concurrent system using a formal model, and analyze its properties.
- Understand the fundamental features to be addressed in a concurrent system: mutual exclusion, critical sections, interference, and the primitives for the design of concurrent programs.
-
Understand the design of concurrent programs for shared memory architectures
Related competences: CEE2.3, CEE4.2, CTR3,
Subcompetences- Understand the definition of thread, and the design of concurrent programs that use threads. Understand the basic primitives available in a modern programming language (like Java) to ensure proper coordination between threads.
- Understand the problems of interference and blocking in a concurrent system as well as designing concurrent programs free of these problems.
- Understand and apply the techniques offered by modern programming languages for the design of concurrent programs: threads, semaphores, critical sections, monitors and synchronization variables.
-
Understand the design of concurrent programs for message-passing architectures
Related competences: CEE2.3, CEE2.1, CEE4.2, CTR3,
Subcompetences- Apply various design patterns of concurrent systems on a message passing architecture: client-server, filter pipeline, worker-supervisor, advertiser-listener.
- Understand the paradigm of message-passing programming languages ​​like Erlang. Understand the concept of process in Erlang, and the design of simple / medium-sized programs in Erlang.
- Design solutions based on message passing architecture for known problems, such as sorting by quicksort.
-
Understand and measure the potential parallelism available in a sequential application and the performance achieved with its parallel implementation
Related competences: CG1, CEE4.2,
Subcompetences- Understand the performance of a parallel application and the overhead factors that contribute to its degradation
- Understand the concept of task graph and how to measure potential parallelism
- Use of instrumentation, visualization and analysis tools to understand parallelism and performance
-
Decide the most appropriate decomposition strategy to express parallelism in an application
Related competences: CEE4.2, CTR3, CTR6, CG5,
Subcompetences- Given a task decomposition, decide task ordering and data sharing constrains that guarantee dependencies
- Given a data decomposition, decide communication requirements and the use of either point-to-point or collective operations to implement them
- Use of task and data decomposition
-
Specify, using the appropriate programming paradigm, an efficient parallel version that corresponds to a certain task/data decomposition
Related competences: CEE4.2, CTR3, CTR6, CG5,
Subcompetences- Use of the message-passing interface (MPI) for computation/data intensive applications in distributed-memory architectures
- Use of CUDA to offload computation and transfer data for accelerator-based architectures
Contents
-
Transition systems and process algebra
Transition systems and primitive processes. Operations prefix and choice. Concurrent processes and their implementation. Description of the LTS system. Implementation in Java and Erlang. -
Understanding parallelism
Introduction to parallel architectures: shared- and distributed-memory architectures and accelerators. Task graph: nodes and edges. Metrics. Speed-up and efficiency. Amdahl law. -
Concepts underlying distributed systems
Definition of a distributed system. Potential applications of a distributed system. Examples of distributed systems. Challenges to design and implement a distributed system: heterogeneity, security, lack of global view, concurrency, lack of a single point of control, asynchrony, openness transparency, fault tolerance, scalability. -
Safety and liveness properties
Description and examples of safety properties and deployment in LTS. Description of liveness properties, especially the progress property and implementation in LTS. -
Concurrent objects, mutual exclusion and synchronization conditions. The deadlock problem.
Problem of destructive interference. Locks and mutual exclusion. Modeling of traffic lights and monitors and of the problem of overlapping. Problem of deadlock, analysis by LTS. -
Message passing. Architectures
Message passing. Client / server architecture, other architectures Introduction to.: Pilelines filters, suvervisor / workers, advertiser / listener. Message-passing in Erlang. Design of Erlang in a client / server architecture. -
Predicting and analyzing performance
Use of models and tools to understand parallelism and performance (Tareador, Extrae, Paraver and Dimemas). -
Distributed-memory programming using MPI
Cluster architecture overview. Process creation, identification and termination. Point-to-point vs. collective operations. Synchronous vs. asynchronous communications. -
Programming GPU devices for computation acceleration using CUDA
GPU architecture overview. Decompositions suitable for GPU acceleration. CUDA programming principles. CUDA Parallel Execution Model: host and device. -
Distributed algorithms: Time, global state, coordination, and agreement
Time and events ordering in a distributed system. Logical clocks: happened-before relation, Lamport logical clocks (scalar, vector). Algorithms to synchronize physical clocks in a distributed system: Cristian (NTP), Berkeley. Consistent global state in a distributed system. The Chandy and Lamport's mechanism of distributed snapshot. Global predicates for evaluating properties in a distributed system: properties of predicates (stability), occurrence of predicates (possibly, definitely). Coordination of processes in a distributed system for the election of leader: Bully, Ring. Coordination of processes in a distributed system for multicast group communication: basic reliable multicast, scalable reliable multicast, ordered multicast (FIFO, causal, total), atomic multicast. Coordination of processes in a distributed system to ensure consensus: the two army problem, Dolev & Strong's algorithm, the Byzantine generals problem, Paxos -
Distributed shared data: Transactions, consistency, and replication
Concurrent execution of transactions: lost update, inconsistent retrievals, serial equivalence, recovery of aborts (dirty read, write premature). Concurrency control mechanisms: two-phase locking (including deadlock detection and treatment), optimistic concurrency control, timestamp ordering. Distributed transaction. Distributed commit protocols: one and two-phase. Concurrency control mechanisms in a distributed system: two-phase locking (including distributed deadlock detection and treatment), optimistic concurrency control, timestamp ordering. Replication and consistency in a distributed system. Data-centered strong consistency models: strict, linearizability, sequential. Data-centric relaxed consistency models: usage of synchronization variables. Client-centric consistency models: eventual, monotonic-read, monotonic-write, read-your-writes, writes follow-reads. Implementations of consistency models: primary-based protocols (remote-write, local-write) and replicated-write protocols (active replication, quorum-based protocols)
Activities
Activity Evaluation act
Concurrency, parallelism and distribution: fundamental concepts
Class preparation with the help of the support material. Understanding and assimilation of the lesson contents and their subsequent applicationObjectives: 1 8 11
Contents:
Theory
6h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
12h
First chosen module: Concurrency or Parallelism or Distribution
Class preparation with the help of the support material. Understanding and assimilation of the lesson contents associated to the corresponding module and their subsequent application in the practical sessions.
Theory
10h
Problems
0h
Laboratory
10h
Guided learning
0h
Autonomous learning
30h
Second chosen module: Concurrency or Parallelism or Distribution
Class preparation with the help of the support material. Understanding and assimilation of the lesson contents associated to the corresponding module and their subsequent application in the practical sessions.
Theory
10h
Problems
0h
Laboratory
10h
Guided learning
0h
Autonomous learning
30h
Module I: Concurrency
Class preparation with the help of the support material. Understanding and assimilation of the lesson contents associated to Module I (concurrency) and their subsequent application in the practical sessions.Objectives: 8 9 10
Contents:
Theory
0h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
0h
Module II: Parallelism
Class preparation with the help of the support material. Understanding and assimilation of the lesson contents associated to Module II (parallelism) and their subsequent application in the practical sessions.Objectives: 11 12 13
Contents:
Theory
0h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
0h
Module III: Distribution
Class preparation with the help of the support material. Understanding and assimilation of the lesson contents associated to Module III (distribution) and their subsequent application in the practical sessions.Objectives: 1 2 3 4 5 6 7
Contents:
Theory
0h
Problems
0h
Laboratory
0h
Guided learning
0h
Autonomous learning
0h
First chosen module: Exam preparation
General review and final exam preparationObjectives: 1 2 3 4 5 6 7 8 9 10 11 12 13
Contents:
- 3 . Concepts underlying distributed systems
- 10 . Distributed algorithms: Time, global state, coordination, and agreement
- 11 . Distributed shared data: Transactions, consistency, and replication
- 1 . Transition systems and process algebra
- 4 . Safety and liveness properties
- 5 . Concurrent objects, mutual exclusion and synchronization conditions. The deadlock problem.
- 6 . Message passing. Architectures
- 7 . Predicting and analyzing performance
- 2 . Understanding parallelism
- 8 . Distributed-memory programming using MPI
- 9 . Programming GPU devices for computation acceleration using CUDA
Theory
0h
Problems
0h
Laboratory
0h
Guided learning
2h
Autonomous learning
4h
Second chosen module: Exam preparation
General review and final exam preparationObjectives: 1 2 3 4 5 6 7 8 9 10 11 12 13
Contents:
- 3 . Concepts underlying distributed systems
- 10 . Distributed algorithms: Time, global state, coordination, and agreement
- 11 . Distributed shared data: Transactions, consistency, and replication
- 1 . Transition systems and process algebra
- 4 . Safety and liveness properties
- 5 . Concurrent objects, mutual exclusion and synchronization conditions. The deadlock problem.
- 6 . Message passing. Architectures
- 7 . Predicting and analyzing performance
- 2 . Understanding parallelism
- 8 . Distributed-memory programming using MPI
- 9 . Programming GPU devices for computation acceleration using CUDA
Theory
0h
Problems
0h
Laboratory
0h
Guided learning
2h
Autonomous learning
4h
Teaching methodology
During the course there will be two types of activities:a) Activities focused on the acquisition of theoretical knowledge.
b) Activities focused on the acquisition of knowledge through experimentation by implementing and evaluating empirically in the laboratory the mechanisms explained at a theoretical level.
The theoretical activities include participatory lecture classes, which explain the basic contents of the course. The practical activities include seminar laboratories where students implement the mechanisms described in the lectures. The seminars require a preparation by reading the statement and supporting documentation, and a further elaboration of the conclusions in a report.
Evaluation methodology
For each module, there will be an exam (EF) and a lab grade (L). The exam will comprise problems on the theory taught. The lab grade will reflect the work done by the students in the practical assignments. The module final grade will be calculated as follows Mi=0.6*EF+ 0.4*L.The final grade will be calculated as the arithmetic mean of the grades of the two modules taken by the student as follows NF=0.5*M1+ 0.5*M2.
Bibliography
Basic
-
Distributed systems: principles and paradigms
- Tanenbaum, A.S.; Steen, M. van,
Pearson Prentice Hall,
2007.
ISBN: 0136135536
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991003206969706711&context=L&vid=34CSUC_UPC:VU1&lang=ca -
Distributed systems: concepts and design
- Coulouris, G.F.; Dollimore, J.; Kindberg, T.; Blair, G,
Addison-Wesley/Pearson Education,
2012.
ISBN: 0273760599
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991000675069706711&context=L&vid=34CSUC_UPC:VU1&lang=ca -
Concurrency: state models & Java programs
- Magee, J.; Kramer, J,
John Wiley & Sons,
2006.
ISBN: 0470093552
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991003172149706711&context=L&vid=34CSUC_UPC:VU1&lang=ca -
Programming Erlang: software for a concurrent world
- Armstrong, J,
Pragmatic Bookshelf,
2013.
ISBN: 9781937785536
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991004002229706711&context=L&vid=34CSUC_UPC:VU1&lang=ca -
Java concurrency in practice
- Goetz, B.; Peierls, T.; Bloch, J.; Bowbeer, J.; Holmes, D.; Lea, D,
Addison-Wesley,
2006.
ISBN: 0321349601
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991003104049706711&context=L&vid=34CSUC_UPC:VU1&lang=ca -
Introduction to parallel computing
- Grama, A.; Karypis, G.; Kumar, V.; Gupta, A,
Pearson Education,
2003.
ISBN: 0201648652
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991003524559706711&context=L&vid=34CSUC_UPC:VU1&lang=ca
Complementary
-
Erlang programming
- Cesarini, F.; Thompson, S,
O'Reilly,
2009.
ISBN: 9780596518189
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991003712929706711&context=L&vid=34CSUC_UPC:VU1&lang=ca -
The art of multiprocessor programming
- Herlihy, M. [i 3 més],
Morgan Kaufmann Publishers is an imprint of Elsevier,
2021.
ISBN: 9780124159501
https://discovery.upc.edu/discovery/fulldisplay?docid=alma991005136978806711&context=L&vid=34CSUC_UPC:VU1&lang=ca
Previous capacities
Concurrency: Java at the level of classes and objects.Parallelism: basic understanding of parallel architectures, including shared- and distributed-memory multiprocessor systems.
Distribution: understanding of the internal structure and operation of an operating system and computer networks.