src/c4/Compare.cc
bool check_global_equiv(unsigned long local_value) {

  const int node = rtt_c4::node();
  const int nodes = rtt_c4::nodes();

  bool pass = false;

  // return true if serial, if not then do check on all processors
  if (nodes == 1)
    pass = true;
  else {
    // value from processor above local processor
    unsigned long neighbors_value = local_value - 1;

    if (node > 0 && node < nodes - 1) {
      rtt_c4::send(&local_value, 1, node - 1, 600);
      rtt_c4::receive(&neighbors_value, 1, node + 1, 600);
      if (local_value == neighbors_value)
        pass = true;
    } else if (node == nodes - 1) {
      rtt_c4::send(&local_value, 1, node - 1, 600);
      pass = true;
    } else if (node == 0) {
      rtt_c4::receive(&neighbors_value, 1, node + 1, 600);
      if (local_value == neighbors_value)
        pass = true;
    } else {
      Insist(0, "Something is wrong with nodes!");
    }
  }

  // sync everything so we don't leave before all processors are finished
  rtt_c4::global_barrier();

  // return result
  return pass;
}
//------------------------------------------------------------------------------------------------//
/*!
 * \brief Function to check the equivalence of an unsigned long across all
 *        processors.
 *
 * This function is (hopefully) a temporary parallel check function that more properly belongs in
 * C4.  It is used to check the equivalence of a given integer across all processors.  This is used
 * for Design By Contract analysis in the Source_Builder codes.
 *
 * \param[in] local_value integer value to check against
 * \return true if equivalent across all processors; false if not
 */
\brief Function to check the equivalence of an unsigned long across all
processors.

This function is (hopefully) a temporary parallel check function that more properly belongs in
C4.  It is used to check the equivalence of a given integer across all processors.  This is used
for Design By Contract analysis in the Source_Builder codes.

\param[in] local_value integer value to check against
\return true if equivalent across all processors; false if not
\ brief Function to check the equivalence of an unsigned long across all processors . This function is ( hopefully ) a temporary parallel check function that more properly belongs in C4 . It is used to check the equivalence of a given integer across all processors . This is used for Design By Contract analysis in the Source_Builder codes . \ param [ in ] local_value integer value to check against \ return true if equivalent across all processors ; false if not
bool check_global_equiv(unsigned long local_value) {
  const int node = rtt_c4::node();
  const int nodes = rtt_c4::nodes();
  bool pass = false;
  if (nodes == 1)
    pass = true;
  else {
    unsigned long neighbors_value = local_value - 1;
    if (node > 0 && node < nodes - 1) {
      rtt_c4::send(&local_value, 1, node - 1, 600);
      rtt_c4::receive(&neighbors_value, 1, node + 1, 600);
      if (local_value == neighbors_value)
        pass = true;
    } else if (node == nodes - 1) {
      rtt_c4::send(&local_value, 1, node - 1, 600);
      pass = true;
    } else if (node == 0) {
      rtt_c4::receive(&neighbors_value, 1, node + 1, 600);
      if (local_value == neighbors_value)
        pass = true;
    } else {
      Insist(0, "Something is wrong with nodes!");
    }
  }
  rtt_c4::global_barrier();
  return pass;
}
bool check_global_equiv ( unsigned long local_value ) { const int node = rtt_c4 :: node ( ) ; const int nodes = rtt_c4 :: nodes ( ) ; bool pass = false ; if ( nodes == 1 ) pass = true ; else { unsigned long neighbors_value = local_value - 1 ; if ( node > 0 && node < nodes - 1 ) { rtt_c4 :: send ( & local_value , 1 , node - 1 , 600 ) ; rtt_c4 :: receive ( & neighbors_value , 1 , node + 1 , 600 ) ; if ( local_value == neighbors_value ) pass = true ; } else if ( node == nodes - 1 ) { rtt_c4 :: send ( & local_value , 1 , node - 1 , 600 ) ; pass = true ; } else if ( node == 0 ) { rtt_c4 :: receive ( & neighbors_value , 1 , node + 1 , 600 ) ; if ( local_value == neighbors_value ) pass = true ; } else { Insist ( 0 , " " ) ; } } rtt_c4 :: global_barrier ( ) ; return pass ; }
\brief Function to check the equivalence of an unsigned long across all
        processors.
\ brief Function to check the equivalence of an unsigned long across all processors .
// return true if serial, if not then do check on all processors // value from processor above local processor // sync everything so we don't leave before all processors are finished // return result