diff options
Diffstat (limited to 'perform')
-rw-r--r-- | perform/CMakeLists.txt | 20 | ||||
-rw-r--r-- | perform/Makefile.am | 3 | ||||
-rw-r--r-- | perform/Makefile.in | 38 | ||||
-rw-r--r-- | perform/mpi-perf.c | 373 |
4 files changed, 18 insertions, 416 deletions
diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 421caba..0a34677 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_PERFORM ) #----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + +#----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) @@ -119,17 +124,6 @@ IF (H5_HAVE_PARALLEL) TARGET_NAMING (benchpar ${LIB_TYPE}) TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (benchpar PROPERTIES FOLDER perform) - - #-- Adding test for mpi-perf - IF (NOT WIN32) - SET (mpi-perf_SRCS - ${HDF5_PERFORM_SOURCE_DIR}/mpi-perf.c - ) - ADD_EXECUTABLE (mpi-perf ${mpi-perf_SRCS}) - TARGET_NAMING (mpi-perf ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (mpi-perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (mpi-perf PROPERTIES FOLDER perform) - ENDIF (NOT WIN32) ENDIF (HDF5_BUILD_PARALLEL_ALL) ENDIF (H5_HAVE_PARALLEL) @@ -192,9 +186,5 @@ IF (H5_HAVE_PARALLEL) IF (HDF5_BUILD_PARALLEL_ALL) ADD_TEST (NAME PERFORM_benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:benchpar>) - - IF (NOT WIN32) - ADD_TEST (NAME PERFORM_mpi-perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:mpi-perf>) - ENDIF (NOT WIN32) ENDIF (HDF5_BUILD_PARALLEL_ALL) ENDIF (H5_HAVE_PARALLEL) diff --git a/perform/Makefile.am b/perform/Makefile.am index c4720f8..6fe32cf 100644 --- a/perform/Makefile.am +++ b/perform/Makefile.am @@ -37,8 +37,9 @@ h5perf_serial_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # Some programs are not built or run by default, but can be built by hand or by # specifying --enable-build-all at configure time. # Also, some of these programs should only be built in parallel. +# Currently there is no such program. if BUILD_PARALLEL_CONDITIONAL - PARA_BUILD_ALL=benchpar mpi-perf + PARA_BUILD_ALL= endif if BUILD_ALL_CONDITIONAL BUILD_ALL_PROGS=$(PARA_BUILD_ALL) diff --git a/perform/Makefile.in b/perform/Makefile.in index 1f9cfd6..a66a5a8 100644 --- a/perform/Makefile.in +++ b/perform/Makefile.in @@ -90,22 +90,17 @@ CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" -@BUILD_PARALLEL_CONDITIONAL_TRUE@am__EXEEXT_1 = benchpar$(EXEEXT) \ -@BUILD_PARALLEL_CONDITIONAL_TRUE@ mpi-perf$(EXEEXT) +am__EXEEXT_1 = @BUILD_ALL_CONDITIONAL_TRUE@am__EXEEXT_2 = $(am__EXEEXT_1) PROGRAMS = $(bin_PROGRAMS) -benchpar_SOURCES = benchpar.c -benchpar_OBJECTS = benchpar.$(OBJEXT) -benchpar_LDADD = $(LDADD) -benchpar_DEPENDENCIES = $(LIBHDF5) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = chunk_SOURCES = chunk.c chunk_OBJECTS = chunk.$(OBJEXT) chunk_LDADD = $(LDADD) chunk_DEPENDENCIES = $(LIBHDF5) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = dectris_perf_SOURCES = dectris_perf.c dectris_perf_OBJECTS = dectris_perf.$(OBJEXT) dectris_perf_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5) @@ -126,10 +121,6 @@ h5perf_serial_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ iopipe_SOURCES = iopipe.c iopipe_OBJECTS = iopipe.$(OBJEXT) iopipe_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5) -mpi_perf_SOURCES = mpi-perf.c -mpi_perf_OBJECTS = mpi-perf.$(OBJEXT) -mpi_perf_LDADD = $(LDADD) -mpi_perf_DEPENDENCIES = $(LIBHDF5) overhead_SOURCES = overhead.c overhead_OBJECTS = overhead.$(OBJEXT) overhead_LDADD = $(LDADD) @@ -177,11 +168,11 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = benchpar.c chunk.c dectris_perf.c $(h5perf_SOURCES) \ - $(h5perf_serial_SOURCES) iopipe.c mpi-perf.c overhead.c perf.c \ +SOURCES = chunk.c dectris_perf.c $(h5perf_SOURCES) \ + $(h5perf_serial_SOURCES) iopipe.c overhead.c perf.c \ perf_meta.c zip_perf.c -DIST_SOURCES = benchpar.c chunk.c dectris_perf.c $(h5perf_SOURCES) \ - $(h5perf_serial_SOURCES) iopipe.c mpi-perf.c overhead.c perf.c \ +DIST_SOURCES = chunk.c dectris_perf.c $(h5perf_SOURCES) \ + $(h5perf_serial_SOURCES) iopipe.c overhead.c perf.c \ perf_meta.c zip_perf.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ @@ -485,7 +476,8 @@ h5perf_serial_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # Some programs are not built or run by default, but can be built by hand or by # specifying --enable-build-all at configure time. # Also, some of these programs should only be built in parallel. -@BUILD_PARALLEL_CONDITIONAL_TRUE@PARA_BUILD_ALL = benchpar mpi-perf +# Currently there is no such program. +@BUILD_PARALLEL_CONDITIONAL_TRUE@PARA_BUILD_ALL = @BUILD_ALL_CONDITIONAL_TRUE@BUILD_ALL_PROGS = $(PARA_BUILD_ALL) # Define programs that will be run in 'make check' @@ -621,9 +613,6 @@ clean-checkPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -benchpar$(EXEEXT): $(benchpar_OBJECTS) $(benchpar_DEPENDENCIES) $(EXTRA_benchpar_DEPENDENCIES) - @rm -f benchpar$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(benchpar_OBJECTS) $(benchpar_LDADD) $(LIBS) chunk$(EXEEXT): $(chunk_OBJECTS) $(chunk_DEPENDENCIES) $(EXTRA_chunk_DEPENDENCIES) @rm -f chunk$(EXEEXT) $(AM_V_CCLD)$(LINK) $(chunk_OBJECTS) $(chunk_LDADD) $(LIBS) @@ -639,9 +628,6 @@ h5perf_serial$(EXEEXT): $(h5perf_serial_OBJECTS) $(h5perf_serial_DEPENDENCIES) $ iopipe$(EXEEXT): $(iopipe_OBJECTS) $(iopipe_DEPENDENCIES) $(EXTRA_iopipe_DEPENDENCIES) @rm -f iopipe$(EXEEXT) $(AM_V_CCLD)$(LINK) $(iopipe_OBJECTS) $(iopipe_LDADD) $(LIBS) -mpi-perf$(EXEEXT): $(mpi_perf_OBJECTS) $(mpi_perf_DEPENDENCIES) $(EXTRA_mpi_perf_DEPENDENCIES) - @rm -f mpi-perf$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(mpi_perf_OBJECTS) $(mpi_perf_LDADD) $(LIBS) overhead$(EXEEXT): $(overhead_OBJECTS) $(overhead_DEPENDENCIES) $(EXTRA_overhead_DEPENDENCIES) @rm -f overhead$(EXEEXT) $(AM_V_CCLD)$(LINK) $(overhead_OBJECTS) $(overhead_LDADD) $(LIBS) @@ -661,11 +647,9 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchpar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chunk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dectris_perf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iopipe.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-perf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/overhead.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_meta.Po@am__quote@ diff --git a/perform/mpi-perf.c b/perform/mpi-perf.c deleted file mode 100644 index a09d672..0000000 --- a/perform/mpi-perf.c +++ /dev/null @@ -1,373 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * (C) 1995-2001 Clemson University and Argonne National Laboratory. - * - * See COPYING in top-level directory. - * - * This is contributed by Robert Ross to the HDF5 software. - * and was called mpi-io-test.c - */ - -#include "hdf5.h" -#include "H5private.h" -#ifdef H5_HAVE_PARALLEL -/* mpi-perf.c - * - * This is derived from code given to me by Rajeev Thakur. Dunno where - * it originated. - * - * It's purpose is to produce aggregate bandwidth numbers for varying - * block sizes, number of processors, an number of iterations. - * - * This is strictly an mpi program - it is used to test the MPI I/O - * functionality implemented by Romio. - * - * Compiling is usually easiest with something like: - * mpicc -Wall -Wstrict-prototypes mpi-io-test.c -o mpi-io-test - * - * NOTE: This code assumes that all command line arguments make it out to all - * the processes that make up the parallel job, which isn't always the case. - * So if it doesn't work on some platform, that might be why. - */ -/* Modifications: - * Albert Cheng, Apr 30, 20001 - * Changed MPI_File_open to use MPI_COMM_WORLD (was MPI_COMM_SELF). - * Albert Cheng, May 5, 20001 - * Changed MPI_File_seek then MPI_File_write or MPI_File_read to just - * MPI_File_write_at and MPI_File_read_at. Some compiler, e.g., IBM - * mpcc_r does not support MPI_File_seek and MPI_File_read or MPI_File_write. - */ - -#include <stdio.h> -#include <stdlib.h> -#include <fcntl.h> -#ifdef H5_HAVE_UNISTD_H -#include <unistd.h> -#endif -#include <errno.h> -#include <string.h> -#if defined(H5_TIME_WITH_SYS_TIME) -# include <sys/time.h> -# include <time.h> -#elif defined(H5_HAVE_SYS_TIME_H) -# include <sys/time.h> -#else -# include <time.h> -#endif -#include <mpi.h> -#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ -# include <mpio.h> -#endif - - - -/* DEFAULT VALUES FOR OPTIONS */ -int64_t opt_block = 1048576*16; -int opt_iter = 1; -int opt_stripe = -1; -int opt_correct = 0; -int amode = O_RDWR | O_CREAT; -char opt_file[256] = "/tmp/test.out\0"; -char opt_pvfstab[256] = "notset\0"; -int opt_pvfstab_set = 0; - -/* function prototypes */ -static int parse_args(int argc, char **argv); - -extern int errno; - -/* globals needed for getopt */ -extern char *optarg; - -int main(int argc, char **argv) -{ - char *buf, *tmp, *buf2, *tmp2, *check; - int i, j, mynod=0, nprocs=1, err, my_correct = 1, correct, myerrno; - double stim, etim; - double write_tim = 0; - double read_tim = 0; - double read_bw, write_bw; - double max_read_tim, max_write_tim; - double min_read_tim, min_write_tim; - double ave_read_tim, ave_write_tim; - int64_t iter_jump = 0; - int64_t seek_position = 0; - MPI_File fh; - MPI_Status status; - int nchars; - - /* startup MPI and determine the rank of this process */ - MPI_Init(&argc,&argv); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - - /* parse the command line arguments */ - parse_args(argc, argv); - - if (mynod == 0) printf("# Using mpi-io calls.\n"); - - - /* kindof a weird hack- if the location of the pvfstab file was - * specified on the command line, then spit out this location into - * the appropriate environment variable: */ - -#if H5_HAVE_SETENV -/* no setenv or unsetenv */ - if (opt_pvfstab_set) { - if((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0){ - perror("setenv"); - goto die_jar_jar_die; - } - } -#endif - - /* this is how much of the file data is covered on each iteration of - * the test. used to help determine the seek offset on each - * iteration */ - iter_jump = nprocs * opt_block; - - /* setup a buffer of data to write */ - if (!(tmp = (char *) malloc(opt_block + 256))) { - perror("malloc"); - goto die_jar_jar_die; - } - buf = tmp + 128 - (((long)tmp) % 128); /* align buffer */ - - if (opt_correct) { - /* do the same buffer setup for verifiable data */ - if (!(tmp2 = (char *) malloc(opt_block + 256))) { - perror("malloc2"); - goto die_jar_jar_die; - } - buf2 = tmp + 128 - (((long)tmp) % 128); - } - - /* open the file for writing */ - err = MPI_File_open(MPI_COMM_WORLD, opt_file, - MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh); - if (err < 0) { - fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno)); - goto die_jar_jar_die; - } - - /* now repeat the write operations the number of times - * specified on the command line */ - for (j=0; j < opt_iter; j++) { - - /* calculate the appropriate position depending on the iteration - * and rank of the current process */ - seek_position = (j*iter_jump)+(mynod*opt_block); - - if (opt_correct) /* fill in buffer for iteration */ { - for (i=mynod+j, check=buf; i<opt_block; i++,check++) *check=(char)i; - } - - /* discover the starting time of the operation */ - MPI_Barrier(MPI_COMM_WORLD); - stim = MPI_Wtime(); - - /* write out the data */ - nchars = opt_block/sizeof(char); - err = MPI_File_write_at(fh, seek_position, buf, nchars, MPI_CHAR, &status); - if(err){ - fprintf(stderr, "node %d, write error: %s\n", mynod, - strerror(errno)); - } - - /* discover the ending time of the operation */ - etim = MPI_Wtime(); - - write_tim += (etim - stim); - - /* we are done with this "write" iteration */ - } - - err = MPI_File_close(&fh); - if(err){ - fprintf(stderr, "node %d, close error after write\n", mynod); - } - - /* wait for everyone to synchronize at this point */ - MPI_Barrier(MPI_COMM_WORLD); - - /* reopen the file to read the data back out */ - err = MPI_File_open(MPI_COMM_WORLD, opt_file, - MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh); - if (err < 0) { - fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno)); - goto die_jar_jar_die; - } - - - /* we are going to repeat the read operation the number of iterations - * specified */ - for (j=0; j < opt_iter; j++) { - /* calculate the appropriate spot give the current iteration and - * rank within the MPI processes */ - seek_position = (j*iter_jump)+(mynod*opt_block); - - /* discover the start time */ - MPI_Barrier(MPI_COMM_WORLD); - stim = MPI_Wtime(); - - /* read in the file data */ - if (!opt_correct){ - err = MPI_File_read_at(fh, seek_position, buf, nchars, MPI_CHAR, &status); - } - else{ - err = MPI_File_read_at(fh, seek_position, buf2, nchars, MPI_CHAR, &status); - } - myerrno = errno; - - /* discover the end time */ - etim = MPI_Wtime(); - read_tim += (etim - stim); - - if (err < 0) fprintf(stderr, "node %d, read error, loc = %Ld: %s\n", - mynod, mynod*opt_block, strerror(myerrno)); - - /* if the user wanted to check correctness, compare the write - * buffer to the read buffer */ - if (opt_correct && memcmp(buf, buf2, opt_block)) { - fprintf(stderr, "node %d, correctness test failed\n", mynod); - my_correct = 0; - MPI_Allreduce(&my_correct, &correct, 1, MPI_INT, MPI_MIN, - MPI_COMM_WORLD); - } - - /* we are done with this read iteration */ - } - - /* close the file */ - err = MPI_File_close(&fh); - if(err){ - fprintf(stderr, "node %d, close error after write\n", mynod); - } - - /* compute the read and write times */ - MPI_Allreduce(&read_tim, &max_read_tim, 1, MPI_DOUBLE, MPI_MAX, - MPI_COMM_WORLD); - MPI_Allreduce(&read_tim, &min_read_tim, 1, MPI_DOUBLE, MPI_MIN, - MPI_COMM_WORLD); - MPI_Allreduce(&read_tim, &ave_read_tim, 1, MPI_DOUBLE, MPI_SUM, - MPI_COMM_WORLD); - - /* calculate the average from the sum */ - ave_read_tim = ave_read_tim / nprocs; - - MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX, - MPI_COMM_WORLD); - MPI_Allreduce(&write_tim, &min_write_tim, 1, MPI_DOUBLE, MPI_MIN, - MPI_COMM_WORLD); - MPI_Allreduce(&write_tim, &ave_write_tim, 1, MPI_DOUBLE, MPI_SUM, - MPI_COMM_WORLD); - - /* calculate the average from the sum */ - ave_write_tim = ave_write_tim / nprocs; - - /* print out the results on one node */ - if (mynod == 0) { - read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0); - write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0); - - printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs, - opt_iter, (long)opt_block); - - printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter)); - - printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n", - min_write_tim, max_write_tim, ave_write_tim); - printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n", - min_read_tim, max_read_tim, ave_read_tim); - - printf("Write bandwidth = %f Mbytes/sec\n", write_bw); - printf("Read bandwidth = %f Mbytes/sec\n", read_bw); - - if (opt_correct) { - printf("Correctness test %s.\n", correct ? "passed" : "failed"); - } - } - - -die_jar_jar_die: - -#if H5_HAVE_SETENV -/* no setenv or unsetenv */ - /* clear the environment variable if it was set earlier */ - if (opt_pvfstab_set){ - unsetenv("PVFSTAB_FILE"); - } -#endif - - free(tmp); - if (opt_correct) free(tmp2); - MPI_Finalize(); - return(0); -} - -static int -parse_args(int argc, char **argv) -{ - int c; - - while ((c = getopt(argc, argv, "s:b:i:f:p:c")) != EOF) { - switch (c) { - case 's': /* stripe */ - opt_stripe = atoi(optarg); - break; - case 'b': /* block size */ - opt_block = atoi(optarg); - break; - case 'i': /* iterations */ - opt_iter = atoi(optarg); - break; - case 'f': /* filename */ - strncpy(opt_file, optarg, 255); - break; - case 'p': /* pvfstab file */ - strncpy(opt_pvfstab, optarg, 255); - opt_pvfstab_set = 1; - break; - case 'c': /* correctness */ - opt_correct = 1; - break; - case '?': /* unknown */ - default: - break; - } - } - return(0); -} - -/* - * Local variables: - * c-indent-level: 3 - * c-basic-offset: 3 - * tab-width: 3 - * End: - */ - -#else /* H5_HAVE_PARALLEL */ -/* dummy program since H5_HAVE_PARALLEL is not configured in */ -int -main(int UNUSED argc, char UNUSED **argv) -{ - printf("No parallel performance because parallel is not configured in\n"); - return(0); -} -#endif /* H5_HAVE_PARALLEL */ - |