Skip to content

Commit

Permalink
fixed a library combination bug [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
cnotred committed May 30, 2023
1 parent a0ca16c commit c5b624f
Showing 1 changed file with 44 additions and 33 deletions.
77 changes: 44 additions & 33 deletions lib/util_lib/util_constraints_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -1831,8 +1831,12 @@ Constraint_list *add_entry2list2 (CLIST_TYPE *entry, Constraint_list *CL)
else
{
i=get_entry_index(entry,CL);

if (i<0)insert_entry (entry,CL,-i);
else update_entry (entry, CL, i);
else
{
update_entry (entry, CL, i);
}
}

return CL;
Expand Down Expand Up @@ -1993,7 +1997,10 @@ Constraint_list *update_entry (CLIST_TYPE *entry, Constraint_list *CL, int i)

CL->residue_index[s1][r1][i+SEQ2]=entry[SEQ2];
CL->residue_index[s1][r1][i+R2] =entry[R2];
//HERE ("UPDATE %d %d", entry[WE],CL->residue_index[s1][r1][i+WE]);
CL->residue_index[s1][r1][i+WE] =MAX(entry[WE],CL->residue_index[s1][r1][i+WE]);
//HERE ("--->%d UPDATED",CL->residue_index[s1][r1][i+WE]);

CL->residue_index[s1][r1][i+CONS]+=entry[CONS];
CL->residue_index[s1][r1][i+MISC]=entry[MISC];
return CL;
Expand Down Expand Up @@ -2278,6 +2285,7 @@ Constraint_list* fork_read_n_constraint_list(char **fname,int n_list, char *in_m
{
int pid;
ns++;
HERE ("ns=%d", ns);
pid=vvfork (NULL);
if ( pid==0)
{
Expand All @@ -2288,48 +2296,51 @@ Constraint_list* fork_read_n_constraint_list(char **fname,int n_list, char *in_m

CL=read_constraint_list (CL, fname[a], in_mode, mem_mode,weight_mode);

if (CL->ne>in)dump_constraint_list(CL,tmp_list[a], "w");
//if (CL->ne>in)dump_constraint_list(CL,tmp_list[a], "w");-- This was causing an issue when the libraries had identical side
dump_constraint_list(CL,tmp_list[a], "w");
myexit (EXIT_SUCCESS);
}
else
{
//set_pid (pid);
fprintf ( local_stderr, "\n\t--- Process Method/Library/Aln %s", fname[a], ns);
proclist[pid]=a;
if (ns>=nproc)
{
b=proclist[vwait(NULL)];
fprintf (local_stderr, "\n\txxx Retrieved %s",fname[a]);

if (tmp_list[b] && check_file_exists (tmp_list[b]))
{
CL=undump_constraint_list(CL,tmp_list[b]);
}
ns--;
}
{
//set_pid (pid);
fprintf ( local_stderr, "\n\t--- Process Method/Library/Aln %s", fname[a], ns);
proclist[pid]=a;
if (ns>=nproc)
{
int pid2=vwait (NULL);
b=proclist[pid2];
fprintf (local_stderr, "\n\txxx Retrieved %s",fname[b]);

if (tmp_list[b] && check_file_exists (tmp_list[b]))
{
CL=undump_constraint_list(CL,tmp_list[b]);
}

ns--;
}
}
}


while (ns)
{
int pid2;
pid2=vwait(NULL);
a=proclist[pid2];
fprintf (local_stderr, "\n\txxx Retrieved %s",fname[a]);
if (tmp_list[a] && check_file_exists (tmp_list[a]))
{
CL=undump_constraint_list (CL,tmp_list[a]);
}
ns--;
}
{
int pid2;
pid2=vwait(NULL);
a=proclist[pid2];
fprintf (local_stderr, "\n\txxx Retrieved %s",fname[a]);
if (tmp_list[a] && check_file_exists (tmp_list[a]))
{
CL=undump_constraint_list (CL,tmp_list[a]);
}
ns--;
}

fprintf ( local_stderr, "\n\n\tAll Methods Retrieved\n");

if (tmp_list[n_list] && check_file_exists (tmp_list[n_list]))
if (tmp_list[n_list] && check_file_exists (tmp_list[n_list-1]))
{
CL=undump_constraint_list(CL,tmp_list[n_list]);
}

CL->local_stderr=local_stderr;

vfree (proclist);
Expand Down Expand Up @@ -2861,9 +2872,8 @@ Constraint_list *read_constraint_list_file(Constraint_list *CL, char *fname)
}

index=fix_seq_seq (NS, CL->S);




entry=(int*)vcalloc ( CL->entry_len+1, sizeof (int));


Expand Down Expand Up @@ -2935,6 +2945,7 @@ Constraint_list *read_constraint_list_file(Constraint_list *CL, char *fname)
{
int ine=CL->ne;
int id=d;

add_entry2list (entry, CL);
d++;
}
Expand Down

0 comments on commit c5b624f

Please sign in to comment.