- if (num_threads_ > MAX_NUM_THREADS) {
- fprintf(stderr, "%s: Number of threads cannot be more than %d\n", program_name, MAX_NUM_THREADS);
+ }
+ if (num_threads_ > MAX_NUM_THREADS) {
+ fprintf(stderr, "%s: Number of threads cannot be more than %d\n", program_name, MAX_NUM_THREADS);
+ return -1;
+ }
+
+ int table_scale = 12;
+ if (argc > 2) {
+ table_scale = strtol(argv[2], NULL, 10);
+ if (errno) {
+ fprintf(stderr, "%s: Invalid argument for the scale of the collection\n", program_name);
+ return -1;
+ }
+ table_scale = strtol(argv[2], NULL, 10);
+ if (table_scale < 0 || table_scale > 36) {
+ fprintf(stderr, "%s: The scale of the collection must be between 0 and 36\n", program_name);