Skip to content

Commit

Permalink
EXODUS: Possible change for changeset support. Need to decide if this…
Browse files Browse the repository at this point in the history
… is right
  • Loading branch information
gdsjaar committed Nov 15, 2024
1 parent 8979ab2 commit 7b967fc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/seacas/libraries/exodus/src/ex_conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ int exi_check_valid_file_id(int exoid, const char *func)
}
#if !defined BUILT_IN_SIERRA
else {
struct exi_file_item *file = exi_find_file_item(exoid);
int rootid = exoid & EX_FILE_ID_MASK;
struct exi_file_item *file = exi_find_file_item(rootid);

if (!file) {
error = true;
Expand All @@ -93,13 +94,14 @@ int exi_check_valid_file_id(int exoid, const char *func)
if (old_opt & EX_ABORT) {
ex_opts(EX_VERBOSE | EX_ABORT);
}
int rootid = exoid & EX_FILE_ID_MASK;
char errmsg[MAX_ERR_LENGTH];
snprintf(errmsg, MAX_ERR_LENGTH,
"ERROR: In \"%s\", the file id %d was not obtained via a call "
"to \"ex_open\" or \"ex_create\".\n\t\tIt does not refer to a "
"valid open exodus file.\n\t\tAborting to avoid file "
"corruption or data loss or other potential problems.",
func, exoid);
func, rootid);
ex_err(__func__, errmsg, EX_BADFILEID);
ex_opts(old_opt);
return EX_FATAL;
Expand Down Expand Up @@ -231,7 +233,7 @@ int exi_conv_init(int exoid, int *comp_wordsize, int *io_wordsize, int file_word
EX_FUNC_LEAVE(EX_FATAL);
}

new_file->file_id = exoid;
new_file->file_id = (unsigned)exoid & EX_FILE_ID_MASK;
new_file->user_compute_wordsize = *comp_wordsize == 4 ? 0 : 1;
new_file->int64_status = int64_status;
new_file->maximum_name_length = exi_default_max_name_length;
Expand Down Expand Up @@ -285,9 +287,11 @@ void exi_conv_exit(int exoid)
struct exi_file_item *file = file_list;
struct exi_file_item *prev = NULL;

int root_id = (unsigned)exoid & EX_FILE_ID_MASK;

EX_FUNC_ENTER();
while (file) {
if (file->file_id == exoid) {
if (file->file_id == root_id) {
break;
}

Expand Down

0 comments on commit 7b967fc

Please sign in to comment.