Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

141 investigate the impact of pairing taskprogressionisinterruptrequested with periodictestinterruptionistestallowed #197

Merged
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
14 changes: 6 additions & 8 deletions src/Learning/DTForest/DTGrouperMODLOptimization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,6 @@ void DTGrouperMODL::FastPostOptimizeGroups(KWFrequencyTable* kwftSource, KWFrequ
double dBestDeltaCost;
double dBestInDeltaCost;
int nBestInGroup;
PeriodicTest periodicTestOptimize;

require(kwftSource != NULL);
require(kwftTarget != NULL);
Expand Down Expand Up @@ -1388,7 +1387,7 @@ void DTGrouperMODL::FastPostOptimizeGroups(KWFrequencyTable* kwftSource, KWFrequ
nStepNumber++;

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and TaskProgression::IsInterruptionRequested())
if (TaskProgression::IsRefreshNecessary() and TaskProgression::IsInterruptionRequested())
break;

// Perturbation aleatoire des index de modalites et de groupes
Expand Down Expand Up @@ -1420,7 +1419,7 @@ void DTGrouperMODL::FastPostOptimizeGroups(KWFrequencyTable* kwftSource, KWFrequ
nInGroup = ivGroupIndexes.GetAt((nStart + n2) % nGroupNumber);

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and
if (TaskProgression::IsRefreshNecessary() and
TaskProgression::IsInterruptionRequested())
break;

Expand Down Expand Up @@ -1454,7 +1453,7 @@ void DTGrouperMODL::FastPostOptimizeGroups(KWFrequencyTable* kwftSource, KWFrequ
}

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and TaskProgression::IsInterruptionRequested())
if (TaskProgression::IsRefreshNecessary() and TaskProgression::IsInterruptionRequested())
break;

// On effectue si necessaire le meilleur transfert de groupe
Expand Down Expand Up @@ -1529,7 +1528,6 @@ void DTGrouperMODL::FastPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSour
double dBestDeltaCost;
double dBestInDeltaCost;
int nBestInGroup;
PeriodicTest periodicTestOptimize;
POSITION position;
KWFrequencyVector* frequencyVector;
int nGarbageModalityNumber;
Expand Down Expand Up @@ -1603,7 +1601,7 @@ void DTGrouperMODL::FastPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSour
nStepNumber++;

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and TaskProgression::IsInterruptionRequested())
if (TaskProgression::IsRefreshNecessary() and TaskProgression::IsInterruptionRequested())
break;

// Perturbation aleatoire des index de modalites et de groupes
Expand Down Expand Up @@ -1641,7 +1639,7 @@ void DTGrouperMODL::FastPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSour
nInGroup = ivGroupIndexes.GetAt((nStart + n2) % nGroupNumber);

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and
if (TaskProgression::IsRefreshNecessary() and
TaskProgression::IsInterruptionRequested())
break;

Expand Down Expand Up @@ -1806,7 +1804,7 @@ void DTGrouperMODL::FastPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSour
}

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and TaskProgression::IsInterruptionRequested())
if (TaskProgression::IsRefreshNecessary() and TaskProgression::IsInterruptionRequested())
break;

// On effectue si necessaire le meilleur transfert de groupe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ boolean KDTextTokenSampleCollectionTask::SequentialCollectTokenSamples(const KWD
boolean KDTextTokenSampleCollectionTask::AnalyseDatabase(KWDatabase* database, ObjectArray* oaTextTokenizers)
{
boolean bOk = true;
PeriodicTest periodicTestInterruption;
KWObject* kwoObject;
longint lObjectNumber;
longint lRecordNumber;
Expand Down Expand Up @@ -356,7 +355,7 @@ boolean KDTextTokenSampleCollectionTask::AnalyseDatabase(KWDatabase* database, O
}

// Suivi de la tache
if (periodicTestInterruption.IsTestAllowed(lRecordNumber))
if (TaskProgression::IsRefreshNecessary())
TaskProgression::DisplayProgression((int)(100 * database->GetReadPercentage()));
}
Global::DesactivateErrorFlowControl();
Expand Down
2 changes: 1 addition & 1 deletion src/Learning/KWData/KWDataTableDriverTextFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ KWObject* KWDataTableDriverTextFile::Read()
require(not inputBuffer->IsBufferEnd());

