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
4 changes: 3 additions & 1 deletion sources/declare.h
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,6 @@ extern void WakeupThread(int,int);
extern int MasterWait(void);
extern int InParallelProcessor(void);
extern int ThreadsProcessor(EXPRESSIONS,WORD,WORD);
extern int MasterMerge(void);
extern int PutToMaster(PHEAD WORD *);
extern void SetWorkerFiles(void);
extern int MakeThreadBuckets(int,int);
Expand Down Expand Up @@ -1657,6 +1656,9 @@ extern void find_Horner_MCTS_expand_tree_threaded(void);
extern void optimize_expression_given_Horner(void);
extern void optimize_expression_given_Horner_threaded(void);
#endif


extern int GetNumberOfSortBots(int);

extern int DoPreAdd(UBYTE *s);
extern int DoPreUseDictionary(UBYTE *s);
Expand Down
8 changes: 2 additions & 6 deletions sources/evaluate.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ void SetfFloatPrecision(LONG prec)
#ifdef WITHPTHREADS
int totnum = AM.totalnumberofthreads, id;
mpfr_t *a;
#ifdef WITHSORTBOTS
totnum = MaX(2*AM.totalnumberofthreads-3,AM.totalnumberofthreads);
#endif
totnum = totnum + GetNumberOfSortBots(totnum - 1);
for ( id = 0; id < totnum; id++ ) {
AB[id]->T.auxr_ = (void *)Malloc1(sizeof(mpfr_t)*5,"AB[id]->T.auxr_");
a = (mpfr_t *)AB[id]->T.auxr_;
Expand All @@ -143,9 +141,7 @@ void ClearfFloat(void)
#ifdef WITHPTHREADS
int totnum = AM.totalnumberofthreads, id;
mpfr_t *a;
#ifdef WITHSORTBOTS
totnum = MaX(2*AM.totalnumberofthreads-3,AM.totalnumberofthreads);
#endif
totnum = totnum + GetNumberOfSortBots(totnum - 1);
if ( AB[0]->T.auxr_ ) {
for ( id = 0; id < totnum; id++ ) {
a = (mpfr_t *)AB[id]->T.auxr_;
Expand Down
10 changes: 3 additions & 7 deletions sources/float.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,11 +1145,9 @@ void SetupMZVTables(void)
void SetupMPFTables(void)
{
#ifdef WITHPTHREADS
int id, totnum;
int totnum = AM.totalnumberofthreads, id;
mpf_t *a;
#ifdef WITHSORTBOTS
totnum = MaX(2*AM.totalnumberofthreads-3,AM.totalnumberofthreads);
#endif
totnum = totnum + GetNumberOfSortBots(totnum - 1);
for ( id = 0; id < totnum; id++ ) {
/*
We work here with a[0] etc because the aux1 etc contain B which
Expand Down Expand Up @@ -1204,9 +1202,7 @@ void ClearMZVTables(void)
AB[id]->T.mpf_tab2 = 0;
}
}
#ifdef WITHSORTBOTS
totnum = MaX(2*AM.totalnumberofthreads-3,AM.totalnumberofthreads);
#endif
totnum = totnum + GetNumberOfSortBots(totnum - 1);
for ( id = 0; id < totnum; id++ ) {
if ( AB[id]->T.aux_ ) {
a = (mpf_t *)AB[id]->T.aux_;
Expand Down
1 change: 0 additions & 1 deletion sources/form3.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ template<typename T> struct calc {
#define DEBUGGINGLOCKS
#define WITHSTATS
*/
#define WITHSORTBOTS

#include <stdio.h>
#include <stdlib.h>
Expand Down
8 changes: 3 additions & 5 deletions sources/pre.c
Original file line number Diff line number Diff line change
Expand Up @@ -6861,11 +6861,9 @@ int DoSetRandom(UBYTE *s)
while ( *s == ' ' || *s == '\t' ) s++;
if ( *s == 0 ) {
#ifdef WITHPTHREADS
#ifdef WITHSORTBOTS
int id, totnum = MaX(2*AM.totalnumberofthreads-3,AM.totalnumberofthreads);
#else
int id, totnum = AM.totalnumberofthreads;
#endif
int id, totnum = AM.totalnumberofthreads;

totnum = totnum+ GetNumberOfSortBots(totnum - 1);
for ( id = 0; id < totnum; id++ ) {
AB[id]->R.wranfseed = x;
if ( AB[id]->R.wranfia ) M_free(AB[id]->R.wranfia,"wranf");
Expand Down
10 changes: 5 additions & 5 deletions sources/setfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,15 @@ int RecalcSetups(void)
if ( AM.MaxTer > MAXPOSITIVE - 200*(LONG)(sizeof(WORD)) ) AM.MaxTer = MAXPOSITIVE - 200*(LONG)(sizeof(WORD));
AM.MaxTer /= sizeof(WORD);
AM.MaxTer *= sizeof(WORD);
#ifdef WITHSORTBOTS
if ( AM.totalnumberofthreads-1 > 2 ) {
minimumsize = (2*(AM.totalnumberofthreads-1)-2)*(AM.MaxTer+
int numworkers = AM.totalnumberofthreads - 1;
int numberofsortbots = GetNumberOfSortBots(numworkers);
if ( numberofsortbots ) {
minimumsize = (numworkers+numberofsortbots)*(AM.MaxTer+
NUMBEROFBLOCKSINSORT*MINIMUMNUMBEROFTERMS/2*AM.MaxTer);
}
else
#endif
{
minimumsize = (AM.totalnumberofthreads-1)*(AM.MaxTer+
minimumsize = numworkers*(AM.MaxTer+
NUMBEROFBLOCKSINSORT*MINIMUMNUMBEROFTERMS*AM.MaxTer);
}
if ( totalsize < minimumsize ) {
Expand Down
2 changes: 0 additions & 2 deletions sources/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2136,10 +2136,8 @@ struct T_const {
#ifdef WITHPTHREADS
int identity; /* () When we work with B->T */
int LoadBalancing; /* Needed for synchronization */
#ifdef WITHSORTBOTS
int SortBotIn1; /* Input stream 1 for a SortBot */
int SortBotIn2; /* Input stream 2 for a SortBot */
#endif
#endif
int TermMemMax; /* For TermMalloc. Set zero in Checkpoint */
int TermMemTop; /* For TermMalloc. Set zero in Checkpoint */
Expand Down
Loading
Loading