Skip to content

Commit

Permalink
Use explicit dummy value instead of (void**)1 in features table.
Browse files Browse the repository at this point in the history
  • Loading branch information
dthain committed Aug 4, 2023
1 parent 4cc07ae commit a120b3b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions taskvine/src/worker/vine_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,13 @@ static struct itable *procs_complete = NULL;
// Table of current transfers and their id
static struct hash_table *current_transfers = NULL;

//User specified features this worker provides.
/*
Table of user-specified features.
The key represents the name of the feature.
The corresponding value is just a pointer to feature_dummy and can be ignored.
*/
static struct hash_table *features = NULL;
static const char *feature_dummy = "dummy";

static int results_to_be_sent_msg = 0;

Expand Down Expand Up @@ -532,7 +537,7 @@ static int start_process( struct vine_process *p, struct link *manager )
HASH_TABLE_ITERATE(library_task_ids,library_name,library_task_id) {
if (*library_task_id == p->task->task_id){
list_push_tail(coprocess_list, p->coprocess);
hash_table_insert(features, library_name, (void **) 1);
hash_table_insert(features, library_name, feature_dummy);
send_features(manager);
send_message(manager, "info library-update %d %d\n", p->task->task_id, VINE_LIBRARY_STARTED);
send_resource_update(manager);
Expand Down Expand Up @@ -2132,7 +2137,7 @@ int main(int argc, char *argv[])
show_help(argv[0]);
return 0;
case LONG_OPT_FEATURE:
hash_table_insert(features, optarg, (void **) 1);
hash_table_insert(features, optarg, feature_dummy);
break;
case LONG_OPT_PARENT_DEATH:
initial_ppid = getppid();
Expand Down Expand Up @@ -2179,7 +2184,7 @@ int main(int argc, char *argv[])

char *gpu_name = gpu_name_get();
if(gpu_name) {
hash_table_insert(features, gpu_name, (void **) 1);
hash_table_insert(features, gpu_name, feature_dummy);
free(gpu_name);
}

Expand Down

0 comments on commit a120b3b

Please sign in to comment.