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
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ jobs:
version: latest
container: ghcr.io/lfortran/lfortran:latest
native_multi_image: true
FFLAGS: --coarray=true -DHAVE_TEAM=0 -DHAVE_EVENT_TYPE=0 -DHAVE_LOCK_TYPE=0 -DHAVE_NOTIFY_TYPE=0 -DHAVE_COARRAY -DHAVE_ALLOC_COARRAY=0 -DHAVE_COARRAY_QUERY=0
FFLAGS: --coarray=true -DHAVE_TEAM=0 -DHAVE_COARRAY -DHAVE_ALLOC_COARRAY=0 -DHAVE_COARRAY_QUERY=0 -DHAVE_EVENT=0 -DHAVE_LOCK_TYPE=0 -DHAVE_NOTIFY_TYPE=0

- os: ubuntu-22.04
compiler: lfortran
version: 0.64
container: ghcr.io/lfortran/lfortran:v0.64.0
native_multi_image: true
FFLAGS: --coarray=true -DHAVE_TEAM=0 -DHAVE_EVENT_TYPE=0 -DHAVE_LOCK_TYPE=0 -DHAVE_NOTIFY_TYPE=0 -DHAVE_COARRAY -DHAVE_ALLOC_COARRAY=0 -DHAVE_COARRAY_QUERY=0
FFLAGS: --coarray=true -DHAVE_TEAM=0 -DHAVE_COARRAY -DHAVE_ALLOC_COARRAY=0 -DHAVE_COARRAY_QUERY=0 -DHAVE_EVENT=0 -DHAVE_LOCK_TYPE=0 -DHAVE_NOTIFY_TYPE=0

- os: ubuntu-22.04
compiler: lfortran
Expand Down Expand Up @@ -336,9 +336,9 @@ jobs:
fi
if [ "${NATIVE_MULTI_IMAGE}" == true ] ; then
if [[ $COMPILER_VERSION == latest ]] ; then
echo "FFLAGS=$FFLAGS -fcoarray -DHAVE_COARRAY -DHAVE_ALLOC_COARRAY=0 -DHAVE_SAVE_COARRAY=0 -DHAVE_MODULE_COARRAY=0 -DHAVE_COARRAY_INIT=0 -DIGNORE_FAILURES=6" >> "$GITHUB_ENV"
echo "FFLAGS=$FFLAGS -fcoarray -DHAVE_COARRAY -DHAVE_ALLOC_COARRAY=0 -DHAVE_SAVE_COARRAY=0 -DHAVE_MODULE_COARRAY=0 -DHAVE_COARRAY_INIT=0 -DHAVE_PUTGET=0 -DHAVE_EVENT=0 -DHAVE_EVENT_TYPE -DIGNORE_FAILURES=6" >> "$GITHUB_ENV"
else
echo "FFLAGS=$FFLAGS -fcoarray -DIGNORE_FAILURES=8" >> "$GITHUB_ENV"
echo "FFLAGS=$FFLAGS -fcoarray -DHAVE_EVENT_TYPE -DIGNORE_FAILURES=8" >> "$GITHUB_ENV"
fi
fi

Expand Down
77 changes: 68 additions & 9 deletions app/native-multi-image.F90
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@
#ifndef HAVE_TEAM_TYPE
#define HAVE_TEAM_TYPE HAVE_TEAM
#endif
#ifndef HAVE_EVENT_TYPE
#define HAVE_EVENT_TYPE 1
#endif
#ifndef HAVE_LOCK_TYPE
#define HAVE_LOCK_TYPE 1
#endif
#ifndef HAVE_NOTIFY_TYPE
#define HAVE_NOTIFY_TYPE 1
#endif
! TYPES_IMPORT_PRIF: compiler imports the real PRIF definition of ISO_FORTRAN_ENV types
#ifndef TYPES_IMPORT_PRIF
#define TYPES_IMPORT_PRIF 0
Expand All @@ -74,6 +65,13 @@
#define HAVE_COARRAY_INIT HAVE_COARRAY
#endif

