Skip to content
Open
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
10 changes: 9 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ jobs:
echo SUBJOB_PREFIX=${SUBJOB_PREFIX}
while (( CAF_IMAGES > 0 )); do \
echo CAF_IMAGES=${CAF_IMAGES} ; \
( set -x ; ./run-fpm.sh test --verbose -- -d ) ; \
( set -x ; ./run-fpm.sh test --verbose -- ) ; \
sleep 1 ; \
CAF_IMAGES=$(( CAF_IMAGES / 2 )) ; \
done
Expand Down Expand Up @@ -319,3 +319,11 @@ jobs:
) ; \
done

- name: Build and Test Caffeine (thread-safe)
run: |
for var in FC CC CXX FFLAGS CPPFLAGS CFLAGS LDFLAGS LIBS GASNET_CONFIGURE_ARGS ; do \
eval echo "$var=\$$var"; done
set -x
./install.sh --prefix=${PREFIX} --network=${{ matrix.network }} --enable-threads --verbose
./run-fpm.sh test --verbose --

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ See also [issue #228](https://github.com/BerkeleyLab/caffeine/issues/228).

The `install.sh` recognizes a number of command-line options and environment variables to
customize behavior for your system. See the output of `./install.sh --help` for full documentation,
including options for how to build for a distributed-memory platform.
including options for how to build for a distributed-memory platform or with thread-safety.


Example Usage
Expand Down
6 changes: 3 additions & 3 deletions docs/README-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
[manifest/fpm.toml.template](../manifest/fpm.toml.template), [install.sh](../install.sh), [version.h](../include/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 [language-support.F90](../include/language-support.F90)
including `CAF_PRIF_VERSION_{MAJOR,MINOR}` in [version.h](../include/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
Expand All @@ -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)
[manifest/fpm.toml.template](../manifest/fpm.toml.template), [install.sh](../install.sh), [version.h](../include/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. Update the release procedure with any new steps or changes
19 changes: 0 additions & 19 deletions include/language-support.F90
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,4 @@
#define CAF_IMPORT_TEAM_CONSTANTS CAF_IMPORT_CONSTANTS
#endif

! PRIF specification version override and control
! By default, Caffeine provides the latest ratified version of the PRIF specification.
! Clients can optionally define one of the FORCE_* macros below to force compliance
! with a different revision of the PRIF specification. These override settings are
! NOT officially supported and may be removed at any time without notice.
#define CAF_PRIF_VERSION_MAJOR 0
#if FORCE_PRIF_0_5
# define CAF_PRIF_VERSION_MINOR 5
#elif FORCE_PRIF_0_6
# define CAF_PRIF_VERSION_MINOR 6
#elif FORCE_PRIF_0_7
# define CAF_PRIF_VERSION_MINOR 7
#elif FORCE_PRIF_0_8
# define CAF_PRIF_VERSION_MINOR 8
#else
# define CAF_PRIF_VERSION_MINOR 7
#endif
#define CAF_PRIF_VERSION (100 * CAF_PRIF_VERSION_MAJOR + CAF_PRIF_VERSION_MINOR)

#endif
37 changes: 37 additions & 0 deletions include/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# /* Copyright (c), The Regents of the University of California */
# /* Terms of use are as specified in LICENSE.txt */

# /* NOTE: this is a dual-language header file, */
# /* and should ONLY contain portable preprocessor directives. */

#ifndef CAF_INCLUDED_VERSION_H
#define CAF_INCLUDED_VERSION_H

# /* Caffeine software package versioning */
#define CAF_RELEASE_VERSION_MAJOR 0
#define CAF_RELEASE_VERSION_MINOR 7
#define CAF_RELEASE_VERSION_PATCH 1
#define CAF_RELEASE_VERSION (1000*CAF_RELEASE_VERSION_MAJOR + 100*CAF_RELEASE_VERSION_MINOR + CAF_RELEASE_VERSION_PATCH)

#if 0
! PRIF specification version override and control
! By default, Caffeine provides the latest ratified version of the PRIF specification.
! Clients can optionally define one of the FORCE_* macros below to force compliance
! with a different revision of the PRIF specification. These override settings are
! NOT officially supported and may be removed at any time without notice.
#endif
#define CAF_PRIF_VERSION_MAJOR 0
#if FORCE_PRIF_0_5
# define CAF_PRIF_VERSION_MINOR 5
#elif FORCE_PRIF_0_6
# define CAF_PRIF_VERSION_MINOR 6
#elif FORCE_PRIF_0_7
# define CAF_PRIF_VERSION_MINOR 7
#elif FORCE_PRIF_0_8
# define CAF_PRIF_VERSION_MINOR 8
#else
# define CAF_PRIF_VERSION_MINOR 7
#endif
#define CAF_PRIF_VERSION (100 * CAF_PRIF_VERSION_MAJOR + CAF_PRIF_VERSION_MINOR)

#endif
17 changes: 14 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ USAGE:
Default prefix='\$HOME/.local/bin'
--verbose Show verbose build commands
--yes Assume (yes) to all prompts for non-interactive build
--enable-threads Build a thread-safe Caffeine library and link to
thread-safe GASNet, for use in threaded do-concurrent.

All unrecognized arguments will be passed to GASNet's configure.

Expand All @@ -49,6 +51,7 @@ GCC_VERSION=${GCC_VERSION:=14}
GASNET_VERSION="stable"
VERBOSE=""
GASNET_CONDUIT="${GASNET_CONDUIT:-smp}"
GASNET_THREADMODE="${GASNET_THREADMODE:-seq}"
YES=false

list_prerequisites()
Expand Down Expand Up @@ -106,6 +109,9 @@ while [ "$1" != "" ]; do
-y | --yes)
YES="true"
;;
--enable-threads) GASNET_THREADMODE=par ;;
--disable-threads) GASNET_THREADMODE=seq ;;

