Skip to content

Commit c74438c

Browse files
author
Damian Rouson
committed
Merge 'master' into co_broadcast-derived-type
2 parents af7969b + 8aeadba commit c74438c

File tree

11 files changed

+134
-32
lines changed

11 files changed

+134
-32
lines changed

.VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
$Format:%d%n%n$
22
# Fall back version, probably last release:
3-
2.6.3
3+
2.7.0
44

55
# OpenCoarrays version file. This project uses semantic
66
# versioning. For details see http://semver.org

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ matrix:
2626
os: osx
2727
env:
2828
- BUILD_TYPE="InstallScript"
29-
GCC=8
29+
GCC=9
3030
OSX_PACKAGES="gcc shellcheck cmake mpich"
3131
# cmake should be removed, but we should be installing binaries
3232
# because building from source takes forever

CMakeLists.txt

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.10)
22

33
cmake_policy(VERSION 3.10...3.14)
44

5+
if(DEFINED ENV{SOURCE_DATE_EPOCH})
6+
set(SOURCE_DATE_EPOCH "$ENV{SOURCE_DATE_EPOCH}")
7+
endif()
8+
59
set(CMAKE_SKIP_RPATH ON
610
CACHE BOOL "Don't add a build-dir rpath")
711
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON
@@ -13,15 +17,6 @@ set ( CMAKE_CONFIGURATION_TYPES "Debug" "Release" "MinSizeRel" "RelWithDebInfo"
1317
set ( CMAKE_BUILD_TYPE "Release"
1418
CACHE STRING "Select which configuration to build." )
1519
set_property ( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
16-
message( STATUS
17-
"
18-
============================================================
19-
Building OpenCoarrays configuration: ${CMAKE_BUILD_TYPE}
20-
============================================================
21-
")
22-
23-
message( STATUS "Running with CMake from: ${CMAKE_COMMAND}" )
24-
message( STATUS "Current source dir (for OpenCoarrays): ${CMAKE_CURRENT_SOURCE_DIR}")
2520

2621
# Add option and check environment to determine if developer tests should be run
2722
set( _TF OFF )
@@ -48,8 +43,7 @@ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+)?"
4843
OpenCoarraysVersion "${first_line}")
4944

5045
if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+)?")) AND (EXISTS "${CMAKE_SOURCE_DIR}/.git"))
51-
message( STATUS "Build from git repository detected")
52-
find_package(Git)
46+
find_package(Git QUIET)
5347
if(GIT_FOUND)
5448
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --abbrev=0
5549
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
@@ -92,6 +86,18 @@ string(REGEX REPLACE "-rc[0-9]+$"
9286
".0" OPENCOARRAYS_CMAKE_PROJECT_VERSION
9387
"${OpenCoarraysVersion}")
9488

89+
file(READ "${CMAKE_CURRENT_LIST_DIR}/cmake/Banner.txt.in" OC_BANNER)
90+
string(CONFIGURE "${OC_BANNER}" OC_BANNER @ONLY)
91+
string(STRIP "${OC_BANNER}" OC_BANNER)
92+
message(STATUS "${OC_BANNER}")
93+
94+
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/.git")
95+
message( STATUS "Build from git repository detected")
96+
endif()
97+
98+
message( STATUS "Running with CMake from: ${CMAKE_COMMAND}" )
99+
message( STATUS "Current source dir (for OpenCoarrays): ${CMAKE_CURRENT_SOURCE_DIR}")
100+
95101
project(opencoarrays VERSION "${OPENCOARRAYS_CMAKE_PROJECT_VERSION}" LANGUAGES C Fortran)
96102

97103
if(DEFINED CMAKE_BUILD_TYPE AND "${CMAKE_BUILD_TYPE}" MATCHES "[Rr][Ee][Ll]")
@@ -744,6 +750,7 @@ if(opencoarrays_aware_compiler)
744750
add_caf_test(teams_coarray_send 5 teams_coarray_send)
745751
add_caf_test(teams_coarray_send_by_ref 5 teams_coarray_send_by_ref)
746752
add_caf_test(teams_coarray_sendget 5 teams_coarray_sendget)
753+
add_caf_test(sync_team 8 sync_team)
747754
add_caf_test(alloc_comp_multidim_shape 2 alloc_comp_multidim_shape)
748755
endif()
749756
endif()
@@ -943,6 +950,8 @@ foreach(SCRIPT ${TRAVIS_SCRIPTS})
943950
endif()
944951
endforeach()
945952

