- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Of course, this IS a bug. If one is accepted, all of these should be.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Barbara,
What about
PRINT '("Value=",F6.2)', 123.456
(my oneAPI system is not fired up)
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or
WRITE(CharacterVariable, '("Value=",F6.2)') 123.456
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page