Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions MPI1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ prk_mpi1_executable(p2p DIR Synch_p2p SOURCES p2p.c
# --- Stencil ------------------------------------------------------------
# stencil.c #includes "loop_body_star.incl"/"loop_body_compact.incl"
# unconditionally, same as SERIAL's -- generated at build time.
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil")
# Generated dir is "Stencil_gen", not "Stencil": the executable's
# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS
# that collides with a sibling directory literally named "Stencil" in the
# same build root, making the linker fail with "Is a directory".
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen")
file(MAKE_DIRECTORY ${_stencil_gen_dir})
add_custom_command(
OUTPUT "${_stencil_gen_dir}/loop_body_star.incl"
Expand Down Expand Up @@ -140,7 +144,9 @@ target_link_libraries(mpi1_pic PRIVATE Threads::Threads MPI::MPI_C m)
# --- AMR --------------------------------------------------------------
# AMR also compiles timestep.c (COMOBJS += timestep.o) and needs all four
# loop_gen/loop_gen_amr variants.
set(_amr_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/AMR")
# Generated dir is "AMR_gen", not "AMR": same case-insensitive-APFS
# collision with OUTPUT_NAME "amr" as Stencil_gen above.
set(_amr_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/AMR_gen")
file(MAKE_DIRECTORY ${_amr_gen_dir})
add_custom_command(
OUTPUT "${_amr_gen_dir}/loop_body_star.incl"
Expand Down Expand Up @@ -175,7 +181,9 @@ set_source_files_properties(

# --- Branch (not part of ci/build-run-prk.sh's allmpi) coverage, but a
# normal kernel with its own subdirectory like the rest) -------------------
set(_branch_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Branch")
# Generated dir is "Branch_gen", not "Branch": same case-insensitive-APFS
# collision with OUTPUT_NAME "branch" as Stencil_gen above.
set(_branch_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Branch_gen")
file(MAKE_DIRECTORY ${_branch_gen_dir})
add_custom_command(
OUTPUT "${_branch_gen_dir}/func.c"
Expand Down
6 changes: 5 additions & 1 deletion MPIOPENMP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ prk_mpiopenmp_executable(p2p DIR Synch_p2p SOURCES p2p.c
# DOUBLE=1, STAR=1, RESTRICT_KEYWORD=0, RADIUS=2, LOOPGEN=0, VERBOSE=0.
# stencil.c #includes the generated loop_body_star.incl/loop_body_compact.incl
# unconditionally, same as SERIAL/Stencil -- generate via common/Stencil/loop_gen.
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil")
# Generated dir is "Stencil_gen", not "Stencil": the executable's
# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS
# that collides with a sibling directory literally named "Stencil" in the
# same build root, making the linker fail with "Is a directory".
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen")
file(MAKE_DIRECTORY ${_stencil_gen_dir})
add_custom_command(
OUTPUT "${_stencil_gen_dir}/loop_body_star.incl"
Expand Down
6 changes: 5 additions & 1 deletion MPIRMA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ prk_mpirma_executable(p2p DIR Synch_p2p SOURCES p2p.c
# these aren't checked in, generated by common/Stencil/loop_gen at build
# time, same as the Makefile's own pattern rule (and SERIAL's own Stencil
# target).
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil")
# Generated dir is "Stencil_gen", not "Stencil": the executable's
# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS
# that collides with a sibling directory literally named "Stencil" in the
# same build root, making the linker fail with "Is a directory".
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen")
file(MAKE_DIRECTORY ${_stencil_gen_dir})
add_custom_command(
OUTPUT "${_stencil_gen_dir}/loop_body_star.incl"
Expand Down
6 changes: 5 additions & 1 deletion MPISHM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ prk_mpishm_executable(p2p DIR Synch_p2p SOURCES p2p.c
# DOUBLE=1, STAR=1, LOCAL_BARRIER_SYNCH=0, RESTRICT_KEYWORD=0, RADIUS=2,
# LOOPGEN=0, VERBOSE=0. Same generated-.incl-file pattern as SERIAL's
# Stencil/AMR targets (common/Stencil/loop_gen).
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil")
# Generated dir is "Stencil_gen", not "Stencil": the executable's
# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS
# that collides with a sibling directory literally named "Stencil" in the
# same build root, making the linker fail with "Is a directory".
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen")
file(MAKE_DIRECTORY ${_stencil_gen_dir})
add_custom_command(
OUTPUT "${_stencil_gen_dir}/loop_body_star.incl"
Expand Down
27 changes: 22 additions & 5 deletions OPENMP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ prk_openmp_executable(p2p DIR Synch_p2p SOURCES p2p.c
# DOUBLE=1, PARALLELFOR=0, STAR=1, RESTRICT_KEYWORD=0, RADIUS=2, LOOPGEN=0,
# MAXTHREADS=512, VERBOSE=0. stencil.c #includes the generated .incl files
# unconditionally, same as SERIAL/Stencil.
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil")
# Generated dir is "Stencil_gen", not "Stencil": the executable's
# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS
# that collides with a sibling directory literally named "Stencil" in the
# same build root, making the linker fail with "Is a directory".
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen")
file(MAKE_DIRECTORY ${_stencil_gen_dir})
add_custom_command(
OUTPUT "${_stencil_gen_dir}/loop_body_star.incl"
Expand Down Expand Up @@ -154,10 +158,23 @@ prk_openmp_executable(random DIR Random SOURCES random.c
DEFS RESTRICT_KEYWORD=0 MAXTHREADS=512 VERBOSE=0 HPCC=1 ATOMIC=0 ERRORPERCENT=1 LONG_IS_64BITS=0)

# --- Branch -------------------------------------------------------------
# func.c is checked into the repo here already (unlike SERIAL/Branch,
# where it's generated) -- just compile it directly.
prk_openmp_executable(branch DIR Branch SOURCES branch.c func.c
DEFS RESTRICT_KEYWORD=0 MAXTHREADS=512 VERBOSE=0)
# func.c is not checked into the repo -- like SERIAL/Branch, it's generated
# by the checked-in ./func_gen script (MATRIX_RANK=10, NUMBER_OF_FUNCTIONS=40
# defaults, matching the Makefile's own ifndef defaults).
# Generated dir is "Branch_gen", not "Branch": same case-insensitive-APFS
# collision with OUTPUT_NAME "branch" as Stencil_gen above.
set(_branch_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Branch_gen")
file(MAKE_DIRECTORY ${_branch_gen_dir})
add_custom_command(
OUTPUT "${_branch_gen_dir}/func.c"
COMMAND "${CMAKE_CURRENT_LIST_DIR}/Branch/func_gen" 10 40
WORKING_DIRECTORY ${_branch_gen_dir}
COMMENT "Generating Branch/func.c (MATRIX_RANK=10, NUMBER_OF_FUNCTIONS=40)")
add_executable(openmp_branch Branch/branch.c "${_branch_gen_dir}/func.c" $<TARGET_OBJECTS:prk_openmp_wtime> $<TARGET_OBJECTS:prk_openmp_bail_out>)
set_target_properties(openmp_branch PROPERTIES OUTPUT_NAME branch)
target_include_directories(openmp_branch PRIVATE ${PRK_INCLUDE_DIR} "${CMAKE_CURRENT_LIST_DIR}/Branch")
target_compile_definitions(openmp_branch PRIVATE RESTRICT_KEYWORD=0 MAXTHREADS=512 VERBOSE=0)
target_link_libraries(openmp_branch PRIVATE Threads::Threads OpenMP::OpenMP_C)

# --- CTest: reproduces ci/build-run-prk.sh's allopenmp) run commands -----
# OMP_NUM_THREADS=4, passed both as the env var (matching what a real user
Expand Down
14 changes: 11 additions & 3 deletions SERIAL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ prk_serial_executable(p2p DIR Synch_p2p SOURCES p2p.c
# unconditionally (both code paths compiled in, selected at runtime) --
# these aren't checked in, generated by common/Stencil/loop_gen at build
# time, same as the Makefile's own pattern rule.
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil")
# Generated dir is "Stencil_gen", not "Stencil": the executable's
# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS
# that collides with a sibling directory literally named "Stencil" in the
# same build root, making the linker fail with "Is a directory".
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen")
file(MAKE_DIRECTORY ${_stencil_gen_dir})
add_custom_command(
OUTPUT "${_stencil_gen_dir}/loop_body_star.incl"
Expand Down Expand Up @@ -145,7 +149,9 @@ target_link_libraries(serial_pic PRIVATE Threads::Threads m)
# DOUBLE=1, STAR=1, RESTRICT_KEYWORD=0, RADIUS=2, LOOPGEN=0, VERBOSE=0.
# amr.c needs all four loop_gen/loop_gen_amr variants (star/compact,
# regular/amr).
set(_amr_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/AMR")
# Generated dir is "AMR_gen", not "AMR": same case-insensitive-APFS
# collision with OUTPUT_NAME "amr" as Stencil_gen above.
set(_amr_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/AMR_gen")
file(MAKE_DIRECTORY ${_amr_gen_dir})
add_custom_command(
OUTPUT "${_amr_gen_dir}/loop_body_star.incl"
Expand Down Expand Up @@ -184,7 +190,9 @@ set_source_files_properties(
# (matches the Makefile's OBJS = $(PROGRAM).o $(COMOBJS) func.o), generated
# by the checked-in ./func_gen script (MATRIX_RANK=10, NUMBER_OF_FUNCTIONS=40
# defaults).
set(_branch_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Branch")
# Generated dir is "Branch_gen", not "Branch": same case-insensitive-APFS
# collision with OUTPUT_NAME "branch" as Stencil_gen above.
set(_branch_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Branch_gen")
file(MAKE_DIRECTORY ${_branch_gen_dir})
add_custom_command(
OUTPUT "${_branch_gen_dir}/func.c"
Expand Down
6 changes: 5 additions & 1 deletion SHMEM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ prk_shmem_executable(p2p DIR Synch_p2p SOURCES p2p.c
# VERBOSE=0. stencil.c #includes "loop_body_star.incl"/
# "loop_body_compact.incl" unconditionally, same generated-.incl-file
# pattern as SERIAL/MPIRMA's Stencil targets (common/Stencil/loop_gen).
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil")
# Generated dir is "Stencil_gen", not "Stencil": the executable's
# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS
# that collides with a sibling directory literally named "Stencil" in the
# same build root, making the linker fail with "Is a directory".
set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen")
file(MAKE_DIRECTORY ${_stencil_gen_dir})
add_custom_command(
OUTPUT "${_stencil_gen_dir}/loop_body_star.incl"
Expand Down
Loading