946-
install(FILES "${CMAKE_BINARY_DIR}/sha256_install_manifest.txt"
947-
DESTINATION "${CMAKE_INSTALL_DATADIR}/opencoarrays"
948-
OPTIONAL)
953+
# Create and install a manifest of installed files, and another containing their sha256 hashes
954+
foreach(VAR CMAKE_BINARY_DIR CMAKE_INSTALL_DATADIR PROJECT_NAME SOURCE_DATE_EPOCH)
955+
install(CODE "set(${VAR} \"${${VAR}}\")")
956+
endforeach()
957+
install(SCRIPT "${CMAKE_CURRENT_LIST_DIR}/cmake/InstallFileManifest.cmake")

cmake/Banner.txt.in

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
------------------------------------------------------------------------------- --
2+
3+
_/_/
4+
_/ _/ _/_/_/ _/_/ _/_/_/
5+
_/ _/ _/ _/ _/_/_/_/ _/ _/
6+
_/ _/ _/ _/ _/ _/ _/
7+
_/_/ _/_/_/ _/_/_/ _/ _/
8+
_/
9+
_/
10+
11+
_/_/_/
12+
_/ _/_/ _/_/_/ _/ _/_/ _/ _/_/ _/_/_/ _/ _/ _/_/_/
13+
_/ _/ _/ _/ _/ _/_/ _/_/ _/ _/ _/ _/ _/_/
14+
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/
15+
_/_/_/ _/_/ _/_/_/ _/ _/ _/_/_/ _/_/_/ _/_/_/
16+
_/
17+
_/_/
18+
OpenCoarrays
19+
""""""""""""
20+
Build Type: @CMAKE_BUILD_TYPE@
21+
Version: @full_git_describe@
22+
23+
-- ------------------------------------------------------------------------------ --

