Home > Software engineering >  What does this formula mean in quad_mpi.c?
What does this formula mean in quad_mpi.c?

Time:10-20

double f ( double x )
{
  double pi;
  double value;

  pi = 3.141592653589793;
  value = 50.0 / ( pi * ( 2500.0 * x * x   1.0 ) );

  return value;
}

This part of code quad_mpi.c I don't know what the value is. I thought it was a formula for finding pi, but it already has pi. I'm trying to read all quad_mpi.c but it's so hard for me. quad_mpi.c

CodePudding user response:

From the link you posted, the literal purpose of this function is to: "Purpose: F evaluates the function".

/******************************************************************************/

double f ( double x )

/******************************************************************************/
/*
  Purpose:

    F evaluates the function.
*/
{
  double pi;
  double value;

  pi = 3.141592653589793;
  value = 50.0 / ( pi * ( 2500.0 * x * x   1.0 ) );

  return value;
}

IMO This is an example of a really weak comment block descriptions :)

It appears that it could be used to provide a sample payload ( as described here ) with a known set of attributes (i.e. memory usage, run-time duration, etc) as part of an approach to benchmark or in some other way verify the functionality of your parallel processing design. i.e. a payload that is distributed, does something and returns a response from several locations in your distributed network of uPs

  • Related