Skip to content

Commit 7bfcf7a

Browse files
committed
Adding TODOs QPEMPI.c
1 parent 58c9b81 commit 7bfcf7a

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

QPEMPI

-10.6 KB
Binary file not shown.

QPEMPI.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#define TABLE_NAME "commands"
1818
#define MAX_TOKENS 100
1919
#define ROW_LIMIT 20
20+
#define MAX_QUERIES 1000
2021

2122
// Optimal indexes constant
2223
static const char* optimalIndexes[] = {
@@ -136,6 +137,10 @@ static void free_where_clause_list(struct whereClauseS *head) {
136137
}
137138
}
138139

140+
// MAJOR TO-DOs: Initialize engine on Rank 0 only and broadcast to others. Currently each rank initializes its own engine which is inefficient for large datasets.
141+
// Process all queries in one rank (must be serial), then scatter results to other ranks for printing. Currently each rank processes its own queries which may lead to unbalanced workloads.
142+
// GATHER results from all ranks to Rank 0 for unified output. Currently each rank prints its own results which may be disorganized.
143+
139144
int main(int argc, char *argv[]) {
140145

141146
// Initialize MPI Environment
@@ -199,7 +204,6 @@ int main(int argc, char *argv[]) {
199204
double loadTimeTaken = MPI_Wtime() - totalStart;
200205

201206
// Split queries into an array
202-
#define MAX_QUERIES 1000
203207
char *queries[MAX_QUERIES];
204208
int query_count = 0;
205209

@@ -211,6 +215,10 @@ int main(int argc, char *argv[]) {
211215

212216
// Execute Queries
213217
for (int i = 0; i < query_count; i++) {
218+
// Divide queries among ranks
219+
if (i % size != rank) continue;
220+
221+
// Get the current query and trim whitespace
214222
char *query = trim(queries[i]);
215223
if (!*query) continue;
216224

QPEOMP

-5.12 KB
Binary file not shown.

data-generation/commands_50k.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:e310aa49374bd4b5286a8dc459e65f491651d869a5a8c9624115805a23a2f476
3-
size 5919333
2+
oid sha256:b303b920c6c6cd992eacb27f5c63110cc0fe4ede54609e453446f34ab1c62047
3+
size 5922674

0 commit comments

Comments
 (0)