cmake/InstallFileManifest.cmake

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This script will create and install an install manifest, including SHA256 hashes of each installed file
2+
# Variables passed from CMake must be set with `install(CODE "set(...)")`
3+
4+
message(STATUS "Generating SHA256 checksumed receipt for all installed assets")
5+
6+
# Set receipt install destination
7+
set(RECEIPT_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}")
8+
9+
# Mimic cmake_install.cmake's handlin of components
10+
if(CMAKE_INSTALL_COMPONENT)
11+
set(HASHED_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.SHA256.txt")
12+
else()
13+
set(HASHED_INSTALL_MANIFEST "install_manifest.SHA256.txt")
14+
endif()
15+
16+
# Clean out any old install manifest on re-installation, if it exists
17+
file(REMOVE "${CMAKE_BINARY_DIR}/${HASHED_INSTALL_MANIFEST}")
18+
19+
# Loop over files computing hashes
20+
foreach(file IN LISTS CMAKE_INSTALL_MANIFEST_FILES)
21+
file(SHA256 "${file}" _file_sha256)
22+
file(RELATIVE_PATH FILE_REL_PATH "${RECEIPT_INSTALL_DIR}" "${file}")
23+
file(APPEND "${CMAKE_BINARY_DIR}/${HASHED_INSTALL_MANIFEST}" "${_file_sha256} ${FILE_REL_PATH}\n")
24+
endforeach()
25+
file(APPEND "${CMAKE_BINARY_DIR}/${HASHED_INSTALL_MANIFEST}"
26+
"# Paths relative to \${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}\n")
27+
28+
file(INSTALL DESTINATION "${RECEIPT_INSTALL_DIR}" TYPE FILE PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ FILES
29+
"${CMAKE_BINARY_DIR}/${HASHED_INSTALL_MANIFEST}")
30+
31+
file(SHA256 "${CMAKE_BINARY_DIR}/${HASHED_INSTALL_MANIFEST}" MANIFEST_SHA256)
32+
message(STATUS
33+
"Global checksum for OpenCoarrays installation:
34+
${MANIFEST_SHA256} ${HASHED_INSTALL_MANIFEST}")
35+
message(STATUS "${PROJECT_NAME} was configured with SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH}")
36+
message(STATUS "The current environment has SOURCE_DATE_EPOCH set to: $ENV{SOURCE_DATE_EPOCH}")

prerequisites/build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,16 @@ info "-e (--verbose): ${arg_e} "
9797
info "-f (--with-fortran): ${arg_f} "
9898
info "-h (--help): ${arg_h} "
9999
info "-i (--install-prefix): ${arg_i} "
100-
info "-j (--num-threads): ${arg_j} "
101100
info "-I (--install-version): ${arg_I} "
101+
info "-j (--num-threads): ${arg_j} "
102102
info "-l (--list-packages): ${arg_l} "
103103
info "-m (--with-cmake): ${arg_m} "
104104
info "-M (--with-mpi): ${arg_M} "
105105
info "-n (--no-color): ${arg_n} "
106+
info "-o (--only-download): ${arg_o} "
106107
info "-p (--package): ${arg_p} "
107108
info "-P (--print-path): ${arg_P} "
108-
info "-t (--with-tau): ${arg_t} "
109+
info "-r (--prefix-root): ${arg_r} "
109110
info "-u (--from-url): ${arg_u} "
110111
info "-U (--print-url): ${arg_U} "
111112
info "-v (--version): ${arg_v} "

prerequisites/build.sh-usage

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
-p --package [arg] Package to install.
1919
-P --print-path [arg] Print installation path for package specified in argument.
2020
-r --prefix-root [arg] Installation path to which package name/version will be appended. (Example: -r /opt).
21-
-t --with-tau [arg] Use the specified TAU parallel performance utilities installation. Default="tauf90"
22-
-T --install-tau [arg] Install TAU in specified path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/${package_name:-}/${version_to_build:-}/"
2321
-u --from-url [arg] Specify a URL from which to download a package.
2422
-U --print-url [arg] Print URL for package specified in argument.
2523
-v --version Print OpenCoarrays version number.

src/mpi/mpi_caf.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8211,7 +8211,6 @@ void PREFIX(form_team) (int team_id, caf_team_t *team,
82118211
MPI_Comm *current_comm = &CAF_COMM_WORLD;
82128212
int ierr;
82138213

8214-
ierr = MPI_Barrier(CAF_COMM_WORLD); chk_err(ierr);
82158214
newcomm = (MPI_Comm *)calloc(1,sizeof(MPI_Comm));
82168215
ierr = MPI_Comm_split(*current_comm, team_id, caf_this_image, newcomm);
82178216
chk_err(ierr);
@@ -8322,24 +8321,25 @@ void PREFIX(sync_team) (caf_team_t *team , int unused __attribute__((unused)))
83228321
void *tmp_team;
83238322
MPI_Comm *tmp_comm;
83248323

8325-
/* Check if the team is the current, and ancestor or a descendant.
8326-
* To be implemented. */
8327-
83288324
tmp_used = used_teams;
83298325
tmp_list = (struct caf_teams_list *)*team;
83308326
tmp_team = (void *)tmp_list->team;
83318327
tmp_comm = (MPI_Comm *)tmp_team;
83328328

8333-
while (tmp_used)
8334-
{
8335-
if (tmp_used->team_list_elem == tmp_list)
8336-
break;
8337-
tmp_used = tmp_used->prev;
8338-
}
8329+
/* if the team is not a child */
8330+
if (tmp_used->team_list_elem != tmp_list->prev)
8331+
/* then search backwards through the team list, first checking if it's the
8332+
* current team, then if it is an ancestor team */
8333+
while (tmp_used)
8334+
{
8335+
if (tmp_used->team_list_elem == tmp_list)
8336+
break;
8337+
tmp_used = tmp_used->prev;
8338+
}
83398339

83408340
if (tmp_used == NULL)
83418341
caf_runtime_error("SYNC TEAM called on team different from current, "
8342-
"or ancestor, or descendant");
8342+
"or ancestor, or child");
83438343

83448344
int ierr = MPI_Barrier(*tmp_comm); chk_err(ierr);
83458345
}

src/tests/integration/pde_solvers/coarrayBurgers/main.F90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ program main
88
real(real64), parameter :: nu=1.,final_time=0.6_real64,tolerance=1.E-3_real64,safety_factor=0.1_real64
99
real(real64) :: time=0.,dt,dx
1010
integer, parameter :: nodes=16
11-
procedure(initial_condition), pointer :: initial_u=>ten_sin
11+
procedure(initial_condition), pointer :: initial_u=>null()
12+
13+
initial_u => ten_sin
1214

1315
#ifdef TAU
1416
call TAU_PROFILE_SET_NODE(this_image()-1) ! Start TAU (Cray or GNU compiler)

src/tests/unit/teams/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ caf_compile_executable(teams_coarray_get_by_ref teams_coarray_get.f90)
66
caf_compile_executable(teams_coarray_send teams_coarray_send.f90)
77
caf_compile_executable(teams_coarray_send_by_ref teams_coarray_send.f90)
88
caf_compile_executable(teams_coarray_sendget teams_coarray_sendget.f90)
9+
caf_compile_executable(sync_team sync-team.f90)

0 commit comments

Comments
 (0)