00001 /* 00002 * -- SuperLU MT routine (version 2.2) -- 00003 * Lawrence Berkeley National Lab, Univ. of California Berkeley, 00004 * and Xerox Palo Alto Research Center. 00005 * September 10, 2007 00006 * 00007 * Last modified: 00008 * -- 8/29/2013: added lock to access Stack memory supplied by user 00009 */ 00010 00011 #ifndef __SUPERLU_SYNCH /* allow multiple inclusions */ 00012 #define __SUPERLU_SYNCH 00013 00014 /* Structure for the globally shared work queue */ 00015 00016 typedef int_t qitem_t; 00017 00018 typedef struct { 00019 int_t head, tail, count; 00020 qitem_t *queue; 00021 } queue_t; 00022 00023 typedef enum { 00024 ULOCK, /* locked once per column */ 00025 LLOCK, /* locked once per supernode */ 00026 LULOCK, /* locked once per column in L-supernode */ 00027 NSUPER_LOCK, /* locked once per supernode */ 00028 SCHED_LOCK, /* locked once per panel, if succeeded each time */ 00029 STACK_LOCK, /* locked when upating Stack memory supplied by User */ 00030 NO_GLU_LOCKS 00031 } lu_locks_t; 00032 00033 typedef enum { 00034 RELAXED_SNODE, 00035 TREE_DOMAIN, /* domain */ 00036 REGULAR_PANEL /* non-domain */ 00037 } panel_t; 00038 00039 typedef enum { 00040 DONE, 00041 BUSY, 00042 CANGO, 00043 CANPIPE, 00044 UNREADY 00045 } pipe_state_t; 00046 00047 typedef struct { 00048 panel_t type; /* panel type: 0 -- relaxed, also domain 00049 1 -- domain 00050 2 -- regular, non-domain */ 00051 pipe_state_t state; /* one of the 5 states in which the panel can be */ 00052 int_t size; /* in the leading column, the panel size is stored; 00053 in the other columns, the offset (negative) 00054 to the leading column is stored */ 00055 int_t ukids; /* number of kids not yet finished 00056 * In linear pipeline -- 00057 * if ukids[firstcol] = 0 then 00058 * the panel becomes a leaf (CANGO) 00059 * if ukids[firstcol] = 1 then 00060 * the panel can be taken as CANPIPE 00061 */ 00062 } pan_status_t; 00063 00064 00065 /* The structure to record a relaxed supernode. */ 00066 typedef struct { 00067 int_t fcol; /* first column of the relaxed supernode */ 00068 int_t size; /* size of the relaxed supernode */ 00069 } pxgstrf_relax_t; 00070 00071 00072 00073 /* ********************* 00074 Function prototypes 00075 *********************/ 00076 00077 #ifdef __cplusplus 00078 extern "C" { 00079 #endif 00080 00081 extern int_t await(volatile int_t *); 00082 00083 #ifdef __cplusplus 00084 } 00085 #endif 00086 00087 #endif /* __SUPERLU_SYNCH */ 00088