-
Notifications
You must be signed in to change notification settings - Fork 8
/
IndexHandler.h
103 lines (83 loc) · 2.79 KB
/
IndexHandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
*
* IndexHandler.h
* Soap3(gpu)
*
* Copyright (C) 2011, HKU
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef __INDEX_HANDLER_H__
#define __INDEX_HANDLER_H__
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include "2bwt-lib/BWT.h"
#include "2bwt-lib/HSP.h"
#include "2bwt-flex/LT.h"
#include "2bwt-lib/Timing.h"
#include "2bwt-lib/dictionary.h"
#include "2bwt-lib/iniparser.h"
#include "HSPAux.h"
#include "definitions.h"
#include "IniParam.h"
#define INDEX_MMPOOL_SIZE 2097152 // 2M - fixed; not configurable through ini
#define GPU_OCC_PAYLOAD_OFFSET ( 1 + ALPHABET_SIZE )
typedef struct Soap3Index
{
//CPU Index
MMPool * mmPool;
unsigned char * charMap;
//GPU Index
uint gpu_numOfOccValue;
uint * gpu_occValue;
uint * gpu_revOccValue;
SRAIndex * sraIndex;
} Soap3Index;
typedef struct IndexFileNames
{
char * iniFileName;
char * bwtCodeFileName;
char * occValueFileName;
char * gpuOccValueFileName;
char * lookupTableFileName;
char * revBwtCodeFileName;
char * revOccValueFileName;
char * revGpuOccValueFileName;
char * revLookupTableFileName;
char * saCodeFileName;
char * memControlFileName;
//For HSP
char * packedDnaFileName;
char * annotationFileName;
char * ambiguityFileName;
char * translateFileName;
// For mmap use
char * mmapOccValueFileName;
char * mmapRevOccValueFileName;
char * mmapPackedDnaFileName;
} IndexFileNames;
void INDEXFillCharMap ( unsigned char charMap[255] );
// process index file name
void INDEXProcessFilenames ( IndexFileNames * index, char * indexName, IniParams * ini_params );
void INDEXLoad ( MMPool * mmPool, IndexFileNames indexFilenames, BWT ** bwt, BWT ** revBwt, HSP ** hsp, LT ** lkt, LT ** revLkt,
uint ** revOccValue, uint ** occValue, uint & numOfOccValue,
char isShareIndex );
// To load the index
Soap3Index * INDEXLoad ( IniParams * ini_params, char * indexName, char isShareIndex );
// To free the index
void INDEXFree ( Soap3Index * index, char isShareIndex );
#endif