Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

C++ program for taylor series

04/10/2021 Client: muhammad11 Deadline: 2 Day

*Write a parallel program pie.c in C or C++ (pie.cc) for Linux that computes an approximation of the number π using a series with N+1 terms.*

--The series sum is partitioned in T non-overlapping partial sums, each computed by T separate child processes created with the fork() library function.*

--This program demonstrates data parallelism and interprocess communication using pipes. Each child process could perform a (potentially) long computation on a separate CPU (or core). Depending on the computer architecture, the entire computation could reach a speedup close to T.

--Numbers N and T are passed from the shell to the pie program as command line parameters. The main(argc, argv[]) function call gets these parameters (T, N) in argv[1] and argv[2] as strings, respectively. (Element argv[0] contains the program name and we don’t need it.) The first parameter, N, is the upper limit for i in the formula above. The second parameter, T, is the number of child processes that compute partial sums. N should always be greater than T, N>T. Otherwise the program should display an error message and call exit(1).

Use the Nilakantha approximation formula for π: π = 3 + 4/(2*3*4) – 4/(4*5*6) + 4/(6*7*8) - 4/(8*9*10) + …. + k*4/((2*i)* (2*i+1)*( 2*i+2))+... where k = 1 if i is odd and k = -1 if i is even and i goes from 1 to N. The program can be run like this from the shell: ./pie N T .... For instance, ./pie 100 4 This command computes the approximation with 101 terms (starting with term 3) with 4 child processes.

--The parent process iterates with an index variable of type int called j from 0 to T (0≤j

--After ending the loop (above) that created the T child processes, the parent process starts a new loop, with index j from 0 to T (0≤j

--After the second loop ends, the parent process: 1. displays the sum approximating the value of π stored in the accumulator, with a message that reads like: The approximation of pi with N=%d and T=%d processes is %f. (this is a C printf format string, make sure the code displays the actual numbers!) 2. waits for all child processes to end, 3. exits with code 0.

--The child process with index j runs its code in a function called computePartialSum. In this function the child process does this: 1. closes any unnecessary file descriptors (which ones?), 2. reads the values for N,T, and j from the pipe that were written by the parent process, 3. computes the partial sum of the series (as described below), 4. writes the partial sum to the pipe, 5. calls exit(0).

--The child process should NOT rely on global variables to access N, T, and j. These values must be read from the parent process using a pipe. Doing otherwise is considered a mistake.

--For example, if the user runs command ./pie 100 4 then: child process #0 computes the partial sum for i going from 1 to 25, child process #1 computes the partial sum for i going from 26 to 50, child process #2 computes the partial sum for i going from 51 to 75, child process #3 computes the partial sum for i going from 76 to 100

1: A child process with index j (with 0≤j

2: Check for errors when making library such as, fork(), pipe(), etc.

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Homework Master
A Grade Exams
Math Guru
ECFX Market
Supreme Essay Writer
Phd Writer
Writer Writer Name Offer Chat
Homework Master

ONLINE

Homework Master

Hello, I an ranked top 10 freelancers in academic and contents writing. I can write and updated your personal statement with great quality and free of plagiarism

$24 Chat With Writer
A Grade Exams

ONLINE

A Grade Exams

I am known as Unrivaled Quality, Written to Standard, providing Plagiarism-free woork, and Always on Time

$38 Chat With Writer
Math Guru

ONLINE

Math Guru

I have read and understood all your initial requirements, and I am very professional in this task.

$30 Chat With Writer
ECFX Market

ONLINE

ECFX Market

You can award me any time as I am ready to start your project curiously. Waiting for your positive response. Thank you!

$28 Chat With Writer
Supreme Essay Writer

ONLINE

Supreme Essay Writer

You can award me any time as I am ready to start your project curiously. Waiting for your positive response. Thank you!

$39 Chat With Writer
Phd Writer

ONLINE

Phd Writer

You can award me any time as I am ready to start your project curiously. Waiting for your positive response. Thank you!

$21 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

700 word discussion – What were the approaches and inquiries for the discourse framework on eParticipation and simulation exercise as conceptualized by the authors? - Scada distribution management system - Romeo and juliet tattoo - A major depressive disorder is best characterized by _____ - Jobs for melancholic personality - Valentine carol ann duffy - Examples of path based animation - Sierra company manufactures woven blankets and accounts for product - Billionaire card game kmart - The opposite of 0 - Operation management powerpoint slide - The altar george herbert - The story of an hour central idea - Dana dairy products key ratios - Norse gods family tree - Ikea case study consumer behaviour - DQ Reply 15 634 - Questions & Answers - Kimmel center promotional code beauty and the beast - Business Negotiation : International Perspective - Biomes and aquatic ecosystems - George and lennie's dream - Reclaim your heart singapore - Describe what happened on the simulation pane - The war at home one family's fight against ptsd - Stephenson real estate recapitalization case answers - Herbert l smith broward county - Anne sexton snow white analysis - Nurse manager role in reengineering of health care - Dry drayton primary school - Reciprocal inhibition in healthcare - I lit a candle for you today poem - Action on the IOM Report/ WEEK 5 DISCUSSION - Gram stain lab report - Http www ushistory org us 26d asp - Drugged high on alcohol - Chlorofluor mouth rinse reviews - HRM 652 EVALUATING RESULTS AND BENEFITS - Pat maths 4th edition test 4 - Science court living things - Poem barbie doll marge piercy analysis - Theory - I NEED SOMEONE TO EDIT MY COVER LEVER BASED ON THE FEEDBACK - Discussion : 15 hours time limit - Moral corruption in the great gatsby quotes - 3 lags of fiscal policy - Stem and leaf plot questions grade 9 - What is an effort force - Cipani and shock chapter 1 - The Origin of Corn - Golang chat server using Go Rpc Package - Hybrid classes pros and cons - When balance sheet credits exceed the debits on the worksheet - Mri pre screening questionnaire - Kaufman test of educational achievement subtests - Java program - Brandeis online summer courses - Movie review and queation answer assignment(due on 27 hours) - Denver developmental milestones chart - Porsche the cayenne launch case study - Conversations - Jorge company bottles and distributes - Y to delta conversion - Academic philosophy achieved - Unit V Journal - Reducing COPD readmissions in those aged 75-80; legislation/policy 30-day readmission policy - Cash receipts from sales on account have been misappropriated - The Chief of police has asked you to create a PowerPoint presentation based on the research findings. Your presentation consists of the current and future criminal justice technology, examples and the benefits to your department. - Forensic accounting rufus miller hahn - Breaking down a topic brainstorming - How to write a treatment plan social work - The jigsaw classroom aronson pdf - Bison steve hotel terminal password - Shprintze fiddler on the roof - Ap biology cheat sheet - Major diseases afflicting the nervous system - 2 cm diameter pvc pipe - Aftershock beyond the civil war - Gram stain lab report results - San antonio express news e edition olive software exact replica - 24 bus route newcastle - Xicon passive components 800 628 0544 - The 3 lines of defense of the immune system - Citizen kane opening scene analysis - Othello lesson plans pdf - To assess the accuracy of a laboratory scale - Abina and the important men characters - 8 mile music list - William hartnett's a smoke backstage - Fast track couriers assignments - On the spot courier services case study answers - National herbarium of victoria - National electrical code questions - How to find the distance between two genes - A child rolls a ball on a level floor - Areas of ethical conduct in criminal justice - It works global toms shoes - A changing world thesis and outline - The earnings dividends and stock price of shelby - Https theconnection sirva com agent training eld eld