Browse Source

Add alerts

master
Jean-Sébastien 2 years ago
parent
commit
d7c421fde5
2 changed files with 14 additions and 2 deletions
  1. 1
    1
      src/EXECS/LiebLin_DSF_tester.cc
  2. 13
    1
      src/SCAN/General_Scan.cc

+ 1
- 1
src/EXECS/LiebLin_DSF_tester.cc View File

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

+ 13
- 1
src/SCAN/General_Scan.cc View File

@@ -537,6 +537,7 @@ namespace ABACUS {
537 537
 
538 538
       Vect<Scan_Thread> threads_to_do;
539 539
       int il_to_do = paused_thread_data.lowest_il_with_nthreads_neq_0; // for resaving threads in case we're out of time
540
+      DP current_threshold = exp(-paused_thread_data.logscale * il_to_do);
540 541
       {
541 542
 #pragma omp critical
542 543
 	threads_to_do = paused_thread_data.Extract_Next_Scan_Threads();
@@ -568,6 +569,7 @@ namespace ABACUS {
568 569
 
569 570
 	  ScanState.Set_to_Label(threads_to_do[ithread].label, BaseScanState.Ix2);
570 571
 
572
+	  Tstate ScanStateBeingDescended = ScanState;
571 573
 
572 574
 	  // STARTING Descend_and_Compute block:
573 575
 	  int type_required = threads_to_do[ithread].type;
@@ -657,6 +659,16 @@ namespace ABACUS {
657 659
 		// 	     << "\t" << setw(16) << std::fixed << setprecision(8)
658 660
 		// 	     << data_value/exp(-paused_thread_data.logscale * il_to_do) << endl;
659 661
 
662
+		// Uncomment below if alerts for unexpectedly high data_value (as compared to threshold) are desired
663
+		// if (fabs(data_value) > 10.0* current_threshold) {
664
+		//   cout << "\nAlert: data_value > 10* threshold, " << data_value << "\t" << current_threshold << endl;
665
+		//   cout << " for state " << ScanState.label << " descendent of type " << type_required
666
+		//        << " of state " << ScanStateBeingDescended.label << endl;
667
+		//   cout << AveragingState.Ix2 << endl;
668
+		//   cout << ScanStateBeingDescended.Ix2 << endl;
669
+		//   cout << ScanState.Ix2 << endl;
670
+		// }
671
+
660 672
 	      } // if (ScanState.conv)
661 673
 	      else {
662 674
 		if (nconv0++ < 1000)
@@ -753,7 +765,7 @@ namespace ABACUS {
753 765
 
754 766
 	  } // for idesc
755 767
 
756
-	    // FINISHED Descend_and_Compute block
768
+	  // FINISHED Descend_and_Compute block
757 769
 
758 770
 
759 771
 	  scan_info_this_ithread.TT += omp_get_wtime() - start_time_this_ithread;

Loading…
Cancel
Save