Skip to content

Commit

Permalink
add new local temp file flag
Browse files Browse the repository at this point in the history
  • Loading branch information
colinthomas-z80 committed Nov 7, 2024
1 parent 5a33ec2 commit 982cd4b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions taskvine/src/manager/taskvine.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ typedef enum {

/** Control sharing and garbage collection behavior of file objects. **/
typedef enum {
VINE_PEER_NOSHARE = 1, /**< Schedule this file to be shared between peers where available. See @ref
VINE_PEER_NOSHARE = 1, /**< Schedule this file to be shared between peers where available. See @ref
vine_enable_peer_transfers **/
VINE_UNLINK_WHEN_DONE = 2 /**< Whether to delete the file when its reference count is 0. (Warning: Only use on
VINE_UNLINK_WHEN_DONE = 2, /**< Whether to delete the file when its reference count is 0. (Warning: Only use on
files produced by the application, and never on irreplaceable input files.) */
VINE_LOCAL_TEMP = 4 /**< A temp substitute created when peer transfers are not enabled **/
} vine_file_flags_t;

/** Select overall scheduling algorithm for matching tasks to workers. */
Expand Down
2 changes: 1 addition & 1 deletion taskvine/src/manager/vine_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ struct vine_file *vine_file_temp_no_peers()
cctools_uuid_create(&uuid);

char *name = string_format("temp-local-%s", uuid.str);
return vine_file_create(name, 0, 0, 0, VINE_FILE, 0, cache, VINE_UNLINK_WHEN_DONE);
return vine_file_create(name, 0, 0, 0, VINE_FILE, 0, cache, VINE_UNLINK_WHEN_DONE | VINE_LOCAL_TEMP);
free(name);
}

Expand Down
2 changes: 1 addition & 1 deletion taskvine/src/manager/vine_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -3253,7 +3253,7 @@ static int vine_manager_check_inputs_available(struct vine_manager *q, struct vi
all_available = 0;
}
} // this is probably a local-temp
else if (f->flags && VINE_UNLINK_WHEN_DONE) {
else if (f->flags & VINE_LOCAL_TEMP) {
struct stat info;
int result = lstat(f->source, &info);
if (result != 0) {
Expand Down

0 comments on commit 982cd4b

Please sign in to comment.