#include <stdio.h>#include <stdarg.h>#include <time.h>#include "MacMP.h"#define NINT 1000000000int main(void);void adder(int *, int *, double *, double *);int main ()/* This program calculates the variance of the first 10^9 integers     *//* using both cpus on the dual processor Macintosh.                    *//* To compile with the Absoft C compiler, use:                         *//* acc -A -O adder.c MacMP.c "{SharedLibraries}"MPLibrary -o adder.out */{int n=NINT, n1=NINT/2, n2=NINT, start1=0, start2=NINT/2;clock_t start_program, end_program;double sum11, sum12, sum21, sum22, mean, mesq;int idtask, nproc, nargs=4;typedef void (*aProcPtr)();start_program = clock ();MP_Init(&nproc);/* Use second cpu to compute partial sums for second group */MP_Taskstart(&idtask,(aProcPtr)&adder,&nargs,&n2,&start2,&sum21,&sum22);/* Use main cpu to compute partial sums for first group */adder (&n1, &start1, &sum11, &sum12);/* Wait for second cpu to complete */MP_Taskwait(&idtask);MP_End();/* Add partial sums together */mean = (sum11 + sum21) / n;mesq = (sum12 + sum22) / n;printf("%15d %20.3f %20.3f\n", n, mean, mesq - (mean * mean));end_program = clock ();printf("\ntime in sec: %7.2f\n", (end_program-start_program)/60.);return 1;}voidadder (int *n, int *start, double *s1, double *s2){int i;double ls1 = 0.0, ls2 = 0.0;for (i=(*start);i<(*n);i++)   {      ls1+=(double) i;      ls2+=(double) i*i;   }*s1 = ls1;*s2 = ls2;}