Question: #include #include /* The following structure contains the necessary information to allow the function dotprod to access its input data and place its output so

#include  #include  /* The following structure contains the necessary information to allow the function "dotprod" to access its input data and place its output so that it can be accessed later. */ typedef struct { double *a; double *b; double sum; int veclen; } DOTDATA; // int VECLEN = 1000000; DOTDATA dotstr; /* We will use a function (dotprod) to perform the scalar product. All input to this routine is obtained through a structure of type DOTDATA and all output from this function is written into this same structure. While this is unnecessarily restrictive for a sequential program, it will turn out to be useful when we modify the program to compute in parallel. */ void dotprod() { /* Define and use local variables for convenience */ int start, end, i; double mysum, *x, *y; start=0; end = dotstr.veclen; x = dotstr.a; y = dotstr.b; /* Perform the dot product and assign result to the appropriate variable in the structure. */ mysum = 0; for (i=start; i 

Modify dots1.c so that it will take the value for VECLEN from an argument. That is, to run the program (the executable is dots).

time ./dots1 1000000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!