#include <stdlib.h>
#include <stdio.h>
+#include "simgrid/instr.h" //TRACE_
+
/******************/
/* default values */
/******************/
/***********************/
/* function prototypes */
/***********************/
-double randlc( double *X, double *A );
+double randlc( double *X, double *A );
void full_verify( global_data* gd );
int nprocs_total,
double t,
double mops,
- char *optype,
+ char *optype,
int passed_verification,
char *npbversion,
char *compiletime,
/************* portable random number generator ************/
/*****************************************************************/
-double randlc( double *X, double *A )
+double randlc( double *X, double *A )
{
static int KS=0;
- static double R23, R46, T23, T46;
- double T1, T2, T3, T4;
- double A1;
- double A2;
- double X1;
- double X2;
- double Z;
- int i, j;
+ static double R23, R46, T23, T46;
+ double T1, T2, T3, T4;
+ double A1;
+ double A2;
+ double X1;
+ double X2;
+ double Z;
+ int i, j;
if (KS == 0)
{
/************* C R E A T E _ S E Q ************/
/*****************************************************************/
-void create_seq( global_data* gd, double seed, double a )
+void create_seq( global_data* gd, double seed, double a )
{
- double x;
- int i, k;
+ double x;
+ int i, k;
k = MAX_KEY/4;
- for (i=0; i<NUM_KEYS; i++)
- {
- x = randlc(&seed, &a);
- x += randlc(&seed, &a);
- x += randlc(&seed, &a);
- x += randlc(&seed, &a);
+ for (i=0; i<NUM_KEYS; i++)
+ {
+ x = randlc(&seed, &a);
+ x += randlc(&seed, &a);
+ x += randlc(&seed, &a);
+ x += randlc(&seed, &a);
gd->key_array[i] = k*x;
- }
+ }
}
1,
MPI_INT,
MPI_COMM_WORLD );
- MPI_Wtime();
/* Determine the receive array displacements for the buckets */
gd->recv_displ[0] = 0;
gd->recv_displ[i] = gd->recv_displ[i-1] + gd->recv_count[i-1];
- MPI_Wtime();
/* Now send the keys to respective processors */
MPI_Alltoallv( gd->key_buff1,
gd->send_count,
break;
case 'A':
if( i <= 2 )
- {
+ {
if( key_rank != gd->test_rank_array[i]+(iteration-1) )
failed = 1;
else
gd->passed_verification++;
- }
+ }
else
{
if( key_rank != gd->test_rank_array[i]-(iteration-1) )
break;
case 'B':
if( i == 1 || i == 2 || i == 4 )
- {
+ {
if( key_rank != gd->test_rank_array[i]+iteration )
failed = 1;
else
gd->passed_verification++;
- }
+ }
else
{
if( key_rank != gd->test_rank_array[i]-iteration )
break;
case 'C':
if( i <= 2 )
- {
+ {
if( key_rank != gd->test_rank_array[i]+iteration )
failed = 1;
else
gd->passed_verification++;
- }
+ }
else
{
if( key_rank != gd->test_rank_array[i]-iteration )
break;
case 'D':
if( i < 2 )
- {
+ {
if( key_rank != gd->test_rank_array[i]+iteration )
failed = 1;
else
gd->passed_verification++;
- }
+ }
else
{
if( key_rank != gd->test_rank_array[i]-iteration )
timer_start(gd, 2 );
#endif
+ char smpi_category[100];
+ snprintf (smpi_category, 100, "%d", gd->my_rank);
+ TRACE_smpi_set_category (smpi_category);
+
/* This is the main iteration */
for( iteration=1; iteration<=MAX_ITERATIONS; iteration++ )
{
if( gd->my_rank == 0 && CLASS != 'S' ) printf( " %d\n", iteration );
rank(gd, iteration );
}
-
+ TRACE_smpi_set_category (NULL);
#ifdef TIMING_ENABLED
timer_stop(gd, 2 );