diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0606d6ce..33d99e6e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -421,10 +421,11 @@ jobs: - name: Build FPM if: env.FPM_BUILD run: | + mkdir -p fpm-temp/bin + cd fpm-temp curl --retry 5 -LOsS https://github.com/fortran-lang/fpm/releases/download/v$FPM_VERSION/fpm-$FPM_VERSION.F90 - mkdir fpm-temp - gfortran-14 -fopenmp -o fpm-temp/fpm fpm-$FPM_VERSION.F90 - echo "PATH=${PWD}/fpm-temp:${PATH}" >> "$GITHUB_ENV" + gfortran-14 -fopenmp -o bin/fpm fpm-$FPM_VERSION.F90 + echo "PATH=$PWD/bin:${PATH}" >> "$GITHUB_ENV" ########################################################################## # Set Install Variables diff --git a/docs/README-release.md b/docs/README-release.md index dfe20cec..2dd85aba 100644 --- a/docs/README-release.md +++ b/docs/README-release.md @@ -12,13 +12,13 @@ Release Procedure for Caffeine 1. Update all instances of the copyright year embedded in: [LICENSE.txt](../LICENSE.txt), [manifest/fpm.toml.template](../manifest/fpm.toml.template) 2. Update all instances of the release package version number embedded in: - [manifest/fpm.toml.template](../manifest/fpm.toml.template), [install.sh](../install.sh), [version.h](../include/version.h) + [manifest/fpm.toml.template](../manifest/fpm.toml.template), [install.sh](../install.sh), [caffeine-version.h](../include/caffeine-version.h) 3. Update the author list embedded in: [manifest/fpm.toml.template](../manifest/fpm.toml.template) 4. Review top-level [README.md](../README.md) and other user-facing documentation for any necessary changes 5. Update [docs/implementation-status.md](../docs/implementation-status.md) with current status 6. If the PRIF specification revision is changing, search and update all instances of the old revision, - including `CAF_PRIF_VERSION_{MAJOR,MINOR}` in [version.h](../include/version.h) + including `CAF_PRIF_VERSION_{MAJOR,MINOR}` in [caffeine-version.h](../include/caffeine-version.h) 7. Temporarily hardcode version of gasnet installer in [install.sh](../install.sh) as the last commit in the release. Set GASNET_VERSION flag to the latest gasnet release 5. Produce the ChangeLog @@ -42,7 +42,7 @@ Release Procedure for Caffeine 10. Post release chores 1. Git revert the commit that hardcoded the gasnet version or manually edit 2. Update patch number of the version number embedded in: - [manifest/fpm.toml.template](../manifest/fpm.toml.template), [install.sh](../install.sh), [version.h](../include/version.h) + [manifest/fpm.toml.template](../manifest/fpm.toml.template), [install.sh](../install.sh), [caffeine-version.h](../include/caffeine-version.h) Update to an odd number to indicate that the `main` branch is currently a snapshot of something that is beyond the offical release 3. PR a version bump to the Caffeine version in [LFortran third-party CI](https://github.com/lfortran/lfortran/blob/main/ci/test_third_party_codes.sh) and the [LFortran end-to-end tests](https://github.com/lfortran/lfortran/blob/main/ci/test_caffeine.sh) diff --git a/include/language-support.F90 b/include/caffeine-language-support.F90 similarity index 100% rename from include/language-support.F90 rename to include/caffeine-language-support.F90 diff --git a/include/version.h b/include/caffeine-version.h similarity index 100% rename from include/version.h rename to include/caffeine-version.h diff --git a/install.sh b/install.sh index 91d50a38..83342353 100755 --- a/install.sh +++ b/install.sh @@ -533,8 +533,14 @@ else FFLAGS="$FFLAGS_opt $FFLAGS" fi -# enable Assert's multi-image support with PRIF callbacks provided by libcaffeine -FFLAGS+=" -DASSERT_MULTI_IMAGE -DASSERT_PARALLEL_CALLBACKS" +# Configure dependencies: +# We utilize Assert's parallel callbacks feature, with PRIF callbacks provided by libcaffeine. +# This feature previously required ASSERT_PARALLEL_CALLBACKS, but is now always enabled. +# We leave Assert's multi-image support disabled (default), because this is +# subsumed by the parallel callbacks, and we don't want native calls to +# this_image() on compilers that might not support it through PRIF. +# We do rename the assert module to reduce the chance of name conflicts: +FFLAGS+=" -Dassert_m=caf_caffiene_assert_m" # enable Julienne's multi-image support with PRIF callbacks provided by julienne-driver FFLAGS+=" -DHAVE_MULTI_IMAGE_SUPPORT -DJULIENNE_PARALLEL_CALLBACKS" diff --git a/manifest/fpm.toml.template b/manifest/fpm.toml.template index 0a4b8828..4d8fd974 100644 --- a/manifest/fpm.toml.template +++ b/manifest/fpm.toml.template @@ -6,8 +6,8 @@ maintainer = "fortran@lbl.gov" copyright = "2021-2026 The Regents of the University of California, through Lawrence Berkeley National Laboratory" [dev-dependencies] -assert = {git = "https://github.com/berkeleylab/assert.git", tag = "3.1.2"} -julienne = {git = "https://github.com/berkeleylab/julienne.git", tag = "4.1.0"} +assert = {git = "https://github.com/berkeleylab/assert.git", tag = "3.2.0"} +julienne = {git = "https://github.com/berkeleylab/julienne.git", tag = "4.1.2"} [install] library = true diff --git a/src/caffeine/alias_s.F90 b/src/caffeine/alias_s.F90 index 065dafc2..101293bf 100644 --- a/src/caffeine/alias_s.F90 +++ b/src/caffeine/alias_s.F90 @@ -2,7 +2,7 @@ ! Terms of use are as specified in LICENSE.txt #include "assert_macros.h" -#include "version.h" +#include "caffeine-version.h" submodule(prif:prif_private_s) alias_s ! DO NOT ADD USE STATEMENTS HERE diff --git a/src/caffeine/allocation_s.F90 b/src/caffeine/allocation_s.F90 index 57e5effc..4b6416b0 100644 --- a/src/caffeine/allocation_s.F90 +++ b/src/caffeine/allocation_s.F90 @@ -2,8 +2,8 @@ ! Terms of use are as specified in LICENSE.txt #include "assert_macros.h" -#include "version.h" -#include "language-support.F90" +#include "caffeine-version.h" +#include "caffeine-language-support.F90" #ifndef CAF_POISON #define CAF_POISON ASSERTIONS diff --git a/src/caffeine/caffeine.c b/src/caffeine/caffeine.c index 5af81168..45dfec83 100644 --- a/src/caffeine/caffeine.c +++ b/src/caffeine/caffeine.c @@ -17,7 +17,7 @@ #include "../dlmalloc/dl_malloc_caf.h" #include "../dlmalloc/dl_malloc.h" #include "caffeine-internal.h" -#include "version.h" +#include "caffeine-version.h" // Ensure assertion enforcement in this file tracks the Caffeine ASSERTIONS setting #undef NDEBUG diff --git a/src/caffeine/co_reduce_s.F90 b/src/caffeine/co_reduce_s.F90 index 6a295051..a1117076 100644 --- a/src/caffeine/co_reduce_s.F90 +++ b/src/caffeine/co_reduce_s.F90 @@ -2,7 +2,7 @@ ! Terms of use are as specified in LICENSE.txt #include "assert_macros.h" -#include "language-support.F90" +#include "caffeine-language-support.F90" submodule(prif:prif_private_s) co_reduce_s ! DO NOT ADD USE STATEMENTS HERE diff --git a/src/caffeine/program_startup_s.F90 b/src/caffeine/program_startup_s.F90 index 89814f45..f08e083d 100644 --- a/src/caffeine/program_startup_s.F90 +++ b/src/caffeine/program_startup_s.F90 @@ -47,34 +47,29 @@ end if end procedure -#if ASSERT_PARALLEL_CALLBACKS - subroutine assert_init() - implicit none - assert_this_image => assert_callback_this_image - assert_error_stop => assert_callback_error_stop - end subroutine - pure function assert_callback_this_image() result(this_image_id) - implicit none - integer :: this_image_id - - this_image_id = initial_team%this_image - end function - - pure subroutine assert_callback_error_stop(stop_code_char) - implicit none - character(len=*), intent(in) :: stop_code_char + subroutine assert_init() + implicit none + assert_this_image => assert_callback_this_image + assert_error_stop => assert_callback_error_stop + end subroutine + pure function assert_callback_this_image() result(this_image_id) + implicit none + integer :: this_image_id + + this_image_id = initial_team%this_image + end function + + pure subroutine assert_callback_error_stop(stop_code_char) + implicit none + character(len=*), intent(in) :: stop_code_char # if __LFORTRAN__ - ! LFortran currently miscompiles the call to caf_fatal_error below - error stop stop_code_char, quiet=.false. + ! LFortran currently miscompiles the call to caf_fatal_error below + error stop stop_code_char, quiet=.false. # else - character(len=:), allocatable, target :: tmp - tmp = stop_code_char - call caf_fatal_error(tmp) + character(len=:), allocatable, target :: tmp + tmp = stop_code_char + call caf_fatal_error(tmp) # endif - end subroutine -#else - subroutine assert_init() - end subroutine -#endif + end subroutine end submodule program_startup_s diff --git a/src/caffeine/sync_stmt_s.F90 b/src/caffeine/sync_stmt_s.F90 index acc18497..7feb0409 100644 --- a/src/caffeine/sync_stmt_s.F90 +++ b/src/caffeine/sync_stmt_s.F90 @@ -1,7 +1,7 @@ ! Copyright (c), The Regents of the University of California ! Terms of use are as specified in LICENSE.txt -#include "version.h" +#include "caffeine-version.h" #include "assert_macros.h" submodule(prif:prif_private_s) sync_stmt_s diff --git a/src/caffeine/teams_s.F90 b/src/caffeine/teams_s.F90 index 407937bd..2f1d6a7b 100644 --- a/src/caffeine/teams_s.F90 +++ b/src/caffeine/teams_s.F90 @@ -1,7 +1,7 @@ ! Copyright (c), The Regents of the University of California ! Terms of use are as specified in LICENSE.txt -#include "version.h" +#include "caffeine-version.h" #include "assert_macros.h" submodule(prif:prif_private_s) teams_s diff --git a/src/caffeine/unit_test_parameters_m.F90 b/src/caffeine/unit_test_parameters_m.F90 index a8a5b3fb..4fc73a5a 100644 --- a/src/caffeine/unit_test_parameters_m.F90 +++ b/src/caffeine/unit_test_parameters_m.F90 @@ -1,7 +1,7 @@ ! Copyright (c), The Regents of the University ! Terms of use are as specified in LICENSE.txt -#include "version.h" +#include "caffeine-version.h" module unit_test_parameters_m use, intrinsic :: iso_c_binding, only: c_int, c_funptr, c_null_funptr diff --git a/src/prif.F90 b/src/prif.F90 index 6c1a2969..87e3b23c 100644 --- a/src/prif.F90 +++ b/src/prif.F90 @@ -1,8 +1,8 @@ ! Copyright (c), The Regents of the University of California ! Terms of use are as specified in LICENSE.txt -#include "language-support.F90" -#include "version.h" +#include "caffeine-language-support.F90" +#include "caffeine-version.h" module prif diff --git a/test/prif_allocate_test.F90 b/test/prif_allocate_test.F90 index 50bb02ab..e65e27c5 100644 --- a/test/prif_allocate_test.F90 +++ b/test/prif_allocate_test.F90 @@ -1,5 +1,5 @@ #include "test-utils.F90" -#include "version.h" +#include "caffeine-version.h" module prif_allocate_test_m # include "test-uses-alloc.F90" diff --git a/test/prif_teams_test.F90 b/test/prif_teams_test.F90 index 16d85352..99734343 100644 --- a/test/prif_teams_test.F90 +++ b/test/prif_teams_test.F90 @@ -1,5 +1,5 @@ #include "test-utils.F90" -#include "version.h" +#include "caffeine-version.h" module prif_teams_test_m # include "test-uses-alloc.F90" diff --git a/test/test-uses-alloc.F90 b/test/test-uses-alloc.F90 index 6daffbf6..12dcd301 100644 --- a/test/test-uses-alloc.F90 +++ b/test/test-uses-alloc.F90 @@ -5,8 +5,8 @@ #ifndef CAF_INCLUDED_TEST_USES_ALLOC #define CAF_INCLUDED_TEST_USES_ALLOC -#include "version.h" -#include "language-support.F90" +#include "caffeine-version.h" +#include "caffeine-language-support.F90" use prif, only : & prif_allocate_coarray, &