SuperTutor

(15)

$15/per page/Negotiable

About SuperTutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Business & Finance See all
Accounting,Business & Finance,Economics,Engineering,HR Management,Math Hide all
Teaching Since: Apr 2017
Last Sign in: 327 Weeks Ago, 5 Days Ago
Questions Answered: 12843
Tutorials Posted: 12834

Education

  • MBA, Ph.D in Management
    Harvard university
    Feb-1997 - Aug-2003

Experience

  • Professor
    Strayer University
    Jan-2007 - Present

Category > Programming Posted 18 May 2017 My Price 9.00

thread management and synchronization

I am having a lot of trouble with this assignment. Help would be greatly appreciated

 

Assignment 3: pthreadsThe purpose of this assignment is for you to learn more about•loop schedulers•task schedulers•overhead associated with thread management and synchronizationAs usual all time measurements are to perform on the cluster.Link with the pthread library by passing-lpthread.Both schedulers have a first sequential part where you will build a simple application first; and a secondpart where you will build the scheduler and the parallel application.1Loop SchedulersLoop schedulers are used essentially whenever the code reads like your stereotypical for loop. In the previousassignment, transform would be a stereotypical for loop, but reduce could also be written this way. Here wewill look at a variation on the theme of reduction.1.1Numerical IntegrationNumerical integration is often used when one wants to computeRbaf(x)dxbut one does not know how to finda primitive off. You can use the definition of integration to obtain a simple approximation by computing∑n-1i=0f(a+ (i+.5)*b-an)b-an.nis often called the number of point in the approximation. (This is thenumerical integration using the rectangle rule. You can learn more athttps://en.wikipedia.org/wiki/Numerical_integration.)Note that you do not need to understand numerical integration.The problem is just to evaluate∑n-1i=0f(a+ (i+.5)*b-an)b-anfor particular a particular combination ofa,b,n, andf.Question:Implement a sequential code that compute a numerical integration of a functiondouble f(double)betweenargv[1]andargv[2]usingargv[3]points.Note that if you pickfto be a known function, you can easily check for correctness. (I suggest you pickf(x) = 1.) Also, writing the code so that the integration loop is with integers (over the number of points)will make your life easier in the next part.Question:Write the code so that you can use different functionsfthat have different operation intensitiesargv[4].(An easy way to do that, is to havefstart from a value of 1 and executeargv[4]loops of squaring withpowand square rooting withsqrt.)Question:Report the sequential time it takes on the cluster to integratefusing different number of points(from 101to 108by multiple of 10) and with different operation intensity (from 1 to 103).Make sure you keep this code around as it is your base for comparisons. Also note that a 108points withan operation intensity of 1,000 could take an hour to run.1

Attachments:

Answers

(15)
Status NEW Posted 18 May 2017 08:05 AM My Price 9.00

-----------

Attachments

file 1495095664-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)