xref: /phasta/phSolver/compressible/test/runphasta.cmake (revision dd5f6243677dd755f3916f42862678d41071231d)
1*dd5f6243SCameron Smithmacro(cmd dir exe)
2*dd5f6243SCameron Smith  message("${exe} ${ARGN}")
3*dd5f6243SCameron Smith  execute_process(
4*dd5f6243SCameron Smith    COMMAND ${exe} ${ARGN}
5*dd5f6243SCameron Smith    WORKING_DIRECTORY ${dir}
6*dd5f6243SCameron Smith    OUTPUT_VARIABLE out
7*dd5f6243SCameron Smith    ERROR_VARIABLE out
8*dd5f6243SCameron Smith    RESULT_VARIABLE res
9*dd5f6243SCameron Smith    )
10*dd5f6243SCameron Smith  message("${out}")
11*dd5f6243SCameron Smith  if(res)
12*dd5f6243SCameron Smith    message(FATAL_ERROR "Error running ${exe}")
13*dd5f6243SCameron Smith  else()
14*dd5f6243SCameron Smith    message("Success")
15*dd5f6243SCameron Smith  endif()
16*dd5f6243SCameron Smithendmacro()
17*dd5f6243SCameron Smith
18*dd5f6243SCameron Smithcmd(${WORKDIR} ln -snf ${CASEDIR} ${TGTCASEDIR})
19*dd5f6243SCameron Smithif(DEFINED NUMSTART )
20*dd5f6243SCameron Smith  cmd(${WORKDIR} cp ${NUMSTART} ${TGTCASEDIR}/numstart.dat)
21*dd5f6243SCameron Smithendif()
22*dd5f6243SCameron Smithcmd(${WORKDIR} ${MPIRUN} ${MPIRUN_PROCFLAG} ${NUMPROCS} ${EXE})
23*dd5f6243SCameron Smith
24*dd5f6243SCameron Smith# compare the new restart files against reference restart files
25*dd5f6243SCameron Smithcmd(${WORKDIR} ${MPIRUN} ${MPIRUN_PROCFLAG} ${NUMPROCS}
26*dd5f6243SCameron Smith  ${COMPARE_EXE} ${CASEDIR} ${CASEDIR}_ref ${IS_SYNCIO} 1e-6)
27*dd5f6243SCameron Smith
28*dd5f6243SCameron Smith# delete the symlink
29*dd5f6243SCameron Smithcmd(${WORKDIR} rm ${TGTCASEDIR})
30