cctools
Data Structures | Enumerations
category.h File Reference

Implements bookkeeping for categories of tasks and their resources. More...

#include "hash_table.h"
#include "itable.h"
#include "histogram.h"
#include "timestamp.h"

Go to the source code of this file.

Data Structures

struct  category
 

Enumerations

enum  category_allocation_t {
  CATEGORY_ALLOCATION_FIRST = 0,
  CATEGORY_ALLOCATION_AUTO = 0,
  CATEGORY_ALLOCATION_MAX,
  CATEGORY_ALLOCATION_ERROR
}
 Valid states for the lifetime of automatic resource allocations for a single task. More...
 
enum  category_mode_t {
  CATEGORY_ALLOCATION_MODE_FIXED = 0,
  CATEGORY_ALLOCATION_MODE_MAX,
  CATEGORY_ALLOCATION_MODE_MIN_WASTE,
  CATEGORY_ALLOCATION_MODE_MAX_THROUGHPUT
}
 Valid modes for computing automatic resource allocations. More...
 

Detailed Description

Implements bookkeeping for categories of tasks and their resources.

Enumeration Type Documentation

Valid states for the lifetime of automatic resource allocations for a single task.

Enumerator
CATEGORY_ALLOCATION_FIRST 

No automatic allocation, or using first step value of the two-step policy.

CATEGORY_ALLOCATION_AUTO 

Same as FIRST, FIRST is deprecated.

CATEGORY_ALLOCATION_MAX 

Using max of category.

(2nd step of two-step policy)

CATEGORY_ALLOCATION_ERROR 

No valid resources could be found.

(E.g., after 2nd step fails)

Valid modes for computing automatic resource allocations.

Enumerator
CATEGORY_ALLOCATION_MODE_FIXED 

When monitoring is disabled, all tasks run as WORK_QUEUE_ALLOCATION_MODE_FIXED.

If monitoring is enabled and resource exhaustion occurs for specified resources values, then the task permanently fails.

CATEGORY_ALLOCATION_MODE_MAX 

When monitoring is enabled, tasks are tried with maximum specified values of cores, memory, disk or gpus until enough statistics are collected.

Then, further tasks are first tried using the maximum values observed, and in case of resource exhaustion, they are retried using the maximum specified values. The task permanently fails when there is an exhaustion using the maximum values. If no maximum values are specified, the task will wait until a larger worker connects.

CATEGORY_ALLOCATION_MODE_MIN_WASTE 

As above, but tasks are first tried with an automatically computed allocation to minimize resource waste.

CATEGORY_ALLOCATION_MODE_MAX_THROUGHPUT 

As above, but maximizing throughput.