// On retourne NULL, sans message, si interruption utilisateur
if (periodicTestInterruption.IsTestAllowed(lRecordIndex))
if (TaskProgression::IsRefreshNecessary())
{
if (TaskProgression::IsInterruptionRequested())
return NULL;
Expand Down
3 changes: 0 additions & 3 deletions src/Learning/KWData/KWDataTableDriverTextFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@ class KWDataTableDriverTextFile : public KWDataTableDriver
// coherente des flags internes de gestion du fichier
virtual void ResetDatabaseFile();

// Memorisation de l'etat de suivi des taches
PeriodicTest periodicTestInterruption;

// Utilisation d'une ligne d'en-tete
boolean bHeaderLineUsed;

Expand Down
10 changes: 4 additions & 6 deletions src/Learning/KWData/KWDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ KWClass* KWDatabase::ComputeClass()
}

// Suivi de la tache
if (periodicTestDisplay.IsTestAllowed(lRecordNumber))
if (TaskProgression::IsRefreshNecessary())
{
TaskProgression::DisplayProgression((int)(100 * GetReadPercentage()));
if (TaskProgression::IsInterruptionRequested())
Expand Down Expand Up @@ -774,7 +774,7 @@ boolean KWDatabase::ReadAll()
}

// Suivi de la tache
if (periodicTestInterruption.IsTestAllowed(lRecordNumber))
if (TaskProgression::IsRefreshNecessary())
{
TaskProgression::DisplayProgression((int)(100 * GetReadPercentage()));
DisplayReadTaskProgressionLabel(lRecordNumber, lObjectNumber);
Expand Down Expand Up @@ -850,7 +850,7 @@ void KWDatabase::DeleteAll()
delete oaAllObjects.GetAt(nObject);

// Suivi de la tache (sans test d'interruption: il faut detruire tous les objets)
if (periodicTestDisplay.IsTestAllowed(nObject))
if (TaskProgression::IsRefreshNecessary())
TaskProgression::DisplayProgression((int)(nObject * 100.0 / oaAllObjects.GetSize()));
if (bDisplay)
{
Expand Down Expand Up @@ -917,14 +917,12 @@ boolean KWDatabase::WriteAll(KWDatabase* sourceObjects)
}

// Suivi de la tache
if (periodicTestDisplay.IsTestAllowed(lObjectNumber))
if (TaskProgression::IsRefreshNecessary())
{
TaskProgression::DisplayProgression(
(int)(nObject * 100.0 / sourceObjects->GetObjects()->GetSize()));
if (TaskProgression::IsInterruptionRequested())
{
break;
}
}
}
Global::DesactivateErrorFlowControl();
Expand Down
4 changes: 0 additions & 4 deletions src/Learning/KWData/KWDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,6 @@ class KWDatabase : public Object
Continuous cSelectionContinuous;
IntVector ivMarkedInstances;

// Memorisation de l'etat de suivi des taches
PeriodicTest periodicTestInterruption;
PeriodicTest periodicTestDisplay;

// Formats par defaut des types complexes, pour gerer les conversions vers les chaines de caracteres
KWDateFormat dateDefaultConverter;
KWTimeFormat timeDefaultConverter;
Expand Down
4 changes: 2 additions & 2 deletions src/Learning/KWData/KWMTDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@ boolean KWMTDatabase::PhysicalReadAllReferenceObjects(double dSamplePercentage)
break;

// Suivi de la tache
if (bIsInTask and periodicTestInterruption.IsTestAllowed(lRecordNumber))
if (bIsInTask and TaskProgression::IsRefreshNecessary())
{
TaskProgression::DisplayLabel(sMessage + ": " +
LongintToReadableString(lObjectNumber) +
Expand Down Expand Up @@ -1753,7 +1753,7 @@ boolean KWMTDatabase::PhysicalReadAllReferenceObjects(double dSamplePercentage)

// Suivi de la tache
lRecordNumber++;
if (bIsInTask and periodicTestInterruption.IsTestAllowed(lRecordNumber))
if (bIsInTask and TaskProgression::IsRefreshNecessary())
{
if (TaskProgression::IsInterruptionRequested())
{
Expand Down
6 changes: 3 additions & 3 deletions src/Learning/KWDataPreparation/KWAttributeSubsetStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ boolean KWAttributeSubsetStats::CreateAttributeIntervals(const KWTupleTable* tup
tuple = attributeTupleTable.GetAt(nTuple);

// Progression
if (periodicTestDisplay.IsTestAllowed(nTuple))
if (TaskProgression::IsRefreshNecessary())
{
// CH IV Begin
// Cas d'un attribut de grille, qui n'est pas un attribut interne d'un attribut VarPart
Expand Down Expand Up @@ -786,7 +786,7 @@ boolean KWAttributeSubsetStats::CreateAttributeValueSets(const KWTupleTable* tup
attributeTupleTable.GetAt(nTuple - 1)->GetSymbolAt(0).CompareValue(tuple->GetSymbolAt(0)) < 0);

// Progression
if (periodicTestDisplay.IsTestAllowed(nTuple))
if (TaskProgression::IsRefreshNecessary())
{
// CH IV Begin
// Cas d'un attribut de grille, qui n'est pas un attribut interne d'un attribut VarPart
Expand Down Expand Up @@ -965,7 +965,7 @@ boolean KWAttributeSubsetStats::CreateDataGridCells(const KWTupleTable* tupleTab
tuple = tupleTable->GetAt(nTuple);

// Progression
if (periodicTestDisplay.IsTestAllowed(nTuple))
if (TaskProgression::IsRefreshNecessary())
{
TaskProgression::DisplayProgression((int)(50 + nTuple * 50.0 / tupleTable->GetSize()));
if (TaskProgression::IsInterruptionRequested())
Expand Down
6 changes: 2 additions & 4 deletions src/Learning/KWDataPreparation/KWAttributeSubsetStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,11 @@ class KWAttributeSubsetStats : public KWDataPreparationStats
// Parametre avance. Par defaut: 0 signifie qu'il n'y a pas de contrainte
int nMaxCellNumberConstraint;

// Gestion des tests pour le suivi des taches
PeriodicTest periodicTestDisplay;
friend class PLShared_AttributeSubsetStats;

// Pre-granularisation des attributs numeriques cible (regression) et des attributs numeriques explicatifs en
// analyse non supervisee (co-clustering)
static boolean bPregranularizedNumericalAttributes;

friend class PLShared_AttributeSubsetStats;
};

///////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,6 @@ boolean KWDataPreparationUnivariateTask::SplitSlice(KWDataTableSlice* slice, int
int nSubSliceBlockIndex;
int nSliceDenseSymbolAttributeIndex;
int nSubSliceDenseAttributeIndex;
PeriodicTest periodicTestInterruption;
KWObject* kwoObject;
longint lRecordNumber;
ALString sSliceBaseName;
Expand Down Expand Up @@ -1239,7 +1238,7 @@ boolean KWDataPreparationUnivariateTask::SplitSlice(KWDataTableSlice* slice, int
}

// Suivi de la tache
if (periodicTestInterruption.IsTestAllowed(lRecordNumber))
if (TaskProgression::IsRefreshNecessary())
TaskProgression::DisplayProgression(
(int)(100 * slice->GetReadPercentage()));
}
Expand Down
6 changes: 2 additions & 4 deletions src/Learning/KWDataPreparation/KWDiscretizerMODL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,6 @@ void KWDiscretizerMODL::IntervalListPostOptimization(const KWFrequencyTable* kwf
int nIntervalNumber;
int nSurnumerousIntervalNumber;
int nStepNumber;
PeriodicTest periodicTestOptimize;

require(kwftSource != NULL);
require(headInterval != NULL);
Expand Down Expand Up @@ -1590,7 +1589,7 @@ void KWDiscretizerMODL::IntervalListPostOptimization(const KWFrequencyTable* kwf
nStepNumber++;

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and TaskProgression::IsInterruptionRequested())
if (TaskProgression::IsRefreshNecessary() and TaskProgression::IsInterruptionRequested())
break;

// Calcul du nombre d'inetrvalles surnumeraires pour la prise en compte de
Expand Down Expand Up @@ -1763,7 +1762,6 @@ void KWDiscretizerMODL::IntervalListBoundaryPostOptimization(const KWFrequencyTa
double dBestDeltaCost;
int nIntervalNumber;
int nStepNumber;
PeriodicTest periodicTestOptimize;

require(kwftSource != NULL);
require(headInterval != NULL);
Expand Down Expand Up @@ -1801,7 +1799,7 @@ void KWDiscretizerMODL::IntervalListBoundaryPostOptimization(const KWFrequencyTa
nStepNumber++;

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and TaskProgression::IsInterruptionRequested())
if (TaskProgression::IsRefreshNecessary() and TaskProgression::IsInterruptionRequested())
break;

// Recherche du meilleur MergeSplit et de son cout
Expand Down
21 changes: 9 additions & 12 deletions src/Learning/KWDataPreparation/KWGrouperMODLOptimization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,6 @@ void KWGrouperMODL::FastPostOptimizeGroups(KWFrequencyTable* kwftSource, KWFrequ
double dBestDeltaCost;
double dBestInDeltaCost;
int nBestInGroup;
PeriodicTest periodicTestOptimize;

require(kwftSource != NULL);
require(kwftTarget != NULL);
Expand Down Expand Up @@ -1388,7 +1387,7 @@ void KWGrouperMODL::FastPostOptimizeGroups(KWFrequencyTable* kwftSource, KWFrequ
nStepNumber++;

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and TaskProgression::IsInterruptionRequested())
if (TaskProgression::IsRefreshNecessary() and TaskProgression::IsInterruptionRequested())
break;

// Perturbation aleatoire des index de modalites et de groupes
Expand Down Expand Up @@ -1420,7 +1419,7 @@ void KWGrouperMODL::FastPostOptimizeGroups(KWFrequencyTable* kwftSource, KWFrequ
nInGroup = ivGroupIndexes.GetAt((nStart + n2) % nGroupNumber);

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and
if (TaskProgression::IsRefreshNecessary() and
TaskProgression::IsInterruptionRequested())
break;

Expand Down Expand Up @@ -1454,7 +1453,7 @@ void KWGrouperMODL::FastPostOptimizeGroups(KWFrequencyTable* kwftSource, KWFrequ
}

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and TaskProgression::IsInterruptionRequested())
if (TaskProgression::IsRefreshNecessary() and TaskProgression::IsInterruptionRequested())
break;

// On effectue si necessaire le meilleur transfert de groupe
Expand Down Expand Up @@ -1528,7 +1527,6 @@ void KWGrouperMODL::FastPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSour
double dBestDeltaCost;
double dBestInDeltaCost;
int nBestInGroup;
PeriodicTest periodicTestOptimize;
POSITION position;
KWFrequencyVector* frequencyVector;
int nGarbageModalityNumber;
Expand Down Expand Up @@ -1602,7 +1600,7 @@ void KWGrouperMODL::FastPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSour
nStepNumber++;

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and TaskProgression::IsInterruptionRequested())
if (TaskProgression::IsRefreshNecessary() and TaskProgression::IsInterruptionRequested())
break;

// Perturbation aleatoire des index de modalites et de groupes
Expand Down Expand Up @@ -1640,7 +1638,7 @@ void KWGrouperMODL::FastPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSour
nInGroup = ivGroupIndexes.GetAt((nStart + n2) % nGroupNumber);

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and
if (TaskProgression::IsRefreshNecessary() and
TaskProgression::IsInterruptionRequested())
break;

Expand Down Expand Up @@ -1805,7 +1803,7 @@ void KWGrouperMODL::FastPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSour
}

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and TaskProgression::IsInterruptionRequested())
if (TaskProgression::IsRefreshNecessary() and TaskProgression::IsInterruptionRequested())
break;

// On effectue si necessaire le meilleur transfert de groupe
Expand Down Expand Up @@ -1913,7 +1911,6 @@ void KWGrouperMODL::EMPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSource
double dBestDeltaCost;
double dBestInDeltaCost;
int nBestInGroup;
PeriodicTest periodicTestOptimize;
POSITION position;
KWFrequencyTable kwftImproved;
SortedList improvedFrequencyList(KWFrequencyVectorModalityNumberCompare);
Expand Down Expand Up @@ -1993,7 +1990,7 @@ void KWGrouperMODL::EMPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSource
nStepNumber++;

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and TaskProgression::IsInterruptionRequested())
if (TaskProgression::IsRefreshNecessary() and TaskProgression::IsInterruptionRequested())
break;

// Parcours de toutes les modalites
Expand Down Expand Up @@ -2026,7 +2023,7 @@ void KWGrouperMODL::EMPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSource
for (nInGroup = 0; nInGroup < nGroupNumber; nInGroup++)
{
// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and
if (TaskProgression::IsRefreshNecessary() and
TaskProgression::IsInterruptionRequested())
break;

Expand Down Expand Up @@ -2179,7 +2176,7 @@ void KWGrouperMODL::EMPostOptimizeGroupsWithGarbage(KWFrequencyTable* kwftSource
}

// Test si arret de tache demandee
if (periodicTestOptimize.IsTestAllowed(0) and TaskProgression::IsInterruptionRequested())
if (TaskProgression::IsRefreshNecessary() and TaskProgression::IsInterruptionRequested())
break;

// On memorise le meilleur transfert de la modalite courante vers un nouveau groupe s'il existe
Expand Down
Loading
Loading