Question: I have the following C * ( cstar ) code: / * Parallel Numerical Integration Program * / #include #include #define numproc 4 0 #define
I have the following Ccstar code:
Parallel Numerical Integration Program
#include
#include
#define numproc
#define numpoints
#define N
#define MESHDIM sqrtnumproc
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 j;
int myindex myrow MESHDIM mycol;
t a myindex b a numproc;
for j ; j numpoints; j
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 ;
and its giving me the following error when I try to compile it:
OPEN numIntegration.c
#define MESHDIM sqrtnumproc
float a b w globalsum answer;
float localsumsNN;
float ffloat t
float localsum ;
float t;
t a myindex b a numproc;
localsum ft;
t w;
localsum w localsum;
localsumsmyrowmycol localsum;
for row ; row MESHDIM; row
for col ; col MESHDIM; col
for row ; row MESHDIM; row
forall i to MESHDIM do
forall j to MESHDIM do
COMPILATION ERRORS
ERROR CODES
Undefined Identifier
;
Wrong Type
Invalid constant defn
Type Identifier Expected
Types
PROGRAM SOURCE FILE IS NOW CLOSED TO ALLOW EDITING
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
