<?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 Re: Re:Code stops after a call to BLACS_GRIDEXIT in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1720140#M37377</link>
    <description>&lt;P&gt;[ignoring the fact that I should have written "process 6" in my latest message]&lt;/P&gt;&lt;P&gt;In fact, when I run this simplified example consecutively, multiple times, sometimes I get no output at all, sometimes only a subset of the processes 0... 5 print something. There is a randomness to it. Can you try to repeat this on your side?&lt;/P&gt;</description>
    <pubDate>Wed, 01 Oct 2025 15:36:04 GMT</pubDate>
    <dc:creator>OP1</dc:creator>
    <dc:date>2025-10-01T15:36:04Z</dc:date>
    <item>
      <title>Code stops after a call to BLACS_GRIDEXIT</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1719344#M37364</link>
      <description>&lt;P&gt;The following code (built with ifx 2025.2.1 on Windows and run with 7 processes) silently crashes after the call to BLACS_GRIDEXIT on line 19 (namely, it does not execute anything past line 19).&lt;/P&gt;&lt;P&gt;The code is linked with the ilp64 MKL libraries for BLACS and ScaLAPACK.&lt;/P&gt;&lt;P&gt;Am i missing something obvious here?&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;PROGRAM TEST
IMPLICIT NONE (TYPE, EXTERNAL)
EXTERNAL BLACS_GRIDINIT, BLACS_GRIDINFO, BLACS_PINFO, BLACS_GET, BLACS_PCOORD, BLACS_GRIDEXIT
INTEGER(KIND = 8), EXTERNAL :: BLACS_PNUM
INTEGER(KIND = 8) :: ICTXT, MY_ID, N_PROCS, N_PROW, N_PCOL
INTEGER(KIND = 8) :: MY_ROW, MY_COL

CALL BLACS_PINFO(MY_ID, N_PROCS)
N_PROW = INT(SQRT(REAL(N_PROCS)))
N_PCOL = N_PROCS/N_PROW

CALL BLACS_GET(-1_8, 0_8, ICTXT)
CALL BLACS_GRIDINIT(ICTXT, 'C', N_PROW, N_PCOL)
CALL BLACS_GRIDINFO(ICTXT, N_PROW, N_PCOL, MY_ROW, MY_COL)
IF (MY_ID /= 6) THEN
    WRITE(*, *) 'C', MY_ID, BLACS_PNUM(ICTXT, MY_ROW, MY_COL), MY_ROW, MY_COL
END IF

CALL BLACS_GRIDEXIT(ICTXT)

CALL BLACS_GET(-1_8, 0_8, ICTXT)
CALL BLACS_GRIDINIT(ICTXT, 'R', N_PROW, N_PCOL)
CALL BLACS_GRIDINFO(ICTXT, N_PROW, N_PCOL, MY_ROW, MY_COL)
IF (MY_ID /= 6) THEN
    WRITE(*, *) 'R', MY_ID, BLACS_PNUM(ICTXT, MY_ROW, MY_COL), MY_ROW, MY_COL
    CALL BLACS_GRIDEXIT(ICTXT)
END IF

END PROGRAM TEST&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2025 20:59:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1719344#M37364</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2025-09-26T20:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Code stops after a call to BLACS_GRIDEXIT</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1719345#M37365</link>
      <description>&lt;P&gt;Line 26 in the code above should be removed (i should have done so before posting...) but this does not modify the outcome here.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2025 21:01:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1719345#M37365</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2025-09-26T21:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Code stops after a call to BLACS_GRIDEXIT</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1719346#M37366</link>
      <description>&lt;P&gt;Also, when did we lose the ability to edit posts?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2025 21:03:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1719346#M37366</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2025-09-26T21:03:28Z</dc:date>
    </item>
    <item>
      <title>Re:Code stops after a call to BLACS_GRIDEXIT</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1720130#M37375</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Does the same problem happen when running for 6 or 8 processes?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You create a grid of size 2×3 (6 positions), but you're running with 7 processes. Process number 6 has no valid grid position, which can cause the MPI to abort.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Oct 2025 14:44:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1720130#M37375</guid>
      <dc:creator>Aleksandra_K</dc:creator>
      <dc:date>2025-10-01T14:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Code stops after a call to BLACS_GRIDEXIT</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1720138#M37376</link>
      <description>&lt;P&gt;I am afraid that I do not understand your reply at all. Are you saying that it is impossible to run an arbitrary number of processes for a program relying on BLACS, and that only the number of processes that match exactly the number of processes in a BLACS process grid is allowed? This is not how BLACS work!&lt;/P&gt;&lt;P&gt;I simplified the code a bit further:&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;PROGRAM TEST
