Commit b0dd4967 authored by Francois Tessier's avatar Francois Tessier

Remove the BT-IO benchmark

parent 0fd7c143
SHELL=/bin/sh
BENCHMARK=bt
BENCHMARKU=BT
VEC=
include ../make.inc/Makefile.$(ARCHI)
include config/make.def
OBJS = bt.o make_set.o initialize.o exact_solution.o exact_rhs.o \
set_constants.o adi.o define.o copy_faces.o rhs.o solve_subs.o \
x_solve$(VEC).o y_solve$(VEC).o z_solve$(VEC).o add.o error.o \
verify.o setup_mpi.o \
${COMMON}/print_results.o ${COMMON}/timers.o
include sys/make.common
# npbparams.h is included by header.h
# The following rule should do the trick but many make programs (not gmake)
# will do the wrong thing and rebuild the world every time (because the
# mod time on header.h is not changed. One solution would be to
# touch header.h but this might cause confusion if someone has
# accidentally deleted it. Instead, make the dependency on npbparams.h
# explicit in all the lines below (even though dependence is indirect).
# header.h: npbparams.h
${PROGRAM}: config
@if [ x$(VERSION) = xvec ] ; then \
${MAKE} VEC=_vec exec; \
elif [ x$(VERSION) = xVEC ] ; then \
${MAKE} VEC=_vec exec; \
else \
${MAKE} exec; \
fi
exec: $(OBJS)
@if [ x$(SUBTYPE) = xfull ] ; then \
${MAKE} bt-full; \
elif [ x$(SUBTYPE) = xFULL ] ; then \
${MAKE} bt-full; \
elif [ x$(SUBTYPE) = xtapioca ] ; then \
${MAKE} bt-tapioca; \
elif [ x$(SUBTYPE) = xTAPIOCA ] ; then \
${MAKE} bt-tapioca; \
elif [ x$(SUBTYPE) = xsimple ] ; then \
${MAKE} bt-simple; \
elif [ x$(SUBTYPE) = xSIMPLE ] ; then \
${MAKE} bt-simple; \
elif [ x$(SUBTYPE) = xfortran ] ; then \
${MAKE} bt-fortran; \
elif [ x$(SUBTYPE) = xFORTRAN ] ; then \
${MAKE} bt-fortran; \
elif [ x$(SUBTYPE) = xepio ] ; then \
${MAKE} bt-epio; \
elif [ x$(SUBTYPE) = xEPIO ] ; then \
${MAKE} bt-epio; \
else \
${MAKE} bt-bt; \
fi
bt-bt: ${OBJS} btio.o
${FLINK} ${FLINKFLAGS} -o ${PROGRAM} ${OBJS} btio.o ${FMPI_LIB}
bt-full: ${OBJS} full_mpiio.o btio_common.o
${FLINK} ${FLINKFLAGS} -o ${PROGRAM}.mpi_io_full ${OBJS} btio_common.o full_mpiio.o ${FMPI_LIB}
bt-tapioca: ${OBJS} tapioca.o btio_common.o
${FLINK} ${FLINKFLAGS} -o ${PROGRAM}.tapioca ${OBJS} btio_common.o tapioca.o ${FMPI_LIB}
bt-simple: ${OBJS} simple_mpiio.o btio_common.o
${FLINK} ${FLINKFLAGS} -o ${PROGRAM}.mpi_io_simple ${OBJS} btio_common.o simple_mpiio.o ${FMPI_LIB}
bt-fortran: ${OBJS} fortran_io.o btio_common.o
${FLINK} ${FLINKFLAGS} -o ${PROGRAM}.fortran_io ${OBJS} btio_common.o fortran_io.o ${FMPI_LIB}
bt-epio: ${OBJS} epio.o btio_common.o
${FLINK} ${FLINKFLAGS} -o ${PROGRAM}.ep_io ${OBJS} btio_common.o epio.o ${FMPI_LIB}
.f.o:
${FCOMPILE} $<
.c.o:
${CCOMPILE} $<
bt.o: bt.f header.h npbparams.h mpinpb.h
make_set.o: make_set.f header.h npbparams.h mpinpb.h
initialize.o: initialize.f header.h npbparams.h
exact_solution.o: exact_solution.f header.h npbparams.h
exact_rhs.o: exact_rhs.f header.h npbparams.h
set_constants.o: set_constants.f header.h npbparams.h
adi.o: adi.f header.h npbparams.h
define.o: define.f header.h npbparams.h
copy_faces.o: copy_faces.f header.h npbparams.h mpinpb.h
rhs.o: rhs.f header.h npbparams.h
x_solve$(VEC).o: x_solve$(VEC).f header.h work_lhs$(VEC).h npbparams.h mpinpb.h
y_solve$(VEC).o: y_solve$(VEC).f header.h work_lhs$(VEC).h npbparams.h mpinpb.h
z_solve$(VEC).o: z_solve$(VEC).f header.h work_lhs$(VEC).h npbparams.h mpinpb.h
solve_subs.o: solve_subs.f npbparams.h
add.o: add.f header.h npbparams.h
error.o: error.f header.h npbparams.h mpinpb.h
verify.o: verify.f header.h npbparams.h mpinpb.h
setup_mpi.o: setup_mpi.f mpinpb.h npbparams.h
btio.o: btio.f header.h npbparams.h
btio_common.o: btio_common.f mpinpb.h npbparams.h
fortran_io.o: fortran_io.f mpinpb.h npbparams.h
simple_mpiio.o: simple_mpiio.f mpinpb.h npbparams.h
full_mpiio.o: full_mpiio.f mpinpb.h npbparams.h
tapioca.o: tapioca.f mpinpb.h npbparams.h
epio.o: epio.f mpinpb.h npbparams.h
clean:
- rm -f *.o *~ mputil* common/*.o
- rm -f npbparams.h core btio.full.out
- rm -f ${HOME}/install/${ARCHI}/bin/bt.*
Building Steps
--------------------
- Edit sys/setparams.c and replace the output directory (filepath) /!\ split the string to comply with fortran rules... /!\
- Build setparams using gcc
- Clean the root directory
- make NPROCS=<#procs> CLASS={A,B,C,D} SUBTYPE=<io method>
c---------------------------------------------------------------------
c---------------------------------------------------------------------
subroutine add
c---------------------------------------------------------------------
c---------------------------------------------------------------------
c---------------------------------------------------------------------
c addition of update to the vector u
c---------------------------------------------------------------------
include 'header.h'
integer c, i, j, k, m
do c = 1, ncells
do k = start(3,c), cell_size(3,c)-end(3,c)-1
do j = start(2,c), cell_size(2,c)-end(2,c)-1
do i = start(1,c), cell_size(1,c)-end(1,c)-1
do m = 1, 5
u(m,i,j,k,c) = u(m,i,j,k,c) + rhs(m,i,j,k,c)
enddo
enddo
enddo
enddo
enddo
return
end
c---------------------------------------------------------------------
c---------------------------------------------------------------------
subroutine adi
c---------------------------------------------------------------------
c---------------------------------------------------------------------
call copy_faces
call x_solve
call y_solve
call z_solve
call add
return
end
This diff is collapsed.
c---------------------------------------------------------------------
c---------------------------------------------------------------------
subroutine setup_btio
c---------------------------------------------------------------------
c---------------------------------------------------------------------
return
end
c---------------------------------------------------------------------
c---------------------------------------------------------------------
subroutine output_timestep
c---------------------------------------------------------------------
c---------------------------------------------------------------------
return
end
c---------------------------------------------------------------------
c---------------------------------------------------------------------
subroutine btio_cleanup
c---------------------------------------------------------------------
c---------------------------------------------------------------------
return
end
c---------------------------------------------------------------------
c---------------------------------------------------------------------
subroutine btio_verify(verified)
c---------------------------------------------------------------------
c---------------------------------------------------------------------
logical verified
verified = .true.
return
end
c---------------------------------------------------------------------
c---------------------------------------------------------------------
subroutine accumulate_norms(xce_acc)
c---------------------------------------------------------------------
c---------------------------------------------------------------------
double precision xce_acc(5)
return
end
c---------------------------------------------------------------------
c---------------------------------------------------------------------
subroutine checksum_timestep
c---------------------------------------------------------------------
c---------------------------------------------------------------------
return
end
c---------------------------------------------------------------------
c---------------------------------------------------------------------
subroutine clear_timestep
c---------------------------------------------------------------------
c---------------------------------------------------------------------
include 'header.h'
include 'mpinpb.h'
integer cio, kio, jio, ix
do cio=1,ncells
do kio=0, cell_size(3,cio)-1
do jio=0, cell_size(2,cio)-1
do ix=0,cell_size(1,cio)-1
u(1,ix, jio,kio,cio) = 0
u(2,ix, jio,kio,cio) = 0
u(3,ix, jio,kio,cio) = 0
u(4,ix, jio,kio,cio) = 0
u(5,ix, jio,kio,cio) = 0
enddo
enddo
enddo
enddo
return
end
/*****************************************************************/
/****** C _ P R I N T _ R E S U L T S ******/
/*****************************************************************/
#include <stdlib.h>
#include <stdio.h>
void c_print_results( char *name,
char class,
int n1,
int n2,
int n3,
int niter,
int nprocs_compiled,
int nprocs_total,
double t,
double mops,
char *optype,
int passed_verification,
char *npbversion,
char *compiletime,
char *mpicc,
char *clink,
char *cmpi_lib,
char *cmpi_inc,
char *cflags,
char *clinkflags )
{
char *evalue="1000";
printf( "\n\n %s Benchmark Completed\n", name );
printf( " Class = %c\n", class );
if( n3 == 0 ) {
long nn = n1;
if ( n2 != 0 ) nn *= n2;
printf( " Size = %12ld\n", nn ); /* as in IS */
}
else
printf( " Size = %3dx %3dx %3d\n", n1,n2,n3 );
printf( " Iterations = %12d\n", niter );
printf( " Time in seconds = %12.2f\n", t );
printf( " Total processes = %12d\n", nprocs_total );
if ( nprocs_compiled != 0 )
printf( " Compiled procs = %12d\n", nprocs_compiled );
printf( " Mop/s total = %12.2f\n", mops );
printf( " Mop/s/process = %12.2f\n", mops/((float) nprocs_total) );
printf( " Operation type = %24s\n", optype);
if( passed_verification )
printf( " Verification = SUCCESSFUL\n" );
else
printf( " Verification = UNSUCCESSFUL\n" );
printf( " Version = %12s\n", npbversion );
printf( " Compile date = %12s\n", compiletime );
printf( "\n Compile options:\n" );
printf( " MPICC = %s\n", mpicc );
printf( " CLINK = %s\n", clink );
printf( " CMPI_LIB = %s\n", cmpi_lib );
printf( " CMPI_INC = %s\n", cmpi_inc );
printf( " CFLAGS = %s\n", cflags );
printf( " CLINKFLAGS = %s\n", clinkflags );
#ifdef SMP
evalue = getenv("MP_SET_NUMTHREADS");
printf( " MULTICPUS = %s\n", evalue );
#endif
printf( "\n\n" );
printf( " Please send feedbacks and/or the results of this run to:\n\n" );
printf( " NPB Development Team\n" );
printf( " npb@nas.nasa.gov\n\n\n" );
/* printf( " Please send the results of this run to:\n\n" );
printf( " NPB Development Team\n" );
printf( " Internet: npb@nas.nasa.gov\n \n" );
printf( " If email is not available, send this to:\n\n" );
printf( " MS T27A-1\n" );
printf( " NASA Ames Research Center\n" );
printf( " Moffett Field, CA 94035-1000\n\n" );
printf( " Fax: 650-604-3957\n\n" );*/
}
#include "mpi.h"
double start[64], elapsed[64];
/*****************************************************************/
/****** T I M E R _ C L E A R ******/
/*****************************************************************/
void timer_clear( int n )
{
elapsed[n] = 0.0;
}
/*****************************************************************/
/****** T I M E R _ S T A R T ******/
/*****************************************************************/
void timer_start( int n )
{
start[n] = MPI_Wtime();
}
/*****************************************************************/
/****** T I M E R _ S T O P ******/
/*****************************************************************/
void timer_stop( int n )
{
double t, now;
now = MPI_Wtime();
t = now - start[n];
elapsed[n] += t;
}
/*****************************************************************/
/****** T I M E R _ R E A D ******/
/*****************************************************************/
double timer_read( int n )
{
return( elapsed[n] );
}
subroutine print_results(name, class, n1, n2, n3, niter,
> nprocs_compiled, nprocs_total,
> t, mops, optype, verified, npbversion,
> compiletime, cs1, cs2, cs3, cs4, cs5, cs6, cs7)
implicit none
character*2 name
character*1 class
integer n1, n2, n3, niter, nprocs_compiled, nprocs_total, j
double precision t, mops
character optype*24, size*15
logical verified
character*(*) npbversion, compiletime,
> cs1, cs2, cs3, cs4, cs5, cs6, cs7
write (*, 2) name
2 format(//, ' ', A2, ' Benchmark Completed.')
write (*, 3) Class
3 format(' Class = ', 12x, a12)
c If this is not a grid-based problem (EP, FT, CG), then
c we only print n1, which contains some measure of the
c problem size. In that case, n2 and n3 are both zero.
c Otherwise, we print the grid size n1xn2xn3
if ((n2 .eq. 0) .and. (n3 .eq. 0)) then
if (name(1:2) .eq. 'EP') then
write(size, '(f15.0)' ) 2.d0**n1
j = 15
if (size(j:j) .eq. '.') j = j - 1
write (*,42) size(1:j)
42 format(' Size = ',9x, a15)
else
write (*,44) n1
44 format(' Size = ',12x, i12)
endif
else
write (*, 4) n1,n2,n3
4 format(' Size = ',9x, i4,'x',i4,'x',i4)
endif
write (*, 5) niter
5 format(' Iterations = ', 12x, i12)
write (*, 6) t
6 format(' Time in seconds = ',12x, f12.2)
write (*,7) nprocs_total
7 format(' Total processes = ', 12x, i12)
write (*,8) nprocs_compiled
8 format(' Compiled procs = ', 12x, i12)
write (*,9) mops
9 format(' Mop/s total = ',12x, f12.2)
write (*,10) mops/float( nprocs_total )
10 format(' Mop/s/process = ', 12x, f12.2)
write(*, 11) optype
11 format(' Operation type = ', a24)
if (verified) then
write(*,12) ' SUCCESSFUL'
else
write(*,12) 'UNSUCCESSFUL'
endif
12 format(' Verification = ', 12x, a)
write(*,13) npbversion
13 format(' Version = ', 12x, a12)
write(*,14) compiletime
14 format(' Compile date = ', 12x, a12)
write (*,121) cs1
121 format(/, ' Compile options:', /,
> ' MPIF77 = ', A)
write (*,122) cs2
122 format(' FLINK = ', A)
write (*,123) cs3
123 format(' FMPI_LIB = ', A)
write (*,124) cs4
124 format(' FMPI_INC = ', A)
write (*,125) cs5
125 format(' FFLAGS = ', A)
write (*,126) cs6
126 format(' FLINKFLAGS = ', A)
write(*, 127) cs7
127 format(' RAND = ', A)
write (*,130)
130 format(//' Please send feedbacks and/or'
> ' the results of this run to:'//
> ' NPB Development Team '/
> ' Internet: npb@nas.nasa.gov'//)
c 130 format(//' Please send the results of this run to:'//
c > ' NPB Development Team '/
c > ' Internet: npb@nas.nasa.gov'/
c > ' '/
c > ' If email is not available, send this to:'//
c > ' MS T27A-1'/
c > ' NASA Ames Research Center'/
c > ' Moffett Field, CA 94035-1000'//
c > ' Fax: 650-604-3957'//)
return
end
//---------------------------------------------------------------------
// This function is C verson of random number generator randdp.f
//---------------------------------------------------------------------
double randlc(X, A)
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;
if (KS == 0)
{
R23 = 1.0;
R46 = 1.0;
T23 = 1.0;
T46 = 1.0;
for (i=1; i<=23; i++)
{
R23 = 0.50 * R23;
T23 = 2.0 * T23;
}
for (i=1; i<=46; i++)
{
R46 = 0.50 * R46;
T46 = 2.0 * T46;
}
KS = 1;
}
/* Break A into two parts such that A = 2^23 * A1 + A2 and set X = N. */
T1 = R23 * *A;
j = T1;
A1 = j;
A2 = *A - T23 * A1;
/* Break X into two parts such that X = 2^23 * X1 + X2, compute
Z = A1 * X2 + A2 * X1 (mod 2^23), and then
X = 2^23 * Z + A2 * X2 (mod 2^46). */
T1 = R23 * *X;
j = T1;
X1 = j;
X2 = *X - T23 * X1;
T1 = A1 * X2 + A2 * X1;
j = R23 * T1;
T2 = j;
Z = T1 - T23 * T2;
T3 = T23 * Z + A2 * X2;
j = R46 * T3;
T4 = j;
*X = T3 - T46 * T4;
return(R46 * *X);
}
c---------------------------------------------------------------------
c---------------------------------------------------------------------
double precision function randlc (x, a)
c---------------------------------------------------------------------
c---------------------------------------------------------------------
c---------------------------------------------------------------------
c
c This routine returns a uniform pseudorandom double precision number in the
c range (0, 1) by using the linear congruential generator
c
c x_{k+1} = a x_k (mod 2^46)
c
c where 0 < x_k < 2^46 and 0 < a < 2^46. This scheme generates 2^44 numbers
c before repeating. The argument A is the same as 'a' in the above formula,
c and X is the same as x_0. A and X must be odd double precision integers
c in the range (1, 2^46). The returned value RANDLC is normalized to be
c between 0 and 1, i.e. RANDLC = 2^(-46) * x_1. X is updated to contain
c the new seed x_1, so that subsequent calls to RANDLC using the same
c arguments will generate a continuous sequence.
c
c This routine should produce the same results on any computer with at least
c 48 mantissa bits in double precision floating point data. On 64 bit
c systems, double precision should be disabled.
c
c David H. Bailey October 26, 1990
c
c---------------------------------------------------------------------
implicit none
double precision r23,r46,t23,t46,a,x,t1,t2,t3,t4,a1,a2,x1,x2,z
parameter (r23 = 0.5d0 ** 23, r46 = r23 ** 2, t23 = 2.d0 ** 23,
> t46 = t23 ** 2)
c---------------------------------------------------------------------
c Break A into two parts such that A = 2^23 * A1 + A2.
c---------------------------------------------------------------------
t1 = r23 * a
a1 = int (t1)
a2 = a - t23 * a1
c---------------------------------------------------------------------
c Break X into two parts such that X = 2^23 * X1 + X2, compute
c Z = A1 * X2 + A2 * X1 (mod 2^23), and then
c X = 2^23 * Z + A2 * X2 (mod 2^46).
c---------------------------------------------------------------------
t1 = r23 * x
x1 = int (t1)
x2 = x - t23 * x1
t1 = a1 * x2 + a2 * x1
t2 = int (r23 * t1)
z = t1 - t23 * t2
t3 = t23 * z + a2 * x2
t4 = int (r46 * t3)
x = t3 - t46 * t4
randlc = r46 * x
return
end
c---------------------------------------------------------------------
c---------------------------------------------------------------------
subroutine vranlc (n, x, a, y)
c---------------------------------------------------------------------
c---------------------------------------------------------------------
c---------------------------------------------------------------------
c
c This routine generates N uniform pseudorandom double precision numbers in
c the range (0, 1) by using the linear congruential generator
c
c x_{k+1} = a x_k (mod 2^46)
c
c where 0 < x_k < 2^46 and 0 < a < 2^46. This scheme generates 2^44 numbers
c before repeating. The argument A is the same as 'a' in the above formula,
c and X is the same as x_0. A and X must be odd double precision integers