v0.14.0
RunAndComp.cmake
Go to the documentation of this file.
1 if(BASE AND SPACE)
2  message(
3  "${MPI_RUN} ${MPI_FLAGS} -np ${MPI_NP}
4  ${PROG} -my_file ${FILE} -base ${BASE} -space ${SPACE} -log_no_color")
5  execute_process(
6  COMMAND
7  ${MPI_RUN} ${MPI_FLAGS} -np ${MPI_NP}
8  ${PROG} -my_file ${FILE} -base ${BASE} -space ${SPACE} -log_no_color
9  WORKING_DIRECTORY ${BINARY_DIR}
10  RESULT_VARIABLE CMD_RESULT)
11 elseif(BASE)
12  message(
13  "${MPI_RUN} ${MPI_FLAGS} -np ${MPI_NP}
14  ${PROG} -my_file ${FILE} -base ${BASE} -log_no_color")
15  execute_process(
16  COMMAND
17  ${MPI_RUN} ${MPI_FLAGS} -np ${MPI_NP}
18  ${PROG} -my_file ${FILE} -base ${BASE} -log_no_color
19  WORKING_DIRECTORY ${BINARY_DIR}
20  RESULT_VARIABLE CMD_RESULT)
21 elseif(SPACE)
22  message(
23  "${MPI_RUN} ${MPI_FLAGS} -np ${MPI_NP}
24  ${PROG} -my_file ${FILE} -space ${SPACE} -log_no_color")
25  execute_process(
26  COMMAND
27  ${MPI_RUN} ${MPI_FLAGS} -np ${MPI_NP}
28  ${PROG} -my_file ${FILE} -space ${SPACE} -log_no_color
29  WORKING_DIRECTORY ${BINARY_DIR}
30  RESULT_VARIABLE CMD_RESULT)
31 else()
32  message(
33  "${MPI_RUN} ${MPI_FLAGS} -np ${MPI_NP}
34  ${PROG} -my_file ${FILE} -log_no_color")
35  execute_process(
36  COMMAND
37  ${MPI_RUN} ${MPI_FLAGS} -np ${MPI_NP}
38  ${PROG} -my_file ${FILE} -log_no_color
39  WORKING_DIRECTORY ${BINARY_DIR}
40  RESULT_VARIABLE CMD_RESULT)
41 endif()
42 
43 if(CMD_RESULT)
44  message(FATAL_ERROR "Error running ${PROG} for file ${FILE}")
45 endif()
46 
47 execute_process(
48  COMMAND ${CMAKE_COMMAND} -E compare_files
49  ${SOURCE_DIR}/${LOG1}
50  ${BINARY_DIR}/${LOG2}
51  WORKING_DIRECTORY ${BINARY_DIR}
52  RESULT_VARIABLE CMD_RESULT)
53 if(CMD_RESULT)
54  message(
55  FATAL_ERROR
56  "Difftent files computed/blessed
57  ${SOURCE_DIR}/${LOG1} ${BINARY_DIR}/${LOG2}")
58 endif()