Question: Developing an efficient parallel numerical integration program on a 2 - D mesh, as described in textbook Chapter 8 Programming Projects, page 3 0 2
Developing an efficient parallel numerical integration program on a D mesh, as described in textbook Chapter Programming Projects, page
I have the following Ccstar code for this project and it's compiling without issue, but when I try to run it my environment crashes:
Parallel Numerical Integration Program
#include
#include
#define numproc
#define numpoints
#define N
int MESHDIM intsqrtnumproc;
float a b w globalsum answer;
spinlock L;
float localsumsNN;
int i j row, col;
float ffloat t
return sqrt t t;
void Integrateint myrow, int mycol
float localsum ;
float t;
int x;
int myindex myrow MESHDIM mycol;
t a myindex b a numproc;
for x ; x numpoints; x
localsum ft;
t w;
localsum w localsum;
localsumsmyrowmycol localsum;
void meshReduceSum
for row ; row MESHDIM; row
for col ; col MESHDIM; col
localsumsrow localsumsrowcol;
for row ; row MESHDIM; row
localsums localsumsrow;
globalsum localsums;
main
w b anumproc numpoints;
forall i to MESHDIM do
forall j to MESHDIM do
Integratei j;
meshReduceSum;
answer globalsum w fb fa;
cout "Approximation to the value of pi: f
answer;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
