KarypisLab / METIS

METIS - Serial Graph Partitioning and Fill-reducing Matrix Ordering
Other
644 stars 129 forks source link

METIS_OPTION_NUMBERING is essentially undocumented #58

Open thk686 opened 1 year ago

thk686 commented 1 year ago

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.

Fabian188 commented 1 year ago

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?!

thk686 commented 1 year ago

Indeed:

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

Looks like its zero:

ctrl->numflag   = GETOPTION(options, METIS_OPTION_NUMBERING, 0);
thk686 commented 1 year ago

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.

Fabian188 commented 1 year ago

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

Fabian188 commented 1 year ago

Thanks for the clarifications via code quotes.