METIS icon indicating copy to clipboard operation
METIS copied to clipboard

METIS_OPTION_NUMBERING is essentially undocumented

Open thk686 opened this issue 3 years ago • 6 comments

For such an important value (a sure-fire way to segfault if you get it wrong), it is remarkable how difficult it is to figure out the default value of this parameter in the documentation and even when searching the code.

thk686 avatar Dec 23 '22 18:12 thk686

I'm quite lost with the defaults. I thought it works like

        idx_t options[METIS_NOPTIONS];
        METIS_SetDefaultOptions(options);

But all values I check, including options[METIS_OPTION_NUMBERING], are set to -1?!

Fabian188 avatar Jan 14 '23 01:01 Fabian188

Indeed:

int METIS_SetDefaultOptions(idx_t *options) 
{
  iset(METIS_NOPTIONS, -1, options);
  return METIS_OK;
}

thk686 avatar Jan 14 '23 02:01 thk686

Looks like its zero:

ctrl->numflag   = GETOPTION(options, METIS_OPTION_NUMBERING, 0);

thk686 avatar Jan 14 '23 02:01 thk686

So It appears that -1 in the options indicates to use the default rather than being the default. The confusing part is that all the options are copied into the ctrl structure.

thk686 avatar Jan 14 '23 02:01 thk686

That makes indeed sense if the defaults are selected depending on the actual data (now or in the future).

Fabian188 avatar Jan 14 '23 14:01 Fabian188

Thanks for the clarifications via code quotes.

Fabian188 avatar Jan 14 '23 14:01 Fabian188