Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
27425 Discussions

ifx compiler error #8945: Generalized I/O not supported in an offload region.

John_Michalakes
429 Views

Compiling the snippet: 

!$omp target
      write(*,*)1234
!$omp end target

generates the error:

ifx -qopenmp -fopenmp-targets=spir64 -g -traceback  -c tbp.F90
tbp.F90(53): error #8945: Generalized I/O not supported in an offload region.
      write(*,*)1234
------^
compilation aborted for tbp.F90 (code 1)

Note: Simple write statements to standard output from an OpenACC offload region are supported by the Nvidia (PGI) compiler. 

Questions:

  • Is it possible to have debugging output in a target region of a Fortran program using OpenMP offload and compiling with ifx?
  • If this is not currently supported, are there plans for ifx to support simple output from target regions in the future? 
  • Any other suggestions for inspecting the values of variables in running device code?

Thank you,

John

 

 

0 Kudos
9 Replies
Barbara_P_Intel
Moderator
382 Views

This snippet compiles for me .

$ cat snippet.f90
program snippet
!$omp target
x = 1234.
print *, x
print *, 1234
!$omp end target
stop
end
$ ifx -qopenmp -fopenmp-targets=spir64 snippet.f90
$ ifx -what --version
ifx (IFORT) 2022.0.0 20211123
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.

 

 

 

 

John_Michalakes
367 Views

Thanks for looking into this.  It must be because I was using a write(*,*) instead of print*

If I change one of the prints in your snippet I get:

$ cat snip.F90
program snippet
!$omp target
x = 1234.
write(*,*) x
print *, 1234
!$omp end target
stop
end
$ ifx -qopenmp -fopenmp-targets=spir64 snip.F90
snip.F90(4): error #8945: Generalized I/O not supported in an offload region.
write(*,*) x
^
compilation aborted for snip.F90 (code 1)
$

Mystery solved, thank you.

John 

Barbara_P_Intel
Moderator
363 Views

You're welcome.

I tried variations of the write, like write(6,*) and write(6,5). All got that same message. But print does compile.


Steve_Lionel
Black Belt Retired Employee
343 Views

Of course, this IS a bug. If one is accepted, all of these should be.

Barbara_P_Intel
Moderator
331 Views

According to the Fortran developers, "At this time, the only I/O we’re allowing in an offload region is 'print *' and even that is limited to numeric and character strings."

I'll add that tidbit to the Porting Guide for ifort Users to ifx

John_Michalakes
326 Views

Thanks all for following up.  For what it's worth, write(*,*) and print* are analogous.  But I'm in good shape, now that I know the rule. 

Also FWIW, I think output of numeric and character strings to stdout from print and write(*,*) is all that the Nvidia compiler supports from an offload region.

jimdempseyatthecove
Black Belt
317 Views

Barbara,

What about

    PRINT '("Value=",F6.2)', 123.456

 

(my oneAPI system is not fired up)

Jim Dempsey

jimdempseyatthecove
Black Belt
313 Views

Or

    WRITE(CharacterVariable, '("Value=",F6.2)') 123.456

 

Jim Dempsey

Barbara_P_Intel
Moderator
306 Views

Doesn't look like it inside an OpenMP TARGET region.

+ ifx -qopenmp -fopenmp-targets=spir64 snippet.f90
snippet.f90(7): error #8945: Generalized I/O not supported in an offload region.
PRINT '("Value=",F6.2)', 123.456
^
snippet.f90(8): error #8945: Generalized I/O not supported in an offload region.
WRITE(CharacterVariable, '("Value=",F6.2)') 123.456
^
compilation aborted for snippet.f90 (code 1)

 

 

Reply