Skip to content

Commit

Permalink
Fixes needed for flang
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 committed Nov 13, 2024
1 parent 18567fa commit 2c6751a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
7 changes: 4 additions & 3 deletions generic/AbstractComponent.F90
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module mapl_AbstractComponent
use pFlogger, only: t_Logger => Logger
implicit none
private

Expand Down Expand Up @@ -96,7 +97,7 @@ subroutine i_RunChild(this, name, clock, phase, unusable, rc)
end subroutine i_RunChild

subroutine i_SetLogger(this, logger)
use pfl_logger, only: t_Logger => Logger
import t_Logger
import AbstractComponent
implicit none
class(AbstractComponent), intent(inout) :: this
Expand All @@ -105,13 +106,13 @@ subroutine i_SetLogger(this, logger)
end subroutine i_SetLogger

function i_GetLogger(this) result(logger)
use pfl_logger, only: t_Logger => Logger
import t_Logger
import AbstractComponent
implicit none
class(t_Logger), pointer :: logger
class(AbstractComponent), intent(in) :: this
end function i_GetLogger

end interface

end module mapl_AbstractComponent
4 changes: 3 additions & 1 deletion generic/MAPL_Generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9805,8 +9805,10 @@ subroutine READIT(WHICH)
if (io_rank == 0) then
print *,'Using parallel IO for reading file: ',trim(DATAFILE)

#ifdef __NAG_COMPILER_RELEASE
#if defined( __NAG_COMPILER_RELEASE)
_FAIL('NAG does not provide ftell. Convert to stream I/O')
#elif defined(__flang__)
_FAIL('flang does not provide ftell. Convert to stream I/O')
#else
offset = _FTELL(UNIT)+4
#endif
Expand Down
6 changes: 5 additions & 1 deletion include/unused_dummy.H
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@
#ifdef _UNUSED_DUMMY
# undef _UNUSED_DUMMY
#endif
#define _UNUSED_DUMMY(x) if (.false.) then; associate (q____ => x); end associate; endif
#if defined(__flang__)
# define _UNUSED_DUMMY(x) if (.false.) then; print*, shape(x); endif
#else
# define _UNUSED_DUMMY(x) if (.false.) then; associate (q____ => x); end associate; endif
#endif
9 changes: 9 additions & 0 deletions pfio/AbstractServer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ subroutine set_status(this,status)

!$omp critical (counter_status)
this%status = status
! llvm-flang has an issue with omp flush of complex data structures
#if !defined(__flang__)
!$omp flush (this)
#endif
!$omp end critical (counter_status)
end subroutine set_status

Expand All @@ -217,7 +220,10 @@ subroutine update_status(this, rc)
!$omp critical (counter_status)
this%status = this%status -1
status = this%status
! llvm-flang has an issue with omp flush of complex data structures
#if !defined(__flang__)
!$omp flush (this)
#endif
!$omp end critical (counter_status)
if (status /= 0) then
_RETURN(_SUCCESS)
Expand Down Expand Up @@ -290,7 +296,10 @@ subroutine set_AllBacklogIsEmpty(this,status)

!$omp critical (backlog_status)
this%all_backlog_is_empty = status
! llvm-flang has an issue with omp flush of complex data structures
#if !defined(__flang__)
!$omp flush (this)
#endif
!$omp end critical (backlog_status)
end subroutine set_AllBacklogIsEmpty

Expand Down

0 comments on commit 2c6751a

Please sign in to comment.