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

READ(*,'(a)') error

sanjayg0
Novice
6,220 Views

I have a simple program

program qwin2
character (len=256) :: record
write(*,*) 'Input: '
read(*,'(a)') record
write(*,*) 'read string', record
end program qwin2

I am using VS 2019 (ver 16.6.2) with Intel Fortran Package ID:w_oneAPI_2021.4.0.364 (installed today), using IFORT and a quick win project, x64.

Compiling and running throws an error of

Expression: (L "Buffer is too small" && 0)

when i enter any string and hit return.  If I just hit return without typing anything the error is

Expression: ((destination)) != NULL && ((size_in_elements)) > 0

Either way the errors are from the read statement.  The stack trace shows problems on Line 22 in QWin2.exe!strncpy_s and Line 218 in QWin.exe!common_tcsncpy_s, so system routines.  Following the stack in the debugger, I can see my input string is correct in the locals for strncpy_s with the correct length as it is in common_tcsncpy_s.

 

Does anyone know what is going on here?  Thanks in advance for any ideas.

-sanjay

1 Solution
Barbara_P_Intel
Moderator
4,534 Views

Yes, it should be fixed in the oneAPI 2022.2 release, ifort 2021.6.0. I haven't tried it myself.

 

View solution in original post

39 Replies
Steve_Lionel
Honored Contributor III
2,288 Views

It would affect only new builds of applications, since QuickWin is a static link library only. I have no idea what Intel's schedule for this is.

One can revert to a slightly older version (2021.3.0) and it works.

preshenne
Novice
2,284 Views

How does one revert from 2021.4 to 2021.3?  2021.4 was first install on new machine.

Steve_Lionel
Honored Contributor III
2,276 Views

I don't know how to download a previous version of one of the oneAPI compilers - perhaps an Intel rep will comment. If you upgraded from an earlier version, the old version is still installed and can be switched to in Visual Studio How to Select Intel® Fortran Compiler and Compiler Version in...

Devorah_H_Intel
Moderator
2,258 Views

@preshenne 

While fixes take some time to be implemented and released (no date on that) here is a link to download oneAPI 2021.3

https://registrationcenter-download.intel.com/akdlm/irc_nas/17940/w_HPCKit_p_2021.3.0.3227_offline.exe

preshenne
Novice
2,248 Views

Hi Devorah -

Thank you very much for this link.  It was successful for installing 2021.3 with 2021.4 still installed - amazing.   Tested it on the READ(*,'(A)')  error and it executes correctly.  Fantastic.  I am back in business.  I am very happy you provided that link.  Well done.

 

How will we know when this bug is fixed for future versions?

 

Pres Henne

Wen-TUD
Novice
1,346 Views

Hi Devorah,

 

thanks very much for the link. However, it seems I cannot install this on my laptop. In the following step, it disappears automatically....

 

would be grateful if you could help on this issue. thanks.

wen

 

WenTUD_0-1686150419641.png

 

0 Kudos
sanjayg0
Novice
2,156 Views

Does anyone know if the reported QuickWin read error was fixed in the March 3, 2022 release? Hoping to save myself the installation time and disk space, if the fix has not been made yet.

0 Kudos
Barbara_P_Intel
Moderator
2,152 Views

The March 3 release, 2022.1.3, fixed an installation issue.  The compiler was not updated.

Good thing you asked!

 

sanjayg0
Novice
1,985 Views

@Barbara_P_Intel

I see there is a oneAPI 2022.2 release out.  Is the patch for this issue included in that release?

 

0 Kudos
Barbara_P_Intel
Moderator
4,535 Views

Yes, it should be fixed in the oneAPI 2022.2 release, ifort 2021.6.0. I haven't tried it myself.

 

Steve_Lionel
Honored Contributor III
1,955 Views

I tried it, it is fixed.

sanjayg0
Novice
1,946 Views

Thanks!  Time to upgrade my compiler now.

0 Kudos
Wen-TUD
Novice
1,337 Views

Hi Steve,

 

Which version did you try? I try the newest, i.e. 2023.1.0. The error is still there.

 

thanks,

wen

0 Kudos
Steve_Lionel
Honored Contributor III
1,321 Views

Screenshot 2023-06-08 131157.png

Note that ifx does not yet support QuickWin (I've never found out why, but have been told it will be addressed in the future.)

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,310 Views

Steve,

While it is known that .obj files are compatible between ifort and ifx (e.g. PROGRAM/w QuickWin can be linked with .lib build from ifx), do you know if the resultant program remains capable of the SYCL offloading? IOW is there a different hidden initialization performed by ifx that enables the SYCL runtime system (or is it done on first call)?

Jim Dempsey

0 Kudos
Steve_Lionel
Honored Contributor III
1,302 Views

Jim, I can barely spell SYCL much less be able to tell you anything about it. I don't see the connection with the problem described in this thread.

In another thread I demonstrated that it was possible, in at least some cases, to use ifx to build a QuickWin program, but it takes some effort.

0 Kudos
Ron_Green
Moderator
1,289 Views

Hi Jim,

 

There is no prologue code for SYCL in IFX. 

IFX only supports OpenMP directly.  SYCL is external.  They use different runtime libraries currently.  IFX brings in the OMP runtime for offload with the -fopenmp-targets option.  But again, this is the OMP RT.  Not the SYCL RT.

I think there is some online doc somewhere about calling SYCL from Fortran.  I'll see if I can dig it up.  Off the top of my head, I'd guess you have to convert your PROGRAM to a subroutine or function called from a C++/SYCL main, and use icx -fsycl for the final link step.  

0 Kudos
Ron_Green
Moderator
1,271 Views

@jimdempseyatthecove  Barbara had captured the process for SYCL + IFX in the Porting Guide.  I thought I had seen it somewhere, and there it was in plain sight in the Porting Guide.

 

 Link Using ifx with dpcpp Object Files

Some developers are choosing to offload compute kernels in a Fortran program using DPC++. 

To link successfully, additional ifx compiler options are required as in this example:

dpcpp -c device.cpp

ifx -qopenmp -fsycl host.f90 device.o -lstdc++ -lsycl

This works for ifx 2022.1.0 and earlier. In a future release, -qopenmp will not be required.

0 Kudos
Ron_Green
Moderator
1,271 Views

@Barbara_P_Intel we'll have to update the Porting Guide.  the 'dpcpp' driver is deprecated.  Instead of 'dpcpp' above use

 

icx -fsyscl -c device.cpp
0 Kudos
Reply