Commit 9f57fc8a authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

fixup: Replace book-keeping array with simple count.

parent 5f8b743f
...@@ -44,8 +44,7 @@ typedef struct ...@@ -44,8 +44,7 @@ typedef struct
int currOpIndex; int currOpIndex;
int nextOpIndex; int nextOpIndex;
int prefIndex; int prefIndex;
bool finished; int activeCollectors;
bool *nfinished;
int handle, fileID; int handle, fileID;
char name[]; char name[];
} bFiledataPA; } bFiledataPA;
...@@ -91,11 +90,7 @@ initBFiledataPA(char *filename, size_t bs, int nc) ...@@ -91,11 +90,7 @@ initBFiledataPA(char *filename, size_t bs, int nc)
bfd->nextOpIndex = 0; bfd->nextOpIndex = 0;
bfd->prefIndex = 0; bfd->prefIndex = 0;
bfd->offset = 0; bfd->offset = 0;
bfd->finished = false; bfd->activeCollectors = nc;
bfd->nfinished = xmalloc ( nc * sizeof ( bfd->nfinished[0] ));
for ( i = 0; i < nc; i++ )
bfd->nfinished[i] = false;
xdebug ( "filename=%s, opened file, return", bfd->name ); xdebug ( "filename=%s, opened file, return", bfd->name );
...@@ -153,8 +148,7 @@ destroyBFiledataPA ( void *v ) ...@@ -153,8 +148,7 @@ destroyBFiledataPA ( void *v )
dbuffer_cleanup ( &( bfd->fb )); dbuffer_cleanup ( &( bfd->fb ));
free ( bfd->nfinished ); free(bfd->ctrlBlks);
free ( bfd->ctrlBlks );
free(bfd); free(bfd);
xdebug("%s", "closed file and cleaned up, return"); xdebug("%s", "closed file and cleaned up, return");
...@@ -370,17 +364,7 @@ void pioWriterAIO(void) ...@@ -370,17 +364,7 @@ void pioWriterAIO(void)
writePA ( bfd, amount ); writePA ( bfd, amount );
bfd->nfinished[source] = true; if ( ! --(bfd->activeCollectors))
bfd->finished = true;
for ( i = 0; i < nProcsCollNode; i++ )
if ( !( bfd->nfinished[i] ))
{
bfd->finished = false;
break;
}
if ( bfd->finished )
{ {
xdebug ( "all are finished with file %d, delete node", rtag.id); xdebug ( "all are finished with file %d, delete node", rtag.id);
listSetRemove(bibBFiledataPA, fileIDTest, listSetRemove(bibBFiledataPA, fileIDTest,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment