<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Ok, thanks.  Last question -- in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113484#M129716</link>
    <description>&lt;P&gt;Ok, thanks. &amp;nbsp;Last question -- The guide specifies that a C/C++ routine can be used if the ISO_C_BINDINGS module features are used -- does this mean if you use the C bindings to specify the prototype of the handler function, the library will call the C/C++ routine directly, or is this implying a Fortran wrapper needs to be called, and the wrapper can call the C/C++ routine using the bindings module?&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2016 15:04:34 GMT</pubDate>
    <dc:creator>ereisch</dc:creator>
    <dc:date>2016-10-14T15:04:34Z</dc:date>
    <item>
      <title>Trapping RTL errors</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113480#M129712</link>
      <description>&lt;P&gt;Any update by chance on the feature request in this post?&amp;nbsp;&lt;A href="https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/270668"&gt;https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/270668&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;A quick recap: internal run-time library errors (such as invalid I/O namelist reads, array indexing out-of-bounds, and other "internal" problems) will print a useful stack trace and terminate program execution. &amp;nbsp;It would be helpful if one could either register a callback which could be executed prior to the exit() call, or raising a signal which could have a user-defined handler registered with the kernel. &amp;nbsp;This would allow graceful shutdown of things like child-processes or sockets. &amp;nbsp;I understand the signal-raising method could be difficult since it could leave the RTL in an undefined state if the user tries to do other library-involved operations as part of their handler function.&lt;/P&gt;

