Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26734 Discussions

Problem with AUTOSETPROPERTY for 64-bit Applications

Michael8
Beginner
359 Views

Hello:

I am running Windows 10, Excel 2016, using the 17.0.2.187 Intel compiler.  I am having a problem with Fortran interfacing with Excel, I and see that I can replicate it with the Autodice example (which is much easier than trying to reproduce a simple test case from my original code).  I take the autodice example, and I can run it as is, other than making a tiny tweak to allow it to recognize Excel 2016.  (Specifically, I changed the do-loop on line 69 to start at 16 instead of 15.)

However, when I switch the platform from "Win32" to "x64", it compiles fine but crashes when running.  It gives an access violation error on line 134:

status = AUTOSETPROPERTY (range, "VALUE", cellCounts)

I have noticed that if the range passed in (i.e., via "cellCounts") is a single value, instead of an array, it works fine.  And as long as the platform is set to Win32, even an array works fine.  But when using x64, it crashes.  Any idea why?

Thanks for your help.
Michael

0 Kudos
20 Replies
Steve_Lionel
Black Belt Retired Employee
340 Views

I see a previous report of this.  It sounds familiar, but I'm not seeing a follow up. 

 

Michael8
Beginner
340 Views

I think that posting is referring to a different issue.  That's the scenario where writing an array to Excel only seems to work for writing it to an Excel row, but not to a column (for some unknown reason).  And I don't think anybody has mentioned that in that case there is a difference between using the Win32 platform vs. the x64 platform.  Also, even though writing an array to an Excel column doesn't work, it also doesn't cause the program to crash.  It just doesn't do what is expected.

However, in my example (which is really the autodice example), it is trying to write the array to an Excel row (not column).  And it works in Win32, but causes the program to crash (with an "access violation" error) in x64.

Thanks.
Michael

Kevin_D_Intel
Employee
340 Views

The issue with Autodice was investigated earlier and determined to relate to this thread. The internal tracking report (formerly DPD200362008, now CMPLRS-8341) indicates there is a fix and it appears it will be in our next PSXE 2017 Update 4 in the coming month.

Michael8
Beginner
340 Views

That's great - glad to hear that the fix is around the corner.

Thanks.
Michael

Justin_v_
Beginner
340 Views

I have been struggling with interactions between Excel and Fortran for some years now - for some reason it appears that the COM directives for FORTRAN are unreliable, resulting in unpredictable crashes.  As a result, I stopped using write calls from FORTRAN to Excel a year or so ago.  I have also found that, following the most recent Windows 10 (creators) update, my legacy read calls to Excel have also stopped working, and can no longer find the Exel library in the Intel Fortran Module Wizard, reinforcing the impression that I have been whipping a dead horse...

I can appreciate that there may not be a high demand for these routines, and that it consequently makes sense not to prioritise developmental resources for them.  As a result, I have opted to addopt a different strategy; FORTRAN calls to C# via a C++ interface.  I appreciate that this will result in reduced efficiency, but an innefficient code that is reliable is preferable to an efficient code that is unreliable.  I have opted to go with C# rather than C++ because I suspect that the same issue that has plagued the FORTRAN calls may apply to C++ (due to weak user demand); in contrast, C# seems as good a bet as any for a language that will reliably interact with Excel. I attach my experimental code to this post in the hope it may save someone else's sanity.

garylscott1
Beginner
340 Views

Although I hated to dispense with my much simpler VB solution, I've had quite good luck and have much better overall control using the excel module as a starting point for creating my own tailored module.  It was a huge amount of work to upgrade the coding standard and integrate it into an existing app, but I now even have more ability to fix errors in the source excel files on the fly.  And some operations are way faster than VB which is a huge benefit since many of the files are quite large.  Once I worked through the com communication process issues, I find it to be very stable and consistent.  One issue I do have though is if I had another instance of Excel open, when my app opens excel and does whatever it does then closes excel, it seems to close the instance of excel I already had open also.

Michael8
Beginner
340 Views

Hello:

I now have Update 4 installed on my computer and am trying this again.  From what I can tell, it looks like perhaps the bug was partially fixed, but not fully.  It now seems to work fine for integers (as in the AutoDice example), but still has a problem when using an array of character strings.  An array of character strings works fine with Win32, but not with x64.

Can someone verify for me that indeed the bug is only partially fixed?  And, if so, is there an expected release date as to when it will be fully fixed?

Thanks.
Michael

Kevin_D_Intel
Employee
340 Views

The bug reported w/Autodice was fixed. We need a reproducer for the variant your describing so Development can investigate to see how it differs from the Autodice scenario and fix any underlying defect.

Can you provide a reproducer or instructions on perhaps how we might modify/leverage Autodice to reproduce what you are seeing?

Michael8
Beginner
340 Views

Hello:

Thanks for looking into this.  Yes, the AutoDice example now works under x64.  Note that the AutoDice example is writing integers to the Excel file.  To reproduce the error with character strings, you can easily modify the AutoDice example as such:

1) Declare the variable "cellCounts" to be character*2, instead of being an integer*2.
2) In the do-loop that initializes the cellCounts(i) to be zero, instead initialize it to be an empty string (or any 2-character string you want).
3) Comment out the line that increments cellCounts: cellCounts(roll) = cellCounts(roll) + 1

The program should now compile, and you should get an "access violation" error when running using the x64 platform.  (It works fine with Win32.)

Thanks.
Michael

Michael8
Beginner
340 Views

Hello:

I'm just following up to see if you were able to reproduce the error, using the instruction I gave in my previous post.

Thanks.
Michael
 

Kevin_D_Intel
Employee
340 Views

No, my apologies, not yet. I lacked having update 4 installed were I also have Excel but that's in progress now. I'll try updating you by tomorrow.

Kevin_D_Intel
Employee
340 Views

I can reproduce the failure on Intel 64 following your instructions. I will submit this to Development asap. Thank you.

(Internal tracking id: CMPLRS-43259)

Michael8
Beginner
340 Views

Thank you very much.

Please keep me posted (particularly if you have an estimate as to when this should get fixed).

Thanks.
Michael
 

Michael8
Beginner
340 Views

Hello:

Do you have any information as to when this bug is scheduled to be fixed?

Thank you.
Michael

Devorah_H_Intel
Moderator
340 Views

The issue is still being investigated by development. I will update you on the progress.

Thank you for your patience.

Michael8
Beginner
340 Views

Hello:

I just wanted to check in to see if there has been any progress in fixing this bug, and to see if you have an estimated date as to when a fix might be available.

Thanks.
Michael

Devorah_H_Intel
Moderator
340 Views

Michael wrote:

I just wanted to check in to see if there has been any progress in fixing this bug, and to see if you have an estimated date as to when a fix might be available.

This issue was fixed. The fix will be available with both 17.0 U5 and 18.0 releases.

Michael8
Beginner
340 Views

That's great to hear.  Thank you for the update.  Any idea when XE 17.0 Update 5 will be available?

Thanks.
Michael

Devorah_H_Intel
Moderator
340 Views

Michael wrote:

 Any idea when XE 17.0 Update 5 will be available?

Thanks.
Michael

By mid-fall.

Michael8
Beginner
174 Views

Hello:

I just wanted to close the loop on this.  I have upgraded to Update 5 and tested the program.  Indeed the bug is fixed!

Thanks.
Michael

Reply