multithreading using lscs_mp
#1
multithreading using lscs_mp
First disclosure: I am not much of a programmer or one that knows about sys admin in Irix.  Sad

I am trying to compile a set of C and Fortran 90 programs for engineering calculations in my Octane 2 that has 2x 400 MHz CPUS. I want to use the SGI Scientific Library called SCSL for solving large sparse matrices. I was instructed to link with '-lscs_mp' to run the code in multi-threading mode. Compilation with gmake and gcc 4.7.1 was successful. However when I run the executable I get the error:

Code:
trying to sprocsp: Operation not permitted

This happens just before the attempt to factor the matrix and a call is made to use the library 'lcsc_mp'.

There is no error if I just compile with '-lscs'.

The program I am compiling uses pthreads. I have been digging around and I found this statement in Irix manpage for lscs:

Quote:"The -lscs_mp option directs the linker to use the multi- processor version of the library. The multi-processor version of SCSL, libscs_mp, is a Shared Memory (SMP) version that is based on libmp. libmp uses IRIX lightweight processes (sproc) to implement parallel execution. POSIX threads (pthreads) are incompatible with sproc calls.  Pthreads and sproc calls have  fundamentally different characteristics that prevent coexistence, such as process identity, memory, and parent-child relationships. Therefore, a program that uses the POSIX threads cannot use the multi-processor version of SCSL."

Can someone please advice or suggest what I can try that allow me to run my program to use the lscs in multi-threading mode? Much appreciated!
(This post was last modified: 11-01-2018, 08:44 PM by kmallick.)
kmallick
O2

Posts: 3
Threads: 1
Joined: Oct 2018
Find Reply
11-01-2018, 08:37 PM
#2
RE: multithreading using lscs_mp
SPROC and pthreads cannot coexist in one program, they are mutually exclusive.
If lscs_mp requires SPROC then your code should use SPROC only.

I understand that the code you're using is using pthreads, this means that you need to use something else to solve large sparse matrices.
Because i have worked in numerical engineering for quite some time, may i suggest to you libraries like UMFPACK or SPQR?
These are well suited for solving large sparse matrices with respectively full rank or rank deficient systems.
See http://faculty.cse.tamu.edu/davis/suitesparse.html for code. You may need an older version for SPQR to compile it under IRIX systems

They require fast BLAS and LAPACK libraries, these are provided in IRIX, or you could roll-your-own using ATLAS, see http://math-atlas.sourceforge.net/
dexter1
Global Moderator
******

Posts: 155
Threads: 9
Joined: May 2018
Find Reply
11-02-2018, 06:36 AM
#3
RE: multithreading using lscs_mp
(11-02-2018, 06:36 AM)dexter1 Wrote:  SPROC and pthreads cannot coexist in one program, they are mutually exclusive.
If lscs_mp requires SPROC then your code should use SPROC only.

I understand that the code you're using is using pthreads, this means that you need to use something else to solve large sparse matrices.
Because i have worked in numerical engineering for quite some time, may i suggest to you libraries like UMFPACK or SPQR?
These are well suited for solving large sparse matrices with respectively full rank or rank deficient systems.
See http://faculty.cse.tamu.edu/davis/suitesparse.html for code. You may need an older version for SPQR to compile it under IRIX systems

They require fast BLAS and LAPACK libraries, these are provided in IRIX, or you could roll-your-own using ATLAS, see http://math-atlas.sourceforge.net/

Thank you so much for your response and suggestions. I realize that SPROC and pthreads cannot coexist in one program. I can certainly look into using other libraries like UMFPACK or SPQR as you have suggested. However the main reason why I was back on Irix at all was for the lure of SGI's SCSL libraries and lscs routine. It seems back in the days SGI hand-coded some of these routine 'down to the metal' to optimize the speed of these sparse solvers.

As I mentioned before, I can still use lscs which is pleasantly fast enough for my applications. It would have been nicer to run the multi-processor version of it (lcscs_mp) if possible in the code I am using.

Since I don't know much about mult-thread programming, is there any way to replace or bypass the pthreads and use/allow sproc just during the call to lscs_mp?
(This post was last modified: 11-02-2018, 02:33 PM by kmallick.)
kmallick
O2

Posts: 3
Threads: 1
Joined: Oct 2018
Find Reply
11-02-2018, 02:20 PM
#4
RE: multithreading using lscs_mp
(11-02-2018, 02:20 PM)kmallick Wrote:  Since I don't know much about mult-thread programming, is there any way to replace or bypass the pthreads and use/allow sproc just during the call to lscs_mp?

I would think you would have to go through the source code of the program you are using and do a re-write.  I don't believe it is something trivial, but I suck at coding so I could be very wrong...
gijoe77
Tezro

Posts: 430
Threads: 24
Joined: Jun 2018
Find Reply
11-02-2018, 08:07 PM
#5
RE: multithreading using lscs_mp
(11-02-2018, 02:20 PM)kmallick Wrote:  Since I don't know much about mult-thread programming, is there any way to replace or bypass the pthreads and use/allow sproc just during the call to lscs_mp?

Only if the program has its pthread support selectable by setting macro's, such as:
Code:
#if HAVE_PTHREAD
  (do threading stuff)
#else
  (do non-threading stuff)
#endif

If you would be able to instruct the compiler or make command to disable pthread support, you should be able to link against lscs_mp
dexter1
Global Moderator
******

Posts: 155
Threads: 9
Joined: May 2018
Find Reply
11-02-2018, 09:42 PM
#6
RE: multithreading using lscs_mp
(11-02-2018, 09:42 PM)dexter1 Wrote:  
(11-02-2018, 02:20 PM)kmallick Wrote:  Since I don't know much about mult-thread programming, is there any way to replace or bypass the pthreads and use/allow sproc just during the call to lscs_mp?

Only if the program has its pthread support selectable by setting macro's, such as:
Code:
#if HAVE_PTHREAD
 (do threading stuff)
#else
 (do non-threading stuff)
#endif

If you would be able to instruct the compiler or make command to disable pthread support, you should be able to link against lscs_mp

Ah ok! I am afraid the code flow doesn't have that option of selectable pthreads.

I see that a C function (lets say funcX) called just before the matrix solve (call to lscs) is using pthread_create and pthread_join. I am not sure what to look for to check if the threads are closed. But I am certain that the function funcX's job is done before the call to lscs is made. I am not sure why the pthread process would hang in there and overlap with the use of sproc being used for lscs. Part of it is my ignorance again in multithread programming.  Dodgy 

Thank you all again for providing the help and suggestions.
(This post was last modified: 11-03-2018, 01:15 AM by kmallick.)
kmallick
O2

Posts: 3
Threads: 1
Joined: Oct 2018
Find Reply
11-03-2018, 01:14 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)