Skip to content

Commit

Permalink
RASO && RASO_parallel avx64_256_512
Browse files Browse the repository at this point in the history
  • Loading branch information
shiwanghua committed Aug 3, 2023
1 parent dec00f0 commit 31c20d1
Show file tree
Hide file tree
Showing 10 changed files with 367 additions and 483 deletions.
317 changes: 100 additions & 217 deletions HEM3_ASO.cpp

Large diffs are not rendered by default.

180 changes: 90 additions & 90 deletions HEM5.cpp

Large diffs are not rendered by default.

168 changes: 84 additions & 84 deletions HEM5_AS.cpp

Large diffs are not rendered by default.

152 changes: 76 additions & 76 deletions HEM5_avxOR.cpp

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions HEM5_avxOR.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define mmfor(i,a,b) for(int i=(a);i>=(b);--i)

// 动动模式 用avx2 做256位的或运算
// 用于和 HEM5 对比
class HEM5_avxOR
{
private:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@
| 13 | 综合性能实验 | $\phi_s$= 1 ~ 10, $\phi_e$ = 1 ~ 40, w=0~1, d=100, alpha=1, attrSubsetNum=25 | 1081 |
| 14 | 构建时间、删除时间实验(即实验 6) | $\phi_s$=5~30, d=$\phi_e$=30, w=0.8 | 1082-1087 |
| 15 | 内存实验(即实验 5) | n = 300**k** ~ 9**m** | 1029-1034 |
| 16 | SIMD实验 on HEMDD (匹配时间和或运算时间下降比例-2个图) | $\psi_e$=d=[16, 32, 64, 128, 256, 512], blockSize=256,512 | 1355-1360, 1361-1366,1393-1401, 1409-1417 |
| 16 | SIMD实验 on HEMDD (匹配时间和或运算时间下降比例-2个图) | $\psi_e$=d=[16, 32, 64, 128, 256, 512], BlockSize=256,512 | 1355-1360, 1361-1366,1393-1401, 1409-1417 |
| 17 | pHEMDD 并行实验(加速比和效率-两图) | $\psi_e=d=$ 512, pD = [1, 2, 4, 8, 16, 32, 64] | 1402-1408 |
| 18 | pHEMDD-avxOR 组合实验(和HEMDD、pHEMDD 比较) | $\psi_e=d=$ 512, pD = [1, 2, 4, 8, 16, 32, 64], blockSize=512 | 1402-1408 |
| 18 | pHEMDD-avxOR 组合实验(和HEMDD、pHEMDD 比较) | $\psi_e=d=$ 512, pD = [1, 2, 4, 8, 16, 32, 64], BlockSize=512 | 1402-1408 |
| 19 | pHEMDD-RAS-avxOR 高负载高维度实验(和HEMDD-RAS比较) | n = $2^{27}$, d=2048, attrSubset=32, $\psi_e$=64, pD = [1, 2, 4, 8, 16, 32, 64], $b_e$ = 1 | 1386-1392 |
|20| 事件值实验| 0-0.1M, 0.1M-0.2M,...,0.9M-1M | 随机宽度: 1658-1667,固定w0.4: 1668-1677 |

Expand Down
4 changes: 2 additions & 2 deletions Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Util {


// 256
#if blockSize == 256
#if BlockSize == 256
void Util::bitsetOr(bitset<subs> &b1, const bitset<subs> &b2) { // b1=b1|b2;
__m256i b1_256, b2_256;
long long int *begin1 = reinterpret_cast<long long int *> (&b1);
Expand All @@ -149,7 +149,7 @@ class Util {
begin2 += ptrIncrement;
}
}
#elif blockSize==512
#elif BlockSize==512
// 512
void Util::bitsetOr(bitset<subs> &b1, const bitset<subs> &b2) { // b1=b1|b2;
__m512i b1_512, b2_512;
Expand Down
6 changes: 3 additions & 3 deletions constant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ int be = 4; // bit exponent. In each dimension, there are 2 * 2^
int be2 = 50; // When be=-1, be2 is adopted. In each dimension, there are 2 * be2 bitsets.
const int lvls = 2; // HEMSC number of levels
int gs = 5; // HEMSR Group Size 一组有多少个维度
// const int blockSize = 512; // 每次对256位做逻辑运算
// const int BlockSize = 512; // 每次对256位做逻辑运算
const int ptrSize = 64; // 每次只能加载__int64 64位
const int blockNum = (subs + blockSize - 1) / blockSize; // 把做 subs 位的逻辑运算 简化为做 blockNum 次逻辑运算
const int ptrIncrement = blockSize / ptrSize; // 需要加载的次数
const int blockNum = (subs + BlockSize - 1) / BlockSize; // 把做 subs 位的逻辑运算 简化为做 blockNum 次逻辑运算
const int ptrIncrement = BlockSize / ptrSize; // 需要加载的次数
const __m256i mask = _mm256_set1_epi32(0x80000000);

// Tama
Expand Down
6 changes: 3 additions & 3 deletions constant.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extern const bool verifyID; // whether to verify Insertion and Deletion function
extern const int interval; // ÿƥ����ô����¼����һ����־��Ϣ
extern const double subp; // subp�����Ķ��ĺ��¼���ν�ʶ�����ǰcons��ά����
extern double realMatchNum;
const int subs = 1000000; // 1048576;//134217728; // Number of subscriptions.
const int subs = 1048576; // 1048576;//134217728; // Number of subscriptions.
extern const int32_t pubs; // Number of publications.
extern int32_t atts; // Total number of attributes, i.e. dimensions.
extern int attrGroup; // The number of attribute group in #atts attributes.
Expand Down Expand Up @@ -90,8 +90,8 @@ extern int be; // ÿ��ά���� 2 * 2^bits��bits����
extern int be2; // be=-1ʱÿ��ά���� 2 * be2 ��bits����
extern const int lvls; // HEMSC ����
extern int gs; // HEMSR һ���ж��ٸ�ά��
// extern const int blockSize;
#define blockSize 256
// extern const int BlockSize;
#define BlockSize 256
extern const int ptrSize;
extern const int blockNum; // ���������
extern const int ptrIncrement;
Expand Down
12 changes: 6 additions & 6 deletions run_models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void run_rein(const intervalGenerator& gen, unordered_map<int, bool> deleteNo)
+ " ms AvgMarkTime= " + to_string(rein.markTime / pubs / 1000000)
+ " ms AvgBitTime= " + to_string(rein.bitTime / pubs / 1000000)
+ " ms pD= " + to_string(parallelDegree)
+ " avx= " + to_string(blockSize)
+ " avx= " + to_string(BlockSize)
+ " numBuk= " + Util::Int2String(rein.numBucket)
+ " numSub= " + Util::Int2String(subs)
+ " subSize= " + Util::Int2String(cons)
Expand Down Expand Up @@ -2763,7 +2763,7 @@ void run_HEM5(const intervalGenerator& gen, unordered_map<int, bool> deleteNo)
+ " ms AvgMarkTime= " + to_string(hem5.markTime / pubs / 1000000)
+ " ms OrTime= " + to_string(hem5.orTime / pubs / 1000000)
+ " ms AvgBitTime= " + to_string(hem5.bitTime / pubs / 1000000)
+ " ms avx= " + to_string(blockSize)
+ " ms avx= " + to_string(BlockSize)
+ " numBuk= " + Util::Int2String(hem5.numBucket)
+ " numSub= " + Util::Int2String(subs)
+ " subSize= " + Util::Int2String(cons)
Expand Down Expand Up @@ -2886,7 +2886,7 @@ void run_HEM5_avxOR(const intervalGenerator& gen, unordered_map<int, bool> delet
+ " ms AvgMarkTime= " + to_string(hem5_avxor.markTime / pubs / 1000000)
+ " ms OrTime= " + to_string(hem5_avxor.orTime / pubs / 1000000)
+ " ms AvgBitTime= " + to_string(hem5_avxor.bitTime / pubs / 1000000)
+ " ms avx= " + to_string(blockSize)
+ " ms avx= " + to_string(BlockSize)
+ " numBuk= " + Util::Int2String(hem5_avxor.numBucket)
+ " numSub= " + Util::Int2String(subs)
+ " subSize= " + Util::Int2String(cons)
Expand Down Expand Up @@ -3116,7 +3116,7 @@ void run_HEM5_avxOR_parallel(const intervalGenerator& gen, unordered_map<int, bo
+ " ms MergeTime= " + to_string(hem5_avxOR_p.mergeTime / pubs / 1000000)
+ " ms AvgBitTime= " + to_string(hem5_avxOR_p.bitTime / pubs / 1000000)
+ " ms pD= " + to_string(parallelDegree)
+ " avx= " + to_string(blockSize)
+ " avx= " + to_string(BlockSize)
+ " numBuk= " + Util::Int2String(hem5_avxOR_p.numBucket)
+ " numSub= " + Util::Int2String(subs)
+ " subSize= " + Util::Int2String(cons)
Expand Down Expand Up @@ -3423,7 +3423,7 @@ void run_HEM5_RAS_avxOR_parallel(const intervalGenerator& gen, unordered_map<int
matchTimeList.push_back((double)eventTime / 1000000);
matchSubList.push_back(matchSubs);
if (i % interval == 0)
cout << "HEM5DD_RAS_avxOR_Parallel" + to_string(blockSize) + "-Parallel: Event " << i << " is matched.\n";
cout << "HEM5DD_RAS_avxOR_Parallel" + to_string(BlockSize) + "-Parallel: Event " << i << " is matched.\n";
}

if (display)
Expand Down Expand Up @@ -3452,7 +3452,7 @@ void run_HEM5_RAS_avxOR_parallel(const intervalGenerator& gen, unordered_map<int
+ " ms MergeTime= " + to_string(hem5_ras_a_p.mergeTime / pubs / 1000000)
+ " ms AvgBitTime= " + to_string(hem5_ras_a_p.bitTime / pubs / 1000000)
+ " ms pD= " + to_string(parallelDegree)
+ " avx= " + to_string(blockSize)
+ " avx= " + to_string(BlockSize)
+ " numBuk= " + Util::Int2String(hem5_ras_a_p.numBucket)
+ " numSub= " + Util::Int2String(subs)
+ " subSize= " + Util::Int2String(cons)
Expand Down

0 comments on commit 31c20d1

Please sign in to comment.