Using command-line arguments

If we want to resize our image, we would need to edit the line const n = 2_000; in the code and then recompile it. Wouldn’t it be great if we could pass this number to the binary when it is called at the command line, without having to recompile it?

The Chapel mechanism for this is config variables. When a variable is declared with the config keyword, in addition to var or const, like this:

config const n = 2_000;   // vertical and horizontal size of our image

you can its new value from the command line:

$ chpl juliaSetSerial.chpl   # using the default value 2_000
$ ./juliaSetSerial --n=500   # passing another value from the command line

Make c a config variable, and test passing different values.