IMPLICIT NONE (TYPE, EXTERNAL)
EXTERNAL BLACS_GRIDINIT, BLACS_PINFO, BLACS_GET, BLACS_GRIDEXIT
INTEGER(KIND = 8) :: ICTXT, MY_ID, N_PROCS, N_PROW, N_PCOL

CALL BLACS_PINFO(MY_ID, N_PROCS)
N_PROW = INT(SQRT(REAL(N_PROCS)))
N_PCOL = N_PROCS/N_PROW
CALL BLACS_GET(-1_8, 0_8, ICTXT)
CALL BLACS_GRIDINIT(ICTXT, 'C', N_PROW, N_PCOL)
CALL BLACS_GRIDEXIT(ICTXT)

WRITE(*, *) MY_ID

END PROGRAM TEST&lt;/LI-CODE&gt;&lt;P&gt;Running the code with 7 processes, the output is:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="none"&gt; 1
 0
 3
 5
 2
 4
Press any key to continue . . .&lt;/LI-CODE&gt;&lt;P&gt;Why isn't process 7 printing anything here?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Oct 2025 15:29:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1720138#M37376</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2025-10-01T15:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Code stops after a call to BLACS_GRIDEXIT</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1720140#M37377</link>
      <description>&lt;P&gt;[ignoring the fact that I should have written "process 6" in my latest message]&lt;/P&gt;&lt;P&gt;In fact, when I run this simplified example consecutively, multiple times, sometimes I get no output at all, sometimes only a subset of the processes 0... 5 print something. There is a randomness to it. Can you try to repeat this on your side?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Oct 2025 15:36:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1720140#M37377</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2025-10-01T15:36:04Z</dc:date>
    </item>
    <item>
      <title>Re:Code stops after a call to BLACS_GRIDEXIT</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1720142#M37378</link>
      <description>&lt;P&gt;Could you share how exactly you are running the code? So that I could precisely reproduce your issue.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Oct 2025 16:06:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1720142#M37378</guid>
      <dc:creator>Aleksandra_K</dc:creator>
      <dc:date>2025-10-01T16:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Code stops after a call to BLACS_GRIDEXIT</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1720149#M37379</link>
      <description>&lt;P&gt;Here is the BuildLog.htm file that is produced when building the last example above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Oct 2025 17:12:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1720149#M37379</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2025-10-01T17:12:03Z</dc:date>
    </item>
    <item>
      <title>Re:Code stops after a call to BLACS_GRIDEXIT</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1722519#M37391</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We investigated your issue and confirmed that the problem is in the gridexit call. The context of rank 6 is set to -1 during blacs_gridinit -&amp;gt; blacs_gridmap, which causes the error when gridexit is called. You were right that it is fine to use only a subset of processes for computation. Nevertheless, it is not a bug, as this behavior of gridexit is consistent with the reference BLACS implementation (&lt;A href="https://www.netlib.org/scalapack/explore-html/db/dcd/blacs__grid___8c_a9352e8d1471370c0dc78cf8fca2efd7d.html" rel="noopener noreferrer" target="_blank"&gt;SCALAPACK: blacs_gridexit_&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Oct 2025 13:58:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1722519#M37391</guid>
      <dc:creator>Aleksandra_K</dc:creator>
      <dc:date>2025-10-17T13:58:13Z</dc:date>
    </item>
    <item>
      <title>Re:Code stops after a call to BLACS_GRIDEXIT</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1722891#M37393</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;Do you have any further questions on the topic?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Oct 2025 11:29:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1722891#M37393</guid>
      <dc:creator>Aleksandra_K</dc:creator>
      <dc:date>2025-10-21T11:29:39Z</dc:date>
    </item>
    <item>
      <title>Re:Code stops after a call to BLACS_GRIDEXIT</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1723362#M37398</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I hope that you found the above explanation useful. We'll monitor this thread for another 3 days for any follow-up questions. If there's no response within that time, this thread will no longer be actively supported by Intel.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Oct 2025 08:27:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1723362#M37398</guid>
      <dc:creator>Aleksandra_K</dc:creator>
      <dc:date>2025-10-24T08:27:02Z</dc:date>
    </item>
    <item>
      <title>Re:Code stops after a call to BLACS_GRIDEXIT</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1724365#M37423</link>
      <description>&lt;P&gt;With no response from you, this issue will no longer be tracked by Intel. If you need any additional information, please post a new question, ideally in a new thread,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 31 Oct 2025 12:32:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Code-stops-after-a-call-to-BLACS-GRIDEXIT/m-p/1724365#M37423</guid>
      <dc:creator>Aleksandra_K</dc:creator>
      <dc:date>2025-10-31T12:32:53Z</dc:date>
    </item>
  </channel>
</rss>

