-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate data for bnenchmarks and tests. Also move to /data
- Loading branch information
Showing
5 changed files
with
58 additions
and
36 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <stdint.h> | ||
|
||
int main (int argc,char *argv[]) { | ||
if (argc != 4) { | ||
printf("usage: gen FILE N_ITEMS VALUE"); | ||
exit(1); | ||
} | ||
|
||
char *path = argv[1]; | ||
size_t n = atoi(argv[2]); | ||
uint32_t v = atoi(argv[3]); | ||
|
||
FILE *fp = fopen(path, "w"); | ||
for (size_t i = 0; i < n; i++) { | ||
fwrite(&v, sizeof(uint32_t), 1, fp); | ||
} | ||
fclose(fp); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
[ ! -e "gen" ] && (gcc -o gen gen.c) | ||
|
||
if [ $# -ne 3 ] | ||
then | ||
echo "usage: gen.sh FILE N_ITEMS VALUE" | ||
exit 1 | ||
fi | ||
|
||
case "$3" in | ||
random) head -c $((4 * $2)) /dev/urandom > "$1";; | ||
*) ./gen "$1" "$2" "$3";; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
function generate_both { | ||
echo "generating ${1}_rand_int.bin" | ||
./gen "${1}_rand_int.bin" $2 random | ||
|
||
echo "generating ${1}_ones_int.bin" | ||
./gen "${1}_ones_int.bin" $2 1 | ||
} | ||
|
||
function generate_ones { | ||
echo "generating ${1}_ones_int.bin" | ||
./gen "${1}_ones_int.bin" $2 1 | ||
} | ||
|
||
# T G M K 1 | ||
generate_both 1K 1000 # 3.9 KB | ||
generate_both 100K 100000 # 392 KB | ||
generate_both 1M 1000000 # 3.8 MB | ||
generate_both 10M 10000000 # 38 MB | ||
generate_both 100M 100000000 # 381 MB | ||
generate_ones 1G 1000000000 # 3.7 GB | ||
# T G M K 1 | ||
|
||
|