OPTK  0.1.2
Toolkit for global optimisation algorithms
Functions | Variables
optk.cpp File Reference

The main entrypoint to the application. More...

#include <optk/optk.hpp>

Functions

static error_t parse_opt (int key, char *arg, struct argp_state *state)
 
static bool validate_args (optk::arguments *args, optk::optimisers *opts, optk::benchmarks *bmks)
 
static optk::ctx_tdo_setup (optk::arguments *args, optk::optimisers *opts, optk::benchmarks *bmks)
 
static void do_teardown (optk::ctx_t *ctx)
 
int main (int argc, char **argv)
 

Variables

const char * argp_program_version = "OPTK v0.1.2"
 
const char * argp_program_bug_address = "<maximerobeyns@gmail.com>"
 
static char doc []
 
static char args_doc [] = ""
 
static struct argp_option options []
 
struct argp argp = { options, parse_opt, args_doc, doc }
 

Detailed Description

The main entrypoint to the application.

Copyright (C) 2020 Maxime Robeyns maxim.nosp@m.erob.nosp@m.eyns@.nosp@m.gmai.nosp@m.l.com

Written for the ACRC, University of Bristol

Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.osedu.org/licenses/ECL-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the LIcense For The Specific Language Governing permissions and limitations under the License.

Function Documentation

◆ do_setup()

static optk::ctx_t* do_setup ( optk::arguments args,
optk::optimisers opts,
optk::benchmarks bmks 
)
static

In this setup function we 'register' all the optimisation algorithms, as well as the bechmarks.

Parameters
argsThe parsed command line arguments (with defaults set)
optsThe set of all registered optimisers OPTK knows about
bmksThe set of all registered benchmarks OPTK knows about

◆ do_teardown()

static void do_teardown ( optk::ctx_t ctx)
static

In this teardown function we free all memory allocated by the setup and during the program.

◆ main()

int main ( int  argc,
char **  argv 
)

The main function.

Parameters
argcThe number of arguments
argvThe argument vector

Variable Documentation

◆ doc

char doc[]
static
Initial value:
=
"OPTK is a benchmarking toolkit for optimisation algorithms."

◆ options

struct argp_option options[]
static
Initial value:
= {
{ "output", 'o', "OUTDIR", 0,
"Store the benchmark results in this directory", 0 },
{ "benchmark", 'b', "BENCHMARKS", 0,
"Only run the specified <benchmark>", 0 },
{ "threads", 't', "THREADS", 0,
"The number of threads to use", 0 },
{ "iterations", 'i', "ITERATIONS", 0,
"The maximum number of iterations for each benchmark.", 0 },
{ 0 }
}