Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 15 additions & 3 deletions sources/ftypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -971,16 +971,28 @@ typedef int (*TFUN1)(UBYTE *,int);
#define BUCKETTERMINATED 3
#define BUCKETRELEASED 4

#define NUMBEROFBLOCKSINSORT 10
#define MINIMUMNUMBEROFTERMS 10

#define BUCKETDOINGTERM 1
#define BUCKETASSIGNED -1
#define BUCKETTOBERELEASED -2
#define BUCKETPREPARINGTERM 0

#define BUCKETDOINGTERMS 0
#define BUCKETDOINGBRACKET 1

/*
Sortblock config
*/
// The number of blocks in the ring-buffer for data transfer between
// workers or sortbots and the master thread or other sortbots. With
// sortbots, each thread has half of this number.
#define NUMBEROFBLOCKSINSORT 10
// The minimum number of terms which must fit in a block, i.e. they
// must be at least this number times MaxTermSize.
#define MINIMUMNUMBEROFTERMS 2
// The minimum number of terms which will be written in a block,
// before potentially yielding the block to a waiting reading thread.
#define MINWRITENUMBEROFTERMS 10

#endif

/*
Expand Down
4 changes: 2 additions & 2 deletions sources/setfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,13 @@ int RecalcSetups(void)
AM.MaxTer *= sizeof(WORD);
#ifdef WITHSORTBOTS
if ( AM.totalnumberofthreads-1 > 2 ) {
minimumsize = (2*(AM.totalnumberofthreads-1)-2)*(AM.MaxTer+
minimumsize = (2*(AM.totalnumberofthreads-1)-2)*(
NUMBEROFBLOCKSINSORT*MINIMUMNUMBEROFTERMS/2*AM.MaxTer);
}
else
#endif
{
minimumsize = (AM.totalnumberofthreads-1)*(AM.MaxTer+
minimumsize = (AM.totalnumberofthreads-1)*(
NUMBEROFBLOCKSINSORT*MINIMUMNUMBEROFTERMS*AM.MaxTer);
}
if ( totalsize < minimumsize ) {
Expand Down
1 change: 1 addition & 0 deletions sources/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,7 @@ typedef struct SoRtBlOcK {
WORD **MasterStart;
WORD **MasterFill;
WORD **MasterStop;
LONG *BlockTerms;
int MasterNumBlocks;
int MasterBlock;
int FillBlock;
Expand Down
Loading
Loading