void BEGIN_MODULE() { BEGIN_General(); BEGIN_Memory(); BEGIN_Heap(); BEGIN_DynArray(); BEGIN_Lists(); BEGIN_Strings(); BEGIN_Texts(); BEGIN_StringMem(); BEGIN_Idents(); BEGIN_Sets(); BEGIN_SetsC(); BEGIN_Relations(); BEGIN_IO(); BEGIN_StdIO(); BEGIN_Layout(); BEGIN_Positions(); BEGIN_Errors(); BEGIN_Sort(); BEGIN_Source(); BEGIN_System(); BEGIN_Checks(); BEGIN_Times(); }
int HPCC_SingleRandomAccess(HPCC_Params *params) { int myRank, commSize; int rv, errCount, rank, failure = 0; double localGUPs; double scl = 1.0 / RAND_MAX; FILE *outputFile = NULL; MPI_Comm comm = MPI_COMM_WORLD; localGUPs = 0.0; MPI_Comm_size( comm, &commSize ); MPI_Comm_rank( comm, &myRank ); srand(time(NULL)); scl *= commSize; /* select a node at random, but not node 0 (unless there is just one node) */ if (1 == commSize) rank = 0; else for (rank = 0; ; rank = (int)(scl * rand())) { if (rank > 0 && rank < commSize) break; } MPI_Bcast( &rank, 1, MPI_INT, 0, comm ); /* broadcast the rank selected on node 0 */ if (myRank == rank) /* if this node has been selected */ rv = HPCC_RandomAccess( params, 0 == myRank, &localGUPs, &failure ); MPI_Bcast( &rv, 1, MPI_INT, rank, comm ); /* broadcast error code */ MPI_Bcast( &localGUPs, 1, MPI_DOUBLE, rank, comm ); /* broadcast GUPs */ MPI_Bcast( &failure, 1, MPI_INT, rank, comm ); /* broadcast failure indication */ errCount = rv; params->SingleGUPs = localGUPs; if (failure) params->Failure = 1; BEGIN_IO( myRank, params->outFname, outputFile); fprintf( outputFile, "Node(s) with error %d\n", errCount ); fprintf( outputFile, "Node selected %d\n", rank ); fprintf( outputFile, "Single GUP/s %.6f\n", localGUPs ); END_IO( myRank, outputFile ); return 0; }
int main(int argc, char *argv[]) { int myRank, commSize; char *outFname; FILE *outputFile; HPCC_Params params; time_t currentTime; void *extdata; MPI_Init( &argc, &argv ); if (HPCC_external_init( argc, argv, &extdata )) goto hpcc_end; if (HPCC_Init( ¶ms )) goto hpcc_end; MPI_Comm_size( MPI_COMM_WORLD, &commSize ); MPI_Comm_rank( MPI_COMM_WORLD, &myRank ); outFname = params.outFname; // !BAM #if 0 /* -------------------------------------------------- */ /* MPI RandomAccess */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of MPIRandomAccess section.\n" ); END_IO( myRank, outputFile ); if (params.RunMPIRandomAccess) HPCC_MPIRandomAccess( ¶ms ); time( ¤tTime ); BEGIN_IO(myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of MPIRandomAccess section.\n" ); END_IO( myRank, outputFile ); /* -------------------------------------------------- */ /* StarRandomAccess */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of StarRandomAccess section.\n" ); END_IO( myRank, outputFile ); if (params.RunStarRandomAccess) HPCC_StarRandomAccess( ¶ms ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of StarRandomAccess section.\n" ); END_IO( myRank, outputFile ); /* -------------------------------------------------- */ /* SingleRandomAccess */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of SingleRandomAccess section.\n" ); END_IO( myRank, outputFile ); if (params.RunSingleRandomAccess) HPCC_SingleRandomAccess( ¶ms ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of SingleRandomAccess section.\n" ); END_IO( myRank, outputFile ); /* -------------------------------------------------- */ /* MPI RandomAccess LCG */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of MPIRandomAccess_LCG section.\n" ); END_IO( myRank, outputFile ); if (params.RunMPIRandomAccess_LCG) HPCC_MPIRandomAccess_LCG( ¶ms ); time( ¤tTime ); BEGIN_IO(myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of MPIRandomAccess_LCG section.\n" ); END_IO( myRank, outputFile ); /* -------------------------------------------------- */ /* StarRandomAccess LCG */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of StarRandomAccess_LCG section.\n" ); END_IO( myRank, outputFile ); if (params.RunStarRandomAccess_LCG) HPCC_StarRandomAccess_LCG( ¶ms ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of StarRandomAccess_LCG section.\n" ); END_IO( myRank, outputFile ); /* -------------------------------------------------- */ /* SingleRandomAccess LCG */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of SingleRandomAccess_LCG section.\n" ); END_IO( myRank, outputFile ); if (params.RunSingleRandomAccess_LCG) HPCC_SingleRandomAccess_LCG( ¶ms ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of SingleRandomAccess_LCG section.\n" ); END_IO( myRank, outputFile ); /* -------------------------------------------------- */ /* PTRANS */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of PTRANS section.\n" ); END_IO( myRank, outputFile ); if (params.RunPTRANS) PTRANS( ¶ms ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of PTRANS section.\n" ); END_IO( myRank, outputFile ); /* -------------------------------------------------- */ /* StarDGEMM */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of StarDGEMM section.\n" ); END_IO( myRank, outputFile ); if (params.RunStarDGEMM) HPCC_StarDGEMM( ¶ms ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of StarDGEMM section.\n" ); END_IO( myRank, outputFile ); /* -------------------------------------------------- */ /* SingleDGEMM */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of SingleDGEMM section.\n" ); END_IO( myRank, outputFile ); if (params.RunSingleDGEMM) HPCC_SingleDGEMM( ¶ms ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of SingleDGEMM section.\n" ); END_IO( myRank, outputFile ); /* -------------------------------------------------- */ /* StarSTREAM */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of StarSTREAM section.\n" ); END_IO( myRank, outputFile ); if (params.RunStarStream) HPCC_StarStream( ¶ms ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of StarSTREAM section.\n" ); END_IO( myRank, outputFile ); /* -------------------------------------------------- */ /* SingleSTREAM */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of SingleSTREAM section.\n" ); END_IO( myRank, outputFile ); if (params.RunSingleStream) HPCC_SingleStream( ¶ms ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of SingleSTREAM section.\n" ); END_IO( myRank, outputFile ); // !BAM // #endif /* -------------------------------------------------- */ /* MPIFFT */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of MPIFFT section.\n" ); END_IO( myRank, outputFile ); if (params.RunMPIFFT) HPCC_MPIFFT( ¶ms ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of MPIFFT section.\n" ); END_IO( myRank, outputFile ); // !BAM // #if 0 /* -------------------------------------------------- */ /* StarFFT */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of StarFFT section.\n" ); END_IO( myRank, outputFile ); if (params.RunStarFFT) HPCC_StarFFT( ¶ms ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of StarFFT section.\n" ); END_IO( myRank, outputFile ); /* -------------------------------------------------- */ /* SingleFFT */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of SingleFFT section.\n" ); END_IO( myRank, outputFile ); if (params.RunSingleFFT) HPCC_SingleFFT( ¶ms ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of SingleFFT section.\n" ); END_IO( myRank, outputFile ); // !BAM #endif /* -------------------------------------------------- */ /* Latency/Bandwidth */ /* -------------------------------------------------- */ MPI_Barrier( MPI_COMM_WORLD ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of LatencyBandwidth section.\n" ); END_IO( myRank, outputFile ); if (params.RunLatencyBandwidth) main_bench_lat_bw( ¶ms ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of LatencyBandwidth section.\n" ); END_IO( myRank, outputFile ); // !BAM #if 0 /* -------------------------------------------------- */ /* HPL */ /* -------------------------------------------------- */ BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile, "Begin of HPL section.\n" ); END_IO( myRank, outputFile ); if (params.RunHPL) HPL_main( argc, argv, ¶ms.HPLrdata, ¶ms.Failure ); time( ¤tTime ); BEGIN_IO( myRank, outFname, outputFile); fprintf( outputFile,"Current time (%ld) is %s\n",(long)currentTime,ctime(¤tTime)); fprintf( outputFile, "End of HPL section.\n" ); END_IO( myRank, outputFile ); // !BAM #endif hpcc_end: HPCC_Finalize( ¶ms ); HPCC_external_finalize( argc, argv, extdata ); MPI_Finalize(); return 0; }