*)
# We pass the unmodified argument to GASNet configure
# Quoting is believed sufficient for embedded whitespace but not quotes
Expand Down Expand Up @@ -328,7 +334,7 @@ EOF
printf "Is it ok to download and install $1? [yes] "
}

pkg="gasnet-$GASNET_CONDUIT-seq"
pkg="gasnet-$GASNET_CONDUIT-$GASNET_THREADMODE"
export PKG_CONFIG_PATH

if ! $PKG_CONFIG $pkg ; then
Expand Down Expand Up @@ -357,7 +363,7 @@ if ! $PKG_CONFIG $pkg ; then
cmd="$cmd --with-cc=\"$CC\" --with-cxx=\"$CXX\""
# select the GASNet config settings Caffeine requires, and disable unused features:
cmd="$cmd --enable-$GASNET_CONDUIT"
cmd="$cmd --enable-seq --disable-par --disable-parsync"
cmd="$cmd --enable-seq --enable-par --disable-parsync"
cmd="$cmd --disable-segment-everything"
# TEMPORARY: disable MPI compatibility until we figure out how to support in fpm
cmd="$cmd --disable-mpi-compat"
Expand Down Expand Up @@ -468,6 +474,10 @@ if ! [[ "$user_compiler_flags " =~ -[DU]ASSERTIONS[=\ ] ]] ; then
compiler_flag+=" -DASSERTIONS"
fi

if [[ $GASNET_THREADMODE == "par" ]] ; then
compiler_flag+=" -DCAF_THREAD_SAFE"
fi

GASNET_CONDUIT_UPPER=$(tr '[:lower:]' '[:upper:]' <<<$GASNET_CONDUIT)
compiler_flag+=" -DCAF_NETWORK_$GASNET_CONDUIT_UPPER"

Expand Down Expand Up @@ -530,7 +540,7 @@ chmod u+x $RUN_FPM_SH

./$RUN_FPM_SH build $VERBOSE

LIBCAFFEINE_DST=libcaffeine-$GASNET_CONDUIT.a
LIBCAFFEINE_DST=libcaffeine-$GASNET_CONDUIT-$GASNET_THREADMODE.a
LIBCAFFEINE_SRC=$(./$RUN_FPM_SH install --list 2>/dev/null | grep libcaffeine | cut -d' ' -f2)

if [ -z "$LIBCAFFEINE_SRC" ]; then
Expand All @@ -539,6 +549,7 @@ if [ -z "$LIBCAFFEINE_SRC" ]; then
else
mkdir -p "$PREFIX/lib"
cp -af "$LIBCAFFEINE_SRC" "$PREFIX/lib/$LIBCAFFEINE_DST"
ln -sf "$LIBCAFFEINE_DST" "$PREFIX/lib/libcaffeine-$GASNET_CONDUIT.a"
ln -sf "$LIBCAFFEINE_DST" "$PREFIX/lib/libcaffeine.a"
fi

Expand Down
2 changes: 1 addition & 1 deletion src/caffeine/alias_s.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
! Terms of use are as specified in LICENSE.txt

#include "assert_macros.h"
#include "language-support.F90"
#include "version.h"

submodule(prif:prif_private_s) alias_s
! DO NOT ADD USE STATEMENTS HERE
Expand Down
5 changes: 3 additions & 2 deletions src/caffeine/allocation_s.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
! Terms of use are as specified in LICENSE.txt

#include "assert_macros.h"
#include "version.h"
#include "language-support.F90"

submodule(prif:prif_private_s) allocation_s
Expand Down Expand Up @@ -84,7 +85,7 @@
module procedure prif_allocate
type(c_ptr) :: mem

mem = caf_allocate(non_symmetric_heap_mspace, size_in_bytes)
mem = caf_allocate_non_symmetric(size_in_bytes)
if (.not. c_associated(mem)) then
call report_error(PRIF_STAT_OUT_OF_MEMORY, out_of_memory_message(size_in_bytes, .false.), &
stat, errmsg, errmsg_alloc)
Expand Down Expand Up @@ -200,7 +201,7 @@ subroutine coarray_cleanup_i(handle, stat, errmsg) bind(C)
end procedure

module procedure prif_deallocate
call caf_deallocate(non_symmetric_heap_mspace, mem)
call caf_deallocate_non_symmetric(mem)
if (present(stat)) stat = 0
end procedure

Expand Down
4 changes: 4 additions & 0 deletions src/caffeine/caffeine-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# /* NOTE: this is a dual-language header file, */
# /* and should ONLY contain portable preprocessor directives. */

#ifndef CAF_INCLUDED_CAFFEINE_INTERNAL_H
#define CAF_INCLUDED_CAFFEINE_INTERNAL_H

# /* define some macro portability helpers */
#if defined(__GFORTRAN__) || defined(_CRAYFTN) || defined(NAGFOR)
# define CAF_CONCAT2(x,y) x/**/y
Expand All @@ -30,3 +33,4 @@
#define CAF_OP_FXOR 9
#define CAF_OP_FCAS 10

#endif
Loading