Assignment # 1: Performance Timeline of Flynn Taxonomy
Assignment # 1: Performance Timeline of Flynn Taxonomy
Different computer architectures have been built to exploit this inherent parallelism.
In general, a computer architecture consists of one or more interconnected
processor elements that operate concurrently, solving a single overall problem. The
various architectures can be conveniently described using the stream concept. A
stream is simply a sequence of objects or actions. There are both instruction streams
and data streams, and there are four simple combinations that describe the most
familiar parallel architectures:
# of Scheduling # transistors
Memory function unit (SISD)/Pro (SISD)
Processor Year of
Processor Memory/ distributio (SISD) gramming / vector
Type introduc register n / processor unit paradigm length
tion (SIMD) (MIMD) (SIMD,MIMD) (MIMD) (SIMD)
SISD Intel 8086 1978 X X 1 Dynamic 29K
SIMD CDC Cyber 1981 Memory X 1 X 65535
205
SISD Intel 80286 1982 X X 1 Dynamic 134K
SIMD Cray 2 1985 Register X 5 X 64
SISD Intel 80486 1989 X X 2 Dynamic 1.2M
MIMD Intel i860 1990 X Central 4–28 Shared X
memory
SIMD Cray Y‐ 1991 Register X 16 X 64
MP/C90
SISD HP PA‐RISC 1991 X X 1 Dynamic 580K
7000
SISD MIPS 1992 X X 2 Dynamic 1.1M
R4000
MIMD MIPS 1992 X Distributed 4–64 Shared X
R3000 memory
SISD MIPS 1994 X X 6 Dynamic 3.4M
R8000
ALGORITHM:
K-mean clustering
DESCRIPTION:
K means algorithm is an iterative algorithm that tries to partition the dataset into K
pre-defined distinct non-overlapping subgroups (clusters) where each data point
belongs to only one group. It tries to make the intra-cluster data points as similar as
possible while also keeping the clusters as different (far) as possible. It assigns data
points to a cluster such that the sum of the squared distance between the data
points and the cluster’s centroid (arithmetic mean of all the data points that belong
to that cluster) is at the minimum. The less variation we have within clusters, the
more homogeneous (similar) the data points are within the same cluster.
APPLICATION:
K-Means clustering is used in a variety of examples or business cases in real life, like:
Academic Performance
Based on the scores, students are categorized into grades like A, B, or C.
Diagnostic systems
The medical profession uses k-means in creating smarter medical decision support
systems, especially in the treatment of liver ailments.
Search engines
Clustering forms a backbone of search engines. When a search is performed, the
search results need to be grouped, and the search engines very often use clustering
to do this.
SEQUENTIAL CODE:
(Python)
import numpy as np
from numpy.linalg import norm
class Kmeans:
PRAM MODEL:
MPI IMPLEMENTATION:
(Algorithm)
CODE:
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
#include <assert.h>
// Gather and sum at root all cluster sums for individual processes.
MPI_Reduce(sums, grand_sums, k * d, MPI_FLOAT, MPI_SUM, 0,
MPI_COMM_WORLD);
MPI_Reduce(counts, grand_counts, k, MPI_INT, MPI_SUM, 0,
MPI_COMM_WORLD);
if (rank == 0) {
// Root process computes new centroids by dividing sums per cluster
// by count per cluster.
for (int i = 0; i<k; i++) {
for (int j = 0; j<d; j++) {
int dij = d*i + j;
grand_sums[dij] /= grand_counts[i];
}
}
// Have the centroids changed much?
norm = distance2(grand_sums, centroids, d*k);
printf("norm: %f\n",norm);
// Copy new centroids from grand_sums into centroids.
for (int i=0; i<k*d; i++) {
centroids[i] = grand_sums[i];
}
print_centroids(centroids,k,d);
}
// Broadcast the norm. All processes will use this in the loop test.
MPI_Bcast(&norm, 1, MPI_FLOAT, 0, MPI_COMM_WORLD);
}
// Now centroids are fixed, so compute a final label for each site.
float* site = sites;
for (int i = 0; i < sites_per_proc; i++, site += d) {
labels[i] = assign_site(site, centroids, k, d);
}
MPI_Finalize();
ASSIGNMENT # 3
Transparency:
The distributed systems should be perceived as a single entity by the users or the
application programmers rather than as a collection of autonomous systems, which
are cooperating. The users should be unaware of where the services are located and
also the transferring from a local machine to a remote one should also be
transparent.
The following are the different transparencies encountered in the distributed system.
1. Access Transparency:
Clients should be unaware of the distribution of the files. The files could be
present on a totally different set of servers which are physically distant apart and
a single set of operations should be provided to access these remote as well as
the local files. Applications written for the local file should be able to be executed
even for the remote files. The examples illustrating this property are the File
system in Network File System (NFS), SQL queries, and Navigation of the web.
2. Location Transparency:
Clients should see a uniform file name space Files or groups of files may be
relocated without changing their pathnames. A location transparent name
contains no information about the named object’s physical location. This property
is important to support the movement of the resources and the availability of
services. The location and access transparencies together are sometimes referred
as Network transparency. The examples are File system in NFS and the pages of
the web.
3. Concurrency Transparency:
Users and Applications should be able to access shared data or objects without
interference between each other. This requires very complex mechanisms in a
distributed system, since there exists true concurrency rather than the simulated
concurrency of a central system. The shared objects are accessed simultaneously.
The concurrency control and its implementation is a hard task. The examples are
NFS, Automatic Teller machine (ATM) network.
4. Replication Transparency:
This kind of transparency should be mainly incorporated for the distributed file
systems, which replicate the data at two or more sites for more reliability. The
client generally should not be aware that a replicated copy of the data exists. The
clients should also expect operations to return only one set of values. The
examples are Distributed DBMS and Mirroring of Web pages.
5. Failure Transparency:
Enables the concealment of faults, allowing user and application programs to
complete their tasks despite the failure of hardware or software components.
Fault tolerance is provided by the mechanisms that relate to access transparency.
The distributed system are more prone to failures as any of the component may
fail which may lead to degraded service or the total absence of that service. As
the intricacies are hidden the distinction between a failed and a slow running
process is difficult. Examples are Database Management System.
6. Migration Transparency:
This transparency allows the user to be unaware of the movement of information
or processes within a system without affecting the operations of the users and
the applications that are running. This mechanism allows for the load balancing of
any particular client, which might be overloaded. The systems that implement
this transparency are NFS and Web pages.
7. Performance Transparency:
Allows the system to be reconfigured to improve the performance as the load
varies.
8. Scaling Transparency:
A system should be able to grow without affecting application algorithms.
Graceful growth and evolution is an important requirement for most enterprises.
A system should also be capable of scaling down to small environments where
required, and be space and/or time efficient as required. The best-distributed
system example implementing this transparency is the World Wide Web.
9. Revision transparency:
Vertical growth of the system, this transparency refers to the software revisions
which are not visible to the users.
10. Parallelism transparency:
Parallel activities without users knowing how, when and where they are taking
place.
Clock Synchronization:
Berkeley Centralized Active Time Poor To minimize the Not 1. Server becomes
Algorithm Server and based maximum bottleneck.
on Internal clock difference between
synchronization any two clock (in
approach milliseconds)
Global Distributed No such time Poor To resolve single Not 1. Network should
Averaging server and based point of failure and support broadcast
Algorithm on internal clock to minimize skew facility.
value (in 2. Congestion may
milliseconds) occur due to large
amount of message
passing.
Network Distributed External Clock is Good To minimize Yes 1. Supports in UNIX
Time used as reference propagation time system only
Protocol time server. Based (in milliseconds)
on Multiple time and faster access of
server arranged in correct time value.
levels.
Precision Centralized Master-Slave Good More accuracy then Yes 1. Network should
Time approach where NTP by using GPS support multicasting.
Protocol Master is receiver, order of 2. Intended for
controlled by GPS timing in (in relatively localized
receiver microseconds) system.
The failure of coordinator is observed by time outing the processing while participant
waits to be commended for an action. The behavior of the participant is the same
in waiting and pre-commit states. If timeout occurs there is need to find a new
coordinator which verifies what the state of the participants is. The action of the new
coordinator is depicted on the diagram as the failure step.