aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2016-05-06 00:30:01 +1200
committerDavid Phillips <dbphillipsnz@gmail.com>2016-05-06 00:30:01 +1200
commitf3027f76a854c2a6734a2cfcfe229794cfd12190 (patch)
tree5310898ba38bd8953ffe64ff793db548c1781e11
parent7bceb564014a97b780f3ecdefec55f88928e67bc (diff)
downloadfractal-gen-f3027f76a854c2a6734a2cfcfe229794cfd12190.tar.xz
Check cluster ID against node count
-rw-r--r--fractal-gen.c8
1 files changed, 7 insertions, 1 deletions
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;