networkit.engineering

Tools for algorithm engineering.

networkit.engineering.getCurrentNumberOfThreads()

Get the number of currently running threads.

Returns

Number of threads.

Return type

int

networkit.engineering.getLogLevel()

Get the current log level.

Returns

The current loglevel.

Return type

logLevel

networkit.engineering.getMaxNumberOfThreads()

Get the maximum number of available threads

Returns

Max number of threads.

Return type

int

networkit.engineering.setLogLevel(loglevel)

Set the current loglevel

Parameters

loglevel (str) – The new loglevel. Possible values: TRACE, DEBUG, INFO, WARN, ERROR, FATAL, QUIET

networkit.engineering.setNumberOfThreads(nThreads)

Set the number of OpenMP threads

networkit.engineering.setPrintLocation(flag)

Switch locations in log statements on or off

Parameters

flag (bool) – Sets whether to also log file, function and line of code. Default: False.

networkit.engineering.setSeed(seed, useThreadId)

Set the random seed that is used in NetworKit.

Note that there is a separate random number generator per thread.

Parameters
  • seed (int) – The seed

  • useThreadId (bool) – If the thread id shall be added to the seed

networkit.engineering.strongScaling(algorithmClass, threadSequence, inargs, inputTitle=None, repetitions=1, outPath=None)

Evaluate strong scaling, i.e. how the performance varies with the number of threads for a fixed input size.

Note

Algorithm is executed by calling algorithmClass(**inargs). See parameter for more details.

Parameters
  • algorithmClass – Algorithm, which should be tested.

  • threadSequence (list(int)) – A list of thread numbers to run the algorithmClass with.

  • inargs (**kwargs) – Input arguments for algorithm.

  • inputTitle (str, optional) – Set a title for the output. Default: None

  • repetitions (int, optional) – Number of repetitions. Default: 1

  • outPath (str, optional) – File for writing the output to. Default: None

networkit.engineering.weakScaling(algorithmClass, inargs, threadSequence, inputSequence, inputTitles=None, repetitions=1, outPath=None)

Evaluate weak scaling, i.e. how the performance varies with the number of threads for a fixed input size per processor.

Note

Algorithm is executed by calling algorithmClass(input, **inargs). See parameter for more details.

Parameters
  • algorithmClass – Algorithm, which should be tested.

  • inargs (**kwargs) – Input arguments for algorithm.

  • threadSequence (list(int)) – A list of thread numbers to run the algorithmClass with.

  • inputSequence (list(networkit.Graph)) – A list of graphs. The input algorithm is evaluated against every list-member.

  • inputTitles (str, optional) – Set a title for the output. Default: None

  • repetitions (int, optional) – Number of repetitions. Default: 1

  • outPath (str, optional) – File for writing the output to. Default: None