Inconsistent parameter behavior with different compilers
Created by: pbosler
When initializing a Zoltan2::PartitioningProblem
for the multi jagged algorithm using
Teuchos::ParameterList params("zoltan2 params");
params.set("algorithm", "multijagged");
the parameter "mj_keep_part_boxes" can be set two ways, either as a string or as an integer --listed as (1) and (2) below. The integer method works for some compilers while the string method fails, and the situation is reversed for other compilers. Details follow.
params.set("mj_keep_part_boxes", "true");
params.set("mj_keep_part_boxes", 1);
The string (1) builds with GCC5.4 on Mac OS X, but fails at runtime with the error
terminate called after throwing an instance of 'std::logic_error'
what(): Error: part boxes are not stored.
But the integer version (2) works fine.
The situation is reversed on Skybridge with Intel 16.0; the string version (1) builds and runs fine but the integer version (2) fails to build with the error
/usr/lib64/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x12d)[0x7fffefacfa7d] what(): Error, the parameter {paramName="mj_keep_part_boxes",type="int"} in the sublist "zoltan2 params" has the wrong type.
The accepted types are: "bool""string"!
Throw number = 1
Could we either define one of the options (1) and (2) above as the "correct" one and make sure it works for all compilers or intelligently convert the type of the parameter as might be reasonably expected (i.e., (int)1=(std::string)"true"=(bool)true
)?
Possibly related to #612 (closed)?