@@ -95,30 +95,22 @@ typedef enum {
95
95
96
96
/** Here we repeat the category_mode_t declaration but with work_queue names.
97
97
* This is needed to generate uniform names in the API and bindings. */
98
- enum {
98
+ typedef enum {
99
+ /**< When monitoring is disabled, all tasks run as
100
+ WORK_QUEUE_ALLOCATION_MODE_FIXED. If monitoring is enabled and resource
101
+ exhaustion occurs: */
99
102
WORK_QUEUE_ALLOCATION_MODE_FIXED = CATEGORY_ALLOCATION_MODE_FIXED ,
103
+ /**< If maximum values are specified for cores, memory,
104
+ disk or gpus (either a user-label or category-label) and one of those resources
105
+ is exceeded, the task fails. Otherwise it is retried until a large enough
106
+ worker connects to the manager, using the maximum values specified, and the
107
+ maximum values so far seen for resources not specified. */
100
108
WORK_QUEUE_ALLOCATION_MODE_MAX = CATEGORY_ALLOCATION_MODE_MAX ,
109
+ /**< As above, but tasks are tried with an automatically computed first-allocation to minimize resource waste. */
101
110
WORK_QUEUE_ALLOCATION_MODE_MIN_WASTE = CATEGORY_ALLOCATION_MODE_MIN_WASTE ,
111
+ /**< As above, but maximizing throughput. */
102
112
WORK_QUEUE_ALLOCATION_MODE_MAX_THROUGHPUT = CATEGORY_ALLOCATION_MODE_MAX_THROUGHPUT
103
- };
104
-
105
- // typedef enum {
106
- // /**< When monitoring is disabled, all tasks run as
107
- // WORK_QUEUE_ALLOCATION_MODE_FIXED. If monitoring is enabled and resource
108
- // exhaustion occurs: */
109
- // WORK_QUEUE_ALLOCATION_MODE_FIXED = 0, /**< Task fails. (default) */
110
- // WORK_QUEUE_ALLOCATION_MODE_MAX, /**< If maximum values are specified for cores, memory,
111
- // disk or gpus (either a user-label or category-label) and
112
- // one of those resources is exceeded, the task fails.
113
- // Otherwise it is retried until a large enough worker
114
- // connects to the manager, using the maximum values
115
- // specified, and the maximum values so far seen for
116
- // resources not specified. */
117
- //
118
- // WORK_QUEUE_ALLOCATION_MODE_MIN_WASTE, /**< As above, but tasks are tried with an automatically
119
- // computed first-allocation to minimize resource waste. */
120
- // WORK_QUEUE_ALLOCATION_MODE_MAX_THROUGHPUT /**< As above, but maximizing throughput. */
121
- // } wq_category_mode_t;
113
+ } work_queue_category_mode_t ;
122
114
123
115
124
116
extern int wq_option_scheduler ; /**< Initial setting for algorithm to assign tasks to
@@ -864,10 +856,10 @@ int work_queue_specify_draining_by_hostname(struct work_queue *q, const char *ho
864
856
/** Turn on or off first-allocation labeling for a given category. By default, cores, memory, and disk are labeled, and gpus are unlabeled. Turn on/off other specific resources use @ref work_queue_enable_category_resource
865
857
@param q A work queue object.
866
858
@param category A category name.
867
- @param mode One of @ref category_mode_t .
859
+ @param mode One of @ref work_queue_category_mode_t .
868
860
@returns 1 if mode is valid, 0 otherwise.
869
861
*/
870
- int work_queue_specify_category_mode (struct work_queue * q , const char * category , category_mode_t mode );
862
+ int work_queue_specify_category_mode (struct work_queue * q , const char * category , work_queue_category_mode_t mode );
871
863
872
864
/** Turn on or off first-allocation labeling for a given category and resource. This function should be use to fine-tune the defaults from @ref work_queue_specify_category_mode.
873
865
@param q A work queue object.
0 commit comments