COMBINATORIAL_BLAS  1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SpDefs.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* Parallel Combinatorial BLAS Library (for Graph Computations) */
3 /* version 1.2 -------------------------------------------------*/
4 /* date: 10/06/2011 --------------------------------------------*/
5 /* authors: Aydin Buluc (abuluc@lbl.gov), Adam Lugowski --------*/
6 /****************************************************************/
7 /*
8  Copyright (c) 2011, Aydin Buluc
9 
10  Permission is hereby granted, free of charge, to any person obtaining a copy
11  of this software and associated documentation files (the "Software"), to deal
12  in the Software without restriction, including without limitation the rights
13  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14  copies of the Software, and to permit persons to whom the Software is
15  furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included in
18  all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26  THE SOFTWARE.
27  */
28 
29 #ifndef _SP_DEFS_H_
30 #define _SP_DEFS_H_
31 
32 #ifndef __STDC_CONSTANT_MACROS
33 #define __STDC_CONSTANT_MACROS
34 #endif
35 #ifndef __STDC_LIMIT_MACROS
36 #define __STDC_LIMIT_MACROS
37 #endif
38 #ifdef _STDINT_H
39  #undef _STDINT_H
40 #endif
41 #ifdef _GCC_STDINT_H // for cray
42  #undef _GCC_STDINT_H // original stdint does #include_next<"/opt/gcc/4.5.2/snos/lib/gcc/x86_64-suse-linux/4.5.2/include/stdint-gcc.h">
43 #endif
44 #include <stdint.h>
45 #include <inttypes.h>
46 
47 #include <cmath>
48 #include <limits.h>
49 #include "SequenceHeaps/knheap.C"
50 #include "psort-1.0/src/psort.h"
53 #include "CommGrid.h"
54 
55 #define PRINT_LIMIT 30
56 #define EPSILON 0.01
57 #define FLOPSPERLOC 0 // always use SPA based merger inside the sequential code
58 #define HEAPMERGE 1 // use heapmerge for accumulating contributions from row neighbors
59 #define MEM_EFFICIENT_STAGES 16
60 #define DETERMINISTIC
61 
62 // MPI::Abort codes
63 #define GRIDMISMATCH 3001
64 #define DIMMISMATCH 3002
65 #define NOTSQUARE 3003
66 #define NOFILE 3004
67 #define MATRIXALIAS 3005
68 #define UNKNOWNMPITYPE 3006
69 
70 // Enable bebug prints
71 //#define SPREFDEBUG
72 //#define IODEBUG
73 //#define SPGEMMDEBUG
74 
75 // MPI Message tags
76 // Prefixes denote functions
77 // TR: Transpose
78 // RD: ReadDistribute
79 // RF: Sparse matrix indexing
80 #define TRTAGNZ 121
81 #define TRTAGM 122
82 #define TRTAGN 123
83 #define TRTAGROWS 124
84 #define TRTAGCOLS 125
85 #define TRTAGVALS 126
86 #define RDTAGINDS 127
87 #define RDTAGVALS 128
88 #define RDTAGNNZ 129
89 #define RFROWIDS 130
90 #define RFCOLIDS 131
91 #define TRROWX 132
92 #define TRCOLX 133
93 #define TRX 134
94 #define TRI 135
95 #define TRNNZ 136
96 #define TROST 137
97 #define TRLUT 138
98 #define SWAPTAG 139
99 
100 extern int cblas_splits;
101 
102 enum Dim
103 {
106 };
107 
108 
109 // force 8-bytes alignment in heap allocated memory
110 #ifndef ALIGN
111 #define ALIGN 8
112 #endif
113 
114 #ifndef THRESHOLD
115 #define THRESHOLD 4 // if range1.size() / range2.size() < threshold, use scanning based indexing
116 #endif
117 
118 #ifndef MEMORYINBYTES
119 #define MEMORYINBYTES (196 * 1048576) // 196 MB, it is advised to define MEMORYINBYTES to be "at most" (1/4)th of available memory per core
120 #endif
121 
122 #endif