Skip to content

Commit 770b240

Browse files
committed
Fix host file when CMake runs multiple times
1 parent bf70772 commit 770b240

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mpi/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if (mpi_version_out MATCHES "[Oo]pen[ -][Mm][Pp][Ii]")
2121
message( STATUS "OpenMPI detected")
2222
set ( openmpi true PARENT_SCOPE)
2323
# Write out a host file because OMPI's mpiexec is dumb
24-
file(APPEND ${CMAKE_BINARY_DIR}/hostfile "${HOST_NAME} slots=${N_CPU}\n")
24+
file(WRITE ${CMAKE_BINARY_DIR}/hostfile "${HOST_NAME} slots=${N_CPU}\n")
2525
endif ()
2626

2727
if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")

0 commit comments

Comments
 (0)