# Thread: How to decide of check the workspace of LSLXG in IMSL

1. ## How to decide of check the workspace of LSLXG in IMSL

Hi everyone,
I have a question about the value of workspace in IMSL. Now I use the function of LSLXG to solve a sparse system of linear equations. In the IMSL users' guide, it said the workspace may be explicitly provided by set the value of IPARAM(5). When the matrix is large enough ,I found I must set this value to avoid the error of "core dump". So I have two questions:
1. How to decide the value of the workspace (that is the value of IPARAM(5))?
2. If I set a very large value of the workspace and the program is compiled successful. Is it possible to find out the real value of the workspace it used and I could reset it properly?

Any answers or ideas or useful materials are welcome!Thank you in advance.

jorsey

2. You may have already seen this, but the Comments section of the documentation for LSLXG includes details about workspace, including

Workspace may be explicitly provided, if desired, by use of L2LXG/DL2LXG. The reference is:

CALL L2LXG (N, NZ, A, IROW, JCOL, B, IPATH, IPARAM, RPARAM, X, WK, LWK, IWK, LIWK)
The additional arguments are as follows:
WK — Real work vector of length LWK.
LWK — The length of WK, LWK should be at least 2N + MAXNZ.
IWK — Integer work vector of length LIWK.
LIWK — The length of IWK, LIWK should be at least 17N + 4 * MAXNZ.

The workspace limit is determined by MAXNZ, where
MAXNZ = MIN0(LWK-2N, INT(0.25(LIWK-17N)))

3. Hi omega,
Thank you very much for your reply. Yes, I have already seen this in users' guide. But I still can't understand: the value of LWK and LIWK is decided by MAXNZ, but the last line shows MAXNZ is decided by LWK and LIWK. Could you help me explain more about that? Really appreciate your help.

jorsey

4. I agree that the documentation is not clear on workspace allocation and, if we think of MAXNZ as the maximum possible value of NZ for which the workspace provided would be sufficient, we would be wrong. Here is the relevant portion of text from the IMSL Version 4 manual for LSLXG:
MAXNZ is the maximal number of nonzero elements at any stage of the
Gaussian elimination. In the absence of other information, setting MAXNZ
equal to 3 * NZ is recommended. Higher or lower values may be used
depending on fill-in
It would be helpful if the IMSL people confirmed that this statement is still valid for later versions of IMSL. With this important text omitted, the documentation for the current version of IMSL-Fortran leaves MAXNZ undefined and open to false interpretation.

5. Hi mecej4,

6. We have confirmed that the description of MAXNZ was inadvertently dropped from the comments section of the LSLXG documentation. The description shown in the post dated 04-05-2014 is correct, and will be reinserted in a future version. Thanks for letting us know about it.

IMSL Technical Support