From cfe1326048b897680bdf9af3bbdd90bc14200e7c Mon Sep 17 00:00:00 2001 From: Konstantin Riabinin Date: Mon, 2 Feb 2026 16:06:47 +0100 Subject: [PATCH] Fix for obtaining BLACS context. It allows to use EigenExa with a dedicated communicator, not just MPI_COMM_WORLD. After this fix, it is not needed to call eigen_init in every process anymore, but only in the participating ones, passing the appropriate communicator. --- src/eigen_blacs.F | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/eigen_blacs.F b/src/eigen_blacs.F index 379757a..087010c 100644 --- a/src/eigen_blacs.F +++ b/src/eigen_blacs.F @@ -67,7 +67,10 @@ subroutine eigen_blacs_init(TRD_COMM_WORLD, integer :: i, j, k, ierr - call BLACS_GET(0, 0, BLACS_ICONTXT_FOR_EIGENEXA) +! In Fortran, BLACS context shares the same value with the MPI +! commuicator, so it is safe to use TRD_COMM_WORLD as +! BLACS_ICONTXT_FOR_EIGENEXA. + BLACS_ICONTXT_FOR_EIGENEXA = TRD_COMM_WORLD allocate(tmpgrid(1:x_nnod, 1:y_nnod), & kk0(1:x_nnod), kk1(1:x_nnod), stat=ierr)