title: MPI Reduce Program is not working, I`m always getting the error as work ( ) identifier not found
body: <pre><code>int myrank,
          numprocs;
      double mytime,   /*variables used for gathering timing statistics*/
          maxtime,
          mintime,
          avgtime;
  
      MPI_Comm_rank(MPI_COMM_WORLD, &amp;myrank);
      MPI_Comm_size(MPI_COMM_WORLD, &amp;numprocs);
      MPI_Barrier(MPI_COMM_WORLD);  /*synchronize all processes*/
      mytime = MPI_Wtime();  /*get time just before work section */
     work();
      mytime = MPI_Wtime() - mytime;  /*get time just after work section*/
      /*compute max, min, and average timing statistics*/
      MPI_Reduce(&amp;mytime, &amp;maxtime, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD);
      MPI_Reduce(&amp;mytime, &amp;mintime, 1, MPI_DOUBLE, MPI_MIN, 0, MPI_COMM_WORLD);
      MPI_Reduce(&amp;mytime, &amp;avgtime, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
      if (myrank == 0) {
          avgtime /= numprocs;
          printf(&quot;Min: %lf  Max: %lf  Avg:  %lf\n&quot;, mintime, maxtime, avgtime);
      }
  </code></pre>
  <p>In here I'm always getting as</p>
  <pre><code>Severity    Code    Description Project File    Line    Suppression State
  Error   C3861   'work': identifier not found    Activity1   C:\Users\Acer\Desktop\Self Study\MPI\Activity1\Activity1.cpp    39
  </code></pre>
  <p>this is a code I got from a tutorial, So I do not have a good knowledge of c++. So please help me in this case. I'm tried this many times.</p>