Is ARPACK thread safe?

Is it possible to use ARPACK eigensolver from different streams simultaneously from a program written in C? Or, if ARPACK itself is not thread safe, is there an API compatible stream implementation there? A quick Google search didn’t bring anything useful, but given the fact that ARPACK is widely used in large scientific calculations, I would be surprised to find that this is the first who needs a streaming sparse eigensolver.

I am not very familiar with Fortran, so I translated the source code of ARPACK to C with f2c, and it seems that there are quite a few static variables. In principle, all the local variables in the translated routines seem static, implying that the library itself is not thread safe.

+5
source share
4 answers

Fortran 77 does not support recursion, and therefore, the standard appropriate compiler can select all the variables in the program data section; in principle, neither a stack nor a heap are needed [1].

, , f2c, , , f2c, , . , , COMMON-. . SAVE. SAVE , , C. SAVE, , , , , Fortran. , , . Wrt. ARPACK , , ARPACK, , , , .

Fortran . , ARPACK , , gfortran -frecursive.

:

[1] , , , Fortran , , - Fortran , Fortran 90. , , , , .

+3

ARPACK C, f2c. , f2c , -a. utomatic , .. , , .

, ARPACK . ( ) . , , . , , ARPACK, , , .

C, . C . , , . , , , .

, .

+4

ARPACK BLAC ? . , f2c , Fortran , , Fortran.

+1

I don’t know what strategy f2c uses when translating Fortran. Since ARPACK is written in FORTRAN 77, the first thing to do is check for COMMON blocks. These are global variables, and if used, the code is most likely not thread safe. The ARPACK web page, http://www.caam.rice.edu/software/ARPACK/ , says that there is a parallel version - it seems that this version is thread safe.

+1
source

All Articles