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

Allocatable characters

John4
Valued Contributor I
394 Views

Hi,

I noticed that although the current version of Intel Fortran supports allocatable characters, they require the -assume realloc_lhs option (or explicit allocation) to work properly. The compiler's documentation mentions that such option "may cause extra overhead at run time".

My question is: is it better, in terms of performance, to stick with the iso_varying_string module or to try this new feature?

0 Kudos
1 Solution
Steven_L_Intel1
Employee
394 Views
The requirement of /assume:realloc_lhs is a bug and will be fixed. That switch is there because if you wrote a program with assignments of allocatable arrays for Fortran 90 or 95, you were required to have the left side already allocated to the proper shape. We added the switch to avoid extra checking overhead for existing code.

In the case of allocatable character variables, the checking is part of the normal and desired behavior and should be the default. Indeed, the feature is pretty much useless without it! Just add the switch for now until we fix the bug.

View solution in original post

0 Kudos
3 Replies
Yuan_C_Intel
Employee
394 Views

Hi, John

You may referbelow discussion thread on the problem ofusing"iso_varying_string" module. Basically it's not quite recommended for product use.

http://software.intel.com/en-us/forums/showthread.php?t=62433
0 Kudos
John4
Valued Contributor I
394 Views
I know that iso_varying_string has a lot of issues (e.g., I/O handling, array assignment, length of an empty string, etc.), so you're right about that. But my question was more related to the fact that using the allocatable characters introduced in version 11.1 require "-assume realloc_lhs", which might cause unnecessary headaches (at least for me) and hurt performance.

Thanks to the signature in your post I found an article related to my question:

http://software.intel.com/en-us/articles/allocatable-deferred-length-character-requires-assume-realloc_lhs/

0 Kudos
Steven_L_Intel1
Employee
395 Views
The requirement of /assume:realloc_lhs is a bug and will be fixed. That switch is there because if you wrote a program with assignments of allocatable arrays for Fortran 90 or 95, you were required to have the left side already allocated to the proper shape. We added the switch to avoid extra checking overhead for existing code.

In the case of allocatable character variables, the checking is part of the normal and desired behavior and should be the default. Indeed, the feature is pretty much useless without it! Just add the switch for now until we fix the bug.
0 Kudos
Reply