From f3027f76a854c2a6734a2cfcfe229794cfd12190 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Fri, 6 May 2016 00:30:01 +1200 Subject: Check cluster ID against node count --- fractal-gen.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'fractal-gen.c') diff --git a/fractal-gen.c b/fractal-gen.c index 612e7ce..9b6b2e2 100644 --- a/fractal-gen.c +++ b/fractal-gen.c @@ -221,7 +221,13 @@ int parse_args(int argc, char **argv) return 1; } - /* Interlacing is column-based, can't have more workers than columns */ + if (clust_id >= clust_total) + { + fprintf(stderr, "WARN: Node ID cannot be >= node count\n"); + return 1; + } + + /* Interlacing is row-based, can't have more workers than columns */ if (cores > size) { cores = size; -- cgit v1.1