Nothing Special   »   [go: up one dir, main page]

Digital Assignment-6: Name: Bejugam Shiva Suprith REG NO: 18BCE0427 Faculty: Narayanamoorthi M SLOT: L59+L60

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

DIGITAL ASSIGNMENT-6

NAME: BEJUGAM SHIVA SUPRITH

REG NO: 18BCE0427

FACULTY: NARAYANAMOORTHI M

SLOT: L59+L60

Q1) Write short notes on performance metrics and bench mark programs of parallel
computing.

Performance metrics :

Performance metrics are defined as figures and data representative of an organization’s


actions, abilities, and overall quality. There are many different forms of performance metrics,
including sales, profit, return on investment, customer happiness, customer reviews, personal
reviews, overall quality, and reputation in a marketplace. Performance metrics can vary
considerably when viewed through different industries.

Performance metrics are integral to an organization's success. It's important that organizations
select their chief performance metrics and focus on these areas because these metrics help
guide and gauge an organization’s success. Key success factors are only useful if they are
acknowledged and tracked. Business measurements must also be carefully managed to make
sure that they give right answers, and that the right questions are being asked.

Traditionally, businesses have viewed the following financial measurements as indicators of


success:

 Return on capital employed or return on investment (ROI)

 Profit

 Market share

 Earnings growth

 Stock price
Non-financial measurements are also useful to help assess, report, and drive success. Most
notably, the Malcolm Baldrige National Quality Award's Criteria for Performance Excellence
non-financial success metrics include:

 Customer satisfaction

 Process excellence

 Employee satisfaction

Organizations across most industries rely on these indicators as well as:

 Fast, responsive time to market

 A loyal customer base

 Outstanding processes for quality and timeliness

 Mechanisms that ensure learning, growth, and continual improvement

Organizations may define their own indicators of performance in key areas. Such metrics are
often useful because they reduce complex measurements and results to a single value that can
be tracked, managed, and improved. These “shortcuts” can be misleading, however, when used
either for process improvement or for other feedback such as promotion, recognition, or
compensation.

Bench mark programs of parallel computing :

Cpu-z :

CPU-Z will provide users with a complete rundown of your PC's hardware specifications,
particularly concerning your CPU.It also provides specifications for your motherboard, RAM,
and graphics card, making it a great all-around program to visualize hardware makes and
models. You can even save a TXT file of the information via the Tools option.

Speccy :

Piriform's Speccy, from the creators of CCleaner, is a favorite among the gaming community for
its simple layout of a PC's hardware configuration.Once it's open, Speccy will provide a
thorough rundown of every component, and most drivers, currently available on your PC.If you
click on the individual parameters on the left-hand side of the window, you'll get even more
information concerning your specific hardware including temperature, voltage, fan speeds, and
more.
Cine bench :

Cine Bench provides one of the most thorough and trusted CPU benchmarks available. It
renders an image---rendering being a task largely undertaken by the CPU---and compares it to
other real-world tests in order to gauge your CPU's performance.

It's as real-world as it gets: while other benchmarks will test your overall PC performance or a
combination of your CPU and GPU, Cine Bench specifically tests all available processor cores of
your CPU. After the test is run, your processor will be graded in points: the higher your points,
the stronger your CPU's performance output.

Real bench :

Real Bench is another example of real-world CPU benchmarking. It uses four tests, all involving
rendering in some capacity: Image Editing, H.264 Video Encoding, OpenCL, and Heavy
Multitasking. You can upload your finding to the Real Bench website to compare where you
stand with other benchmarked hardware configurations. Possibly the best aspect of Real Bench
is that it simulates a regular course load; no stress testing to push your CPU to the max in order
to gauge its performance. Although, of course, stress testing is also an available feature in Real
Bench.

Q2) Write an open MP program using C for the following and discuss your findings.

a)Fibonacci series

Code:

#include <stdio.h>

#include <stdlib.h>

#define N 25

int a[N], b[N], c[N];

#pragma omp declare simd inbranch

int fib( int n )

if (n <= 1)

