Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Enable Shared Cache Support #511

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/scr_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,6 @@ int main (int argc, char *argv[])
/* get pointer to name of entry */
const char* entryname = de->d_name;

int rank;
char* value = NULL;
size_t nmatch = 5;
regmatch_t pmatch[5];
Expand All @@ -586,16 +585,16 @@ int main (int argc, char *argv[])
/* get the MPI rank of the file */
value = strndup(entryname + pmatch[1].rm_so, (size_t)(pmatch[1].rm_eo - pmatch[1].rm_so));
if (value != NULL) {
rank = atoi(value);
int rank = atoi(value);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adammoody - clang14 produced some warnings that I fixed. Most were small (like security warnings), but others like this are indicative of a potental bug. I rearranged this slightly so that rank would only be used when it was set. I moved the if block around to what I believe should hopefully be an equivalent of what the inention was previously.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good catch!

scr_free(&value);
}

/* found a filemap, copy its files */
int tmp_rc = copy_files_for_filemap(path_prefix, path_scr, cache_path, entryname, rank, &args, hostname);
if (tmp_rc != 0) {
rc = tmp_rc;
/* found a filemap, copy its files */
int tmp_rc = copy_files_for_filemap(path_prefix, path_scr, cache_path, entryname, rank, &args, hostname);
if (tmp_rc != 0) {
rc = tmp_rc;
}
continue;
}
continue;
}

/* look for file names like: "reddescmap.er.0.redset" */
Expand Down
8 changes: 4 additions & 4 deletions src/scr_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ int scr_log_run(time_t start, int procs, int nodes)
buf[sizeof(buf)-2] = '\n';
buf[sizeof(buf)-1] = '\0';
}
syslog(SCR_LOG_SYSLOG_LEVEL, buf);
syslog(SCR_LOG_SYSLOG_LEVEL, "%s", buf);
}

if (db_enable) {
Expand Down Expand Up @@ -1117,7 +1117,7 @@ int scr_log_halt(const char* reason)
buf[sizeof(buf)-2] = '\n';
buf[sizeof(buf)-1] = '\0';
}
syslog(LOG_INFO, buf);
syslog(LOG_INFO, "%s", buf);
}

if (db_enable) {
Expand Down Expand Up @@ -1212,7 +1212,7 @@ int scr_log_event(
buf[sizeof(buf)-2] = '\n';
buf[sizeof(buf)-1] = '\0';
}
syslog(LOG_INFO, buf);
syslog(LOG_INFO, "%s", buf);
}

if (db_enable) {
Expand Down Expand Up @@ -1335,7 +1335,7 @@ int scr_log_transfer(
buf[sizeof(buf)-2] = '\n';
buf[sizeof(buf)-1] = '\0';
}
syslog(LOG_INFO, buf);
syslog(LOG_INFO, "%s", buf);
}

if (db_enable) {
Expand Down
2 changes: 1 addition & 1 deletion src/scr_reddesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static int scr_reddesc_type_int_from_str(const char* value, int* type)
{
int rc = SCR_SUCCESS;

int copy_type;
int copy_type = SCR_COPY_NULL;
if (strcasecmp(value, "SINGLE") == 0) {
copy_type = SCR_COPY_SINGLE;
} else if (strcasecmp(value, "PARTNER") == 0) {
Expand Down