diff options
-rw-r--r-- | fractal-gen.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fractal-gen.c b/fractal-gen.c index e8ff501..dc30e8d 100644 --- a/fractal-gen.c +++ b/fractal-gen.c @@ -62,10 +62,10 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - if (argc != 4 && argc != 5 && argc != 7) + if (argc < 4 || argc > 6) { fprintf(stderr, "%s size iterat power [threads]\n" - "%s size iterat power threads cluster-id] cluster-total\n", argv[0], argv[0]); + "%s size iterat power cluster-id cluster-total\n", argv[0], argv[0]); return EXIT_FAILURE; } @@ -78,9 +78,9 @@ int main(int argc, char **argv) * - our ID in cluster * - total members in cluster */ - cores = (argc == 5 || argc == 7)? atoi(argv[4]) : sysconf(_SC_NPROCESSORS_ONLN); // Screw maintainability ;) - clust_id = argc == 7? atoi(argv[5]) : 0; - clust_total = argc == 7? atoi(argv[6]) : 1; + cores = (argc == 5)? atoi(argv[4]) : sysconf(_SC_NPROCESSORS_ONLN); // Screw maintainability ;) + clust_id = argc == 6? atoi(argv[4]) : 0; + clust_total = argc == 6? atoi(argv[5]) : 1; // Interlacing is column-based, can't have more workers than columns if (cores > size) |