Add alerts

This commit is contained in:
Jean-Sébastien 2021-12-19 15:13:49 +01:00
parent 98df982419
commit d7c421fde5
2 changed files with 14 additions and 2 deletions

View File

@ -78,7 +78,7 @@ int main(int argc, char* argv[])
cout << setprecision(16) << "estate.E - spstate.E = " << estate.E - spstate.E
<< "\tME = " << real(exp(ln_Psi_ME(spstate, estate))) << endl;
//cout << "Another try ? (1 == yes, 0 == no)" << endl;
cout << "Another try ? (1 == yes, 0 == no)" << endl;
again = 1;
cin >> again;
} while (again != 0);

View File

@ -537,6 +537,7 @@ namespace ABACUS {
Vect<Scan_Thread> threads_to_do;
int il_to_do = paused_thread_data.lowest_il_with_nthreads_neq_0; // for resaving threads in case we're out of time
DP current_threshold = exp(-paused_thread_data.logscale * il_to_do);
{
#pragma omp critical
threads_to_do = paused_thread_data.Extract_Next_Scan_Threads();
@ -568,6 +569,7 @@ namespace ABACUS {
ScanState.Set_to_Label(threads_to_do[ithread].label, BaseScanState.Ix2);
Tstate ScanStateBeingDescended = ScanState;
// STARTING Descend_and_Compute block:
int type_required = threads_to_do[ithread].type;
@ -657,6 +659,16 @@ namespace ABACUS {
// << "\t" << setw(16) << std::fixed << setprecision(8)
// << data_value/exp(-paused_thread_data.logscale * il_to_do) << endl;
// Uncomment below if alerts for unexpectedly high data_value (as compared to threshold) are desired
// if (fabs(data_value) > 10.0* current_threshold) {
// cout << "\nAlert: data_value > 10* threshold, " << data_value << "\t" << current_threshold << endl;
// cout << " for state " << ScanState.label << " descendent of type " << type_required
// << " of state " << ScanStateBeingDescended.label << endl;
// cout << AveragingState.Ix2 << endl;
// cout << ScanStateBeingDescended.Ix2 << endl;
// cout << ScanState.Ix2 << endl;
// }
} // if (ScanState.conv)
else {
if (nconv0++ < 1000)
@ -753,7 +765,7 @@ namespace ABACUS {
} // for idesc
// FINISHED Descend_and_Compute block
// FINISHED Descend_and_Compute block
scan_info_this_ithread.TT += omp_get_wtime() - start_time_this_ithread;