return n;
else {

return fib(n-1) + fib(n-2);

int main(void)

int i;

#pragma omp simd

for (i=0; i < N; i++) b[i] = i;

#pragma omp simd

for (i=0; i < N; i++) {

a[i] = fib(b[i]);

printf("Done a[%d] = %d\n", N-1, a[N-1]);

return 0;

Output:

b) Factorial of n elements in an array

Code:

#include <stdio.h>
#include <stdlib.h>

#include <omp.h>

int main(void)

int n = 10;

int factorial[n];

factorial[1] = 1;

int *proda;

#pragma omp parallel

int ithread = omp_get_thread_num();

int nthreads = omp_get_num_threads();

#pragma omp single

proda = malloc(nthreads * sizeof *proda);

proda[0] = 1;

int prod = 1;

#pragma omp for schedule(static) nowait

for(int i=2; i<n; i++)

prod *= i;

factorial[i] = prod;

proda[ithread+1] = prod;
#pragma omp barrier

int offset = 1;

for(int i=0; i<(ithread+1); i++) offset *= proda[i];

#pragma omp for schedule(static)

for(int i=1; i<n; i++) factorial[i] *= offset;

free(proda);

for(int i=1; i<n; i++)

printf("%d\n", factorial[i]);

putchar('\n');

Output:

c) Number base conversion of the following: decimal to binary, decimal to octal and decimal
to hexadecimal and vice-versa

code:

#include<stdio.h>

#include<stdlib.h>

#include<omp.h>

long dectobin(int decimalnum)


{

long binarynum = 0;

int rem, temp = 1;

while (decimalnum!=0)

rem = decimalnum%2;

decimalnum = decimalnum / 2;

binarynum = binarynum + rem*temp;

temp = temp * 10;

return binarynum;

int dectooct(int decimalnum)

int octalnum = 0, temp = 1;

while (decimalnum != 0)

octalnum = octalnum + (decimalnum % 8) * temp;

decimalnum = decimalnum / 8;

temp = temp * 10;

}
return octalnum;

void dectohex(long int num) // Function Definition

long int rem[50],i=0,length=0;

while(num>0)

rem[i]=num%16;

num=num/16;

i++;

length++;

printf("Hexadecimal number : ");

for(i=length-1;i>=0;i--)

switch(rem[i])

case 10:

printf("A");

break;

case 11:

printf("B");
break;

case 12:

printf("C");

break;

case 13:

printf("D");

break;

case 14:

printf("E");

break;

case 15:

printf("F");

break;

default :

printf("%ld",rem[i]);

printf("\n");

int main()

int a,b;

char ch[10];

int num;
printf("Enter the number to convert: ");

scanf("%d",&num);

#pragma omp parallel sections

#pragma omp section

a=dectobin(num);

#pragma omp section

b=dectooct(num);

#pragma omp section

dectohex(num);

printf("Equivalent decimal Number: %d \n", a);

printf("Equivalent Octal Number: %d \n", b);

return 0;

}
Output:

(3) Write a program using open MP or MPI to compute the following series:

Sin(x)

Code:

#include<stdio.h>

#include<omp.h>

int main()

int i, n;

float x, sum, t;

printf("Enter the value for x : ");

scanf("%f",&x);

printf("Enter the value for n : ");

scanf("%d",&n);

x=x*3.14159/180;

t=x;

sum=x;

/* Loop to calculate the value of Sine */


#pragma omp for

for(i=1;i<=n;i++)

sum=sum+(t*(-1)x*x)/(2*i(2*i+1));

printf(" The value of Sin(%f) = %.4f",x,sum);

return 0;

Output:

Cos(x)

Code:

#include <bits/stdc++.h>

using namespace std;

const double PI = 3.142;

double cosXSertiesSum(double x, int n)

x = x * (PI / 180.0);

double res = 1;

double sign = 1, fact = 1, pow = 1;


#pragma omp parallel for

for (int i = 1; i < 5; i++)

sign = sign * -1;

fact = fact * (2 * i - 1) *

(2 * i);

pow = pow * x * x;

res = res + sign *

pow / fact;

return res;

// Driver Code

int main()

float x;

int n;

cout<<"enter x ";

cin>>x;

cout<<endl<<"enter n ";

cin>>n;

cout<<endl;

cout << cosXSertiesSum(x, n);

cout<<endl;
return 0;

Output:

You might also like