#ifndef HAVE_PUTGET
#define HAVE_PUTGET HAVE_COARRAY
#endif
#ifndef HAVE_PUTGET_INTRINSIC_SCALAR
#define HAVE_PUTGET_INTRINSIC_SCALAR HAVE_PUTGET
#endif

! coarray query intrinsics
#ifndef HAVE_COARRAY_QUERY
#define HAVE_COARRAY_QUERY HAVE_COARRAY
Expand All @@ -91,6 +89,27 @@
#define HAVE_THIS_IMAGE_COARRAY HAVE_COARRAY_QUERY
#endif

#ifndef HAVE_EVENT
#define HAVE_EVENT HAVE_COARRAY
#endif
#ifndef HAVE_EVENT_TYPE
#define HAVE_EVENT_TYPE HAVE_EVENT
#endif
#ifndef HAVE_EVENT_POST_WAIT
#define HAVE_EVENT_POST_WAIT HAVE_EVENT
#endif
#ifndef HAVE_EVENT_QUERY
#define HAVE_EVENT_QUERY HAVE_EVENT
#endif

#ifndef HAVE_LOCK_TYPE
#define HAVE_LOCK_TYPE 1
#endif

#ifndef HAVE_NOTIFY_TYPE
#define HAVE_NOTIFY_TYPE 1
#endif

! Helper macros
#define CHECK_TYPE_COMPLIANCE(subject_type, subject, is_team, min_size) \
BLOCK ; \
Expand Down Expand Up @@ -253,6 +272,7 @@ program native_multi_image
# endif
# if HAVE_EVENT_TYPE
type(event_type), target :: default_event[*]
type(event_type) :: test_event[*]
# endif
# if HAVE_NOTIFY_TYPE
type(notify_type), target :: default_notify[*]
Expand Down Expand Up @@ -410,12 +430,51 @@ program native_multi_image
write(*,'(A,I3)') "this_image(sca_int_3, dim=2) = ", THIS_IMAGE(sca_int_3, dim=2)
end if
# endif
# if HAVE_PUTGET_INTRINSIC_SCALAR
call status("Testing put/get intrinsic scalar...")
sca_int_1 = THIS_IMAGE()
call sync_all
i = sca_int_1[peer] ! get
if (i /= peer) then
write(*,'(*(A,I3))') "FAIL: get sca_int_1[peer] = ", i, " expected = ", peer
fail_count = fail_count + 1
end if
call sync_all
sca_int_1[peer] = THIS_IMAGE() ! put
call sync_all
i = sca_int_1
if (i /= peer) then
write(*,'(*(A,I3))') "FAIL: put to sca_int_1 = ", i, " expected = ", peer
fail_count = fail_count + 1
end if
# endif
# endif

# if HAVE_EVENT_TYPE
CHECK_TYPE_COMPLIANCE(EVENT_TYPE, default_event, .false., 64)
# endif

# if HAVE_EVENT_QUERY
call status("Testing event_query...")
i = 666
call EVENT_QUERY(test_event, i)
if (i /= 0) then
write(*,'(A,I3)') "FAIL: EVENT_QUERY(test_event) = ", i
fail_count = fail_count + 1
end if
# endif

# if HAVE_EVENT_POST_WAIT
call status("Testing event post / event wait...")
if (THIS_IMAGE() == 1) then
!event post (test_event) ! currently broken
event post (test_event[1])
event wait (test_event, until_count=NUM_IMAGES())
else
event post (test_event[1])
end if
# endif

# if HAVE_LOCK_TYPE
CHECK_TYPE_COMPLIANCE(LOCK_TYPE, default_lock, .false., 64)
# endif
Expand Down
2 changes: 2 additions & 0 deletions include/language-support.F90
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
#ifndef CAF_IMPORT_CONSTANTS
# if defined(__flang__)
# define CAF_IMPORT_CONSTANTS 1
# elif __LFORTRAN_MAJOR__ > 0 || __LFORTRAN_MINOR__ >= 64
# define CAF_IMPORT_CONSTANTS 1
# else
# define CAF_IMPORT_CONSTANTS 0
# endif
Expand Down
Loading