&lt;P&gt;If the feature hasn't made its way in yet, is there a library-provided function which we can write and link-in an alternative to (with an equivalent prototype) to override the RTL's internal error termination function?&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 18:48:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113480#M129712</guid>
      <dc:creator>ereisch</dc:creator>
      <dc:date>2016-10-13T18:48:10Z</dc:date>
    </item>
    <item>
      <title>Take a look at ESTABLISHQQ.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113481#M129713</link>
      <description>&lt;P&gt;Take a look at &lt;A href="https://software.intel.com/en-us/node/679258"&gt;ESTABLISHQQ&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 19:01:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113481#M129713</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-10-13T19:01:40Z</dc:date>
    </item>
    <item>
      <title>That appears to be exactly</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113482#M129714</link>
      <description>&lt;P&gt;That appears to be exactly what I needed thanks. &amp;nbsp;The documentation is a little unclear as to the prototype for the handler function though. &amp;nbsp;From the example, it appears as though the parameter data types for the handler function are INT, LOGICAL, CHAR(*), and, INT, and it appears as though the size of the last parameter is the word size of the program, but are the first two INT*4 and LOGICAL*4?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 13:48:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113482#M129714</guid>
      <dc:creator>ereisch</dc:creator>
      <dc:date>2016-10-14T13:48:02Z</dc:date>
    </item>
    <item>
      <title>They are INTEGER(4) and</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113483#M129715</link>
      <description>&lt;P&gt;They are INTEGER(4) and LOGICAL(4), or default integer and logical. The documentation really ought to include the prototype - I'll ask that that be done. Here's the interface from ifestablish.f90:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;    abstract interface

        function establishqq_handler (error_code, continuable, message_string, context)

        import
        ! Function result that indicates whether or not the condition was handled.
        ! .TRUE. means that the handler took action and execution should continue if possible;
        ! .FALSE. means that the handler wishes the RTL to do what it would normally do with this condition.
        !
        logical :: establishqq_handler
    
        ! Arguments
        !
        integer,      intent(in) :: error_code         ! RTL error code from IOSTAT table
        logical,      intent(in) :: continuable        ! .TRUE. if condition is continuable
        character(*), intent(in) :: message_string     ! Formatted message string as in ERRMSG/IOMSG
        integer(INT_PTR_KIND()), intent(in) :: context ! Address-sized integer as passed in to call to ESTABLISHQQ
                                                       ! For whatever purpose the programmer desires.  The value is
                                                       ! saved, so changes after the establish call have no effect.
        end function establishqq_handler&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;One thing I see here now (and I have only myself to blame because I wrote this) is that the first two arguments ought to have their kinds explicitly specified using the kinds declared in ISO_FORTRAN_ENV. I'll ask that that be done. Otherwise there could be problems if the program was compiled with different options for integer and logical size.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 14:53:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113483#M129715</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-10-14T14:53:23Z</dc:date>
    </item>
    <item>
      <title>Ok, thanks.  Last question --</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113484#M129716</link>
      <description>&lt;P&gt;Ok, thanks. &amp;nbsp;Last question -- The guide specifies that a C/C++ routine can be used if the ISO_C_BINDINGS module features are used -- does this mean if you use the C bindings to specify the prototype of the handler function, the library will call the C/C++ routine directly, or is this implying a Fortran wrapper needs to be called, and the wrapper can call the C/C++ routine using the bindings module?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 15:04:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113484#M129716</guid>
      <dc:creator>ereisch</dc:creator>
      <dc:date>2016-10-14T15:04:34Z</dc:date>
    </item>
    <item>
      <title>That text (which I didn't</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113485#M129717</link>
      <description>&lt;P&gt;That text (which I didn't write!) is incorrect. The module ISO_C_BINDING (no S at the end) has nothing to do with calling procedures. But yes, if you choose to implement the handler routine in some other language, it will be called directly - just make sure that it is interoperable with the interface shown. Note that since one of the arguments is CHARACTER, a hidden length will be passed. (This length is "size_t", passed by value, after all the other arguments.)&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 16:06:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113485#M129717</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-10-14T16:06:40Z</dc:date>
    </item>
    <item>
      <title>It doesn't seem as though the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113486#M129718</link>
      <description>&lt;P&gt;It doesn't seem as though the ESTABLISHQQ function can be resolved if you have "-assume nounderscore" specified on your compile line. &amp;nbsp;If I duplicate the interface found in ifestablish.f90 in my source and append the underscore to the interface, and then manually append the underscore when I call the function, it links successfully.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2016 21:19:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113486#M129718</guid>
      <dc:creator>ereisch</dc:creator>
      <dc:date>2016-10-14T21:19:40Z</dc:date>
    </item>
    <item>
      <title>The better approach is to add</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113487#M129719</link>
      <description>&lt;P&gt;The better approach is to add to the interface for ESTABLISHQQ:&lt;/P&gt;

&lt;P&gt;!DEC$ ATTRIBUTES DEFAULT :: ESTABLISHQQ&lt;/P&gt;

&lt;P&gt;I will ask that this be corrected. It's actually a bit worse than this, as the library routine should be called for_establishqq or something like that. Sorry for the problems.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2016 21:18:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113487#M129719</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-10-16T21:18:10Z</dc:date>
    </item>
    <item>
      <title>It should be noted that the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113488#M129720</link>
      <description>&lt;P&gt;It should be noted that the need for the workaround:&lt;/P&gt;&lt;P&gt;!DEC$ ATTRIBUTES DEFAULT :: ESTABLISHQQ&lt;/P&gt;&lt;P&gt;...is still a bug in ifort version 18.0.5.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 21:15:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113488#M129720</guid>
      <dc:creator>ereisch</dc:creator>
      <dc:date>2019-03-06T21:15:38Z</dc:date>
    </item>
    <item>
      <title>Steve,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113489#M129721</link>
      <description>&lt;P&gt;Steve,&lt;/P&gt;&lt;P&gt;Could you suggest to Intel that they a practical example to illustrate its use. An example I would like to see would be a divide by 0 handler where you can insert a desired result. If possible, extend this to a div/0 within a vectorized routine as well.&lt;/P&gt;&lt;P&gt;An example would be in a particle simulation where two particles co-reside.&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 13:13:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113489#M129721</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2019-03-08T13:13:31Z</dc:date>
    </item>
    <item>
      <title>Jim, that's not possible</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113490#M129722</link>
      <description>&lt;P&gt;Jim, that's not possible using ESTABLISHQQ. You could create a routine that does this sort of recovery using the facilities in the IEEE_xxx modules.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 14:05:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Trapping-RTL-errors/m-p/1113490#M129722</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2019-03-08T14:05:07Z</dc:date>
    </item>
  </channel>
</rss>

