Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Code stops after a call to BLACS_GRIDEXIT

OP1
New Contributor III
736 Views

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).

The code is linked with the ilp64 MKL libraries for BLACS and ScaLAPACK.

Am i missing something obvious here?

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

 

0 Kudos
2 Replies
OP1
New Contributor III
735 Views

Line 26 in the code above should be removed (i should have done so before posting...) but this does not modify the outcome here.

0 Kudos
OP1
New Contributor III
734 Views

Also, when did we lose the ability to edit posts?

0 Kudos
Reply