summaryrefslogtreecommitdiffstats
path: root/perform/CMakeLists.txt
blob: fc1d2521639633aa3f074af0e973be57523279c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
cmake_minimum_required (VERSION 2.8)
PROJECT (HDF5_PERFORM )

#-----------------------------------------------------------------------------
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR})
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib )

#-----------------------------------------------------------------------------
# Add Tests
#-----------------------------------------------------------------------------

# Remove any output file left over from previous test run
ADD_TEST (
    NAME h5perform-clear-objects
    COMMAND    ${CMAKE_COMMAND}
        -E remove 
        chunk.h5
        iopipe.h5
        iopipe.raw
        x-diag-rd.dat
        x-diag-wr.dat
        x-rowmaj-rd.dat
        x-rowmaj-wr.dat
        x-gnuplot
)

#-- Adding test for h5perf_serial
SET (h5perf_serial_SRCS
    ${HDF5_PERFORM_SOURCE_DIR}/sio_timer.c
    ${HDF5_PERFORM_SOURCE_DIR}/sio_perf.c
    ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c
)
ADD_EXECUTABLE (h5perf_serial ${h5perf_serial_SRCS})
H5_NAMING (h5perf_serial)
TARGET_WIN_PROPERTIES (h5perf_serial)
TARGET_LINK_LIBRARIES (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})

ADD_TEST (NAME h5perf_serial COMMAND $<TARGET_FILE:h5perf_serial>)

IF (HDF5_BUILD_PERFORM_STANDALONE)
  #-- Adding test for h5perf_serial_alone
  SET (h5perf_serial_alone_SRCS
      ${HDF5_PERFORM_SOURCE_DIR}/sio_timer.c
      ${HDF5_PERFORM_SOURCE_DIR}/sio_perf.c
      ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c
  )
  ADD_EXECUTABLE (h5perf_serial_alone ${h5perf_serial_alone_SRCS})
  SET_PROPERTY (TARGET h5perf_serial_alone 
      APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE
  )
  H5_NAMING (h5perf_serial_alone)
  TARGET_WIN_PROPERTIES (h5perf_serial_alone)
  TARGET_LINK_LIBRARIES (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})

  ADD_TEST (NAME h5perf_serial_alone COMMAND $<TARGET_FILE:h5perf_serial_alone>)
ENDIF (HDF5_BUILD_PERFORM_STANDALONE)

#-- Adding test for chunk
SET (chunk_SRCS
    ${HDF5_PERFORM_SOURCE_DIR}/chunk.c
)
ADD_EXECUTABLE(chunk ${chunk_SRCS})
H5_NAMING (chunk)
TARGET_WIN_PROPERTIES (chunk)
TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})

ADD_TEST (NAME chunk COMMAND $<TARGET_FILE:chunk>)

#-- Adding test for iopipe
SET (iopipe_SRCS
    ${HDF5_PERFORM_SOURCE_DIR}/iopipe.c
)
ADD_EXECUTABLE (iopipe ${iopipe_SRCS})
H5_NAMING (iopipe)
TARGET_WIN_PROPERTIES (iopipe)
TARGET_LINK_LIBRARIES (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})

ADD_TEST (NAME iopipe COMMAND $<TARGET_FILE:iopipe>)

#-- Adding test for overhead
SET (overhead_SRCS
    ${HDF5_PERFORM_SOURCE_DIR}/overhead.c
)
ADD_EXECUTABLE (overhead ${overhead_SRCS})
H5_NAMING (overhead)
TARGET_WIN_PROPERTIES (overhead)
TARGET_LINK_LIBRARIES (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})

ADD_TEST (NAME overhead COMMAND $<TARGET_FILE:overhead>)

#-- Adding test for perf_meta
SET (perf_meta_SRCS
    ${HDF5_PERFORM_SOURCE_DIR}/perf_meta.c
)
ADD_EXECUTABLE (perf_meta ${perf_meta_SRCS})
H5_NAMING (perf_meta)
TARGET_WIN_PROPERTIES (perf_meta)
TARGET_LINK_LIBRARIES (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})

ADD_TEST (NAME perf_meta COMMAND $<TARGET_FILE:perf_meta>)

#-- Adding test for zip_perf
SET (zip_perf_SRCS
    ${HDF5_PERFORM_SOURCE_DIR}/zip_perf.c
)
ADD_EXECUTABLE (zip_perf ${zip_perf_SRCS})
H5_NAMING (zip_perf)
TARGET_WIN_PROPERTIES (zip_perf)
TARGET_LINK_LIBRARIES (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})

ADD_TEST (NAME zip_perf COMMAND $<TARGET_FILE:zip_perf> "-h")

IF (H5_HAVE_PARALLEL)
  #-- Adding test for h5perf
  SET (h5perf_SRCS
      ${HDF5_PERFORM_SOURCE_DIR}/pio_timer.c
      ${HDF5_PERFORM_SOURCE_DIR}/pio_perf.c
      ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c
  )
  ADD_EXECUTABLE (h5perf ${h5perf_SRCS})
  H5_NAMING (h5perf)
  TARGET_WIN_PROPERTIES (h5perf)
  TARGET_LINK_LIBRARIES (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})

  ADD_TEST (NAME h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:h5perf>)

  IF (HDF5_BUILD_PERFORM_STANDALONE)
    #-- Adding test for h5perf
    SET (h5perf_alone_SRCS
        ${HDF5_PERFORM_SOURCE_DIR}/pio_timer.c
        ${HDF5_PERFORM_SOURCE_DIR}/pio_perf.c
        ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c
    )
    ADD_EXECUTABLE (h5perf_alone ${h5perf_alone_SRCS})
    SET_PROPERTY (TARGET h5perf_alone 
        APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE
    )
    H5_NAMING (h5perf_alone)
    TARGET_WIN_PROPERTIES (h5perf_alone)
    TARGET_LINK_LIBRARIES (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})

    ADD_TEST (NAME h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:h5perf_alone>)
  ENDIF (HDF5_BUILD_PERFORM_STANDALONE)

  #-- Adding test for benchpar
  SET (benchpar_SRCS
      ${HDF5_PERFORM_SOURCE_DIR}/benchpar.c
  )
  ADD_EXECUTABLE (benchpar ${benchpar_SRCS})
  H5_NAMING (benchpar)
  TARGET_WIN_PROPERTIES (benchpar)
  TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})

  ADD_TEST (NAME benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:benchpar>)

  #-- Adding test for mpi-perf
  SET (mpi-perf_SRCS
      ${HDF5_PERFORM_SOURCE_DIR}/mpi-perf.c
  )
  ADD_EXECUTABLE (mpi-perf ${mpi-perf_SRCS})
  H5_NAMING (mpi-perf)
  TARGET_WIN_PROPERTIES (mpi-perf)
  TARGET_LINK_LIBRARIES (mpi-perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})

  ADD_TEST (NAME mpi-perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:mpi-perf>)
ENDIF (H5_HAVE_PARALLEL)