Skip to content

Commit

Permalink
WIP: remove job_queue_status
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Nov 10, 2023
1 parent 385d22f commit 5744000
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 75 deletions.
9 changes: 0 additions & 9 deletions src/clib/lib/include/ert/job_queue/job_queue_status.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,4 @@ struct job_queue_status_struct {
JOB_QUEUE_UNKNOWN}; // Unable to get status from submitted job
};

job_queue_status_type *job_queue_status_alloc();
void job_queue_status_free(job_queue_status_type *status);
int job_queue_status_get_count(job_queue_status_type *status,
int job_status_mask);
void job_queue_status_step(job_queue_status_type *status_count,
job_status_type status_type, int step);
bool job_queue_status_transition(job_queue_status_type *status_count,
job_status_type src_status,
job_status_type target_status);
#endif
5 changes: 1 addition & 4 deletions src/clib/lib/job_queue/job_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ struct job_queue_struct {
job_queue_type *job_queue_alloc(queue_driver_type *driver) {
auto queue = new job_queue_type;
queue->job_list = job_list_alloc();
queue->status = job_queue_status_alloc();
queue->driver = driver;
return queue;
}

void job_queue_free(job_queue_type *queue) {
job_list_free(queue->job_list);
job_queue_status_free(queue->status);
delete queue;
}

Expand All @@ -30,8 +28,7 @@ int job_queue_add_job_node(job_queue_type *queue, job_queue_node_type *node) {

pthread_mutex_lock(&node->data_mutex);

if (job_queue_status_transition(
queue->status, job_queue_node_get_status(node), JOB_QUEUE_WAITING))
if ((job_queue_node_get_status(node) != JOB_QUEUE_WAITING) && (target_status != JOB_QUEUE_STATUS_FAILURE))
job_queue_node_set_status(node, JOB_QUEUE_WAITING);

pthread_mutex_unlock(&node->data_mutex);
Expand Down
62 changes: 0 additions & 62 deletions src/clib/lib/job_queue/job_queue_status.cpp

This file was deleted.

0 comments on commit 5744000

Please sign in to comment.