Browse Source

Improve logging

master
Jean-Sébastien 2 years ago
parent
commit
4b0443583d

+ 2
- 2
scripts/build_LiebLin_catalogue_k_fixed.sh View File

@@ -62,12 +62,12 @@ for c in $clist
62 62
 do
63 63
     for nk in {1..16}
64 64
     do
65
-	echo 'Starting run for c =' $c', kfact = '$nk | tee -a $logfile
65
+	echo '** Starting run for c =' $c', kfact = '$nk | tee -a $logfile
66 66
 	dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/prelim'
67 67
 	mkdir -p $dir
68 68
 	cd $dir
69 69
 	LiebLin_Catalogue_Fixed_c_k_Nscaling $whichDSF $c $nk $kBT $target_sumrule 0 $nr_minutes | tee -a $basedir/$logfile
70 70
 	cd $basedir
71
-	echo 'Successfully completed run for c =' $c', kfact = '$nk'\n' | tee -a $logfile
71
+	echo '** Successfully completed run for c =' $c', kfact = '$nk'.\n' | tee -a $logfile
72 72
     done
73 73
 done

+ 2
- 2
scripts/build_LiebLin_catalogue_k_fixed_dsfs_plots.sh View File

@@ -48,7 +48,7 @@ for c in $clist
48 48
 do
49 49
     for nk in {1..16}
50 50
     do
51
-	echo 'Starting plotting of DSFs for c =' $c', kfact = '$nk
51
+	echo '** Starting plotting of DSFs for c =' $c', k = '$nk' kFo4.'
52 52
 	dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/plots'
53 53
 	mkdir -p $dir
54 54
 	cd $dir
@@ -74,6 +74,6 @@ do
74 74
 	done
75 75
 
76 76
 	cd $basedir
77
-	echo ' Successfully plotted DSFs for c =' $c', kfact = '$nk'\n'
77
+	echo '** Successfully plotted DSFs for c =' $c', k = '$nk'kFo4.\n'
78 78
     done
79 79
 done

+ 16
- 6
src/EXECS/LiebLin_Catalogue_Fixed_c_k_Nscaling.cc View File

@@ -93,10 +93,20 @@ int main(int argc, char* argv[])
93 93
       Secs_left = int(Max_Secs - (ActualTime - StartTime));
94 94
 
95 95
       Scan_Info resulting_info;
96
-      if (srsat < target_sumrule && Secs_left > Max_Secs/2)
96
+      if (srsat < target_sumrule && Secs_left > Max_Secs/2) {
97 97
 	// Improve the icmin calculation by one chunk:
98
+	cout << "---\nTime left = " << Secs_left << " seconds." << endl;
99
+	if (srsat > 0) {
100
+	  cout << "Continue with N = " << N << ". Sumrule previously achieved: " << srsat << endl;
101
+	} else {
102
+	  cout << "Start with N = " << N << "." << endl;
103
+	}
98 104
 	resulting_info = Scan_LiebLin (whichDSF, c_int, L, N, iKmin, iKmax, kBT,
99 105
 				       Secs_left, target_sumrule, refine);
106
+	cout << "Done with N = " << N
107
+	     << ". Sumrule obtained: " << resulting_info.sumrule_obtained
108
+	     << endl;
109
+      }
100 110
 
101 111
       if (resulting_info.sumrule_obtained > target_sumrule) {
102 112
 	// Move files to storage, keeping a copy of the .src file in the current directory
@@ -111,15 +121,15 @@ int main(int argc, char* argv[])
111 121
       ActualTime = omp_get_wtime();
112 122
 
113 123
       Secs_left = int(Max_Secs - (ActualTime - StartTime));
114
-      cout << "Done with N = " << N << ". Sumrule obtained: " << resulting_info.sumrule_obtained
115
-	   << "\tTime left = " << Secs_left << " seconds." << endl;
116 124
 
117
-      if (Secs_left < 60) {
125
+      if (Secs_left < 30) {
118 126
 	if (resulting_info.sumrule_obtained > target_sumrule) {
119
-	  cout << "Breaking out after completing N = " << N << " since time left = " << Secs_left << endl;
127
+	  cout << "---\nBreaking out after completing N = " << N
128
+	       << " since time left = " << Secs_left << " seconds." << endl;
120 129
 	}
121 130
 	else {
122
-	  cout << "Breaking out while working on N = " << N << " since allocated time is exhausted." << endl;
131
+	  cout << "---\nBreaking out while working on N = " << N
132
+	       << " since allocated time is exhausted." << endl;
123 133
 	}
124 134
 	break;
125 135
       }

+ 4
- 0
src/SCAN/General_Scan.cc View File

@@ -819,6 +819,10 @@ namespace ABACUS {
819 819
 		    << exp(-paused_thread_data.logscale * paused_thread_data.lowest_il_with_nthreads_neq_0) << endl;
820 820
 	LOG_outfile << "Resulting info: " << scan_info << endl;
821 821
       }
822
+      time_t current_time = time(nullptr);
823
+      char timestr[100];
824
+      strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S", gmtime(&current_time));
825
+      LOG_outfile << "Run completion timestamp: " << timestr << " UTC" << endl;
822 826
       LOG_outfile << "ABACUS version " << ABACUS_VERSION << ", copyright J.-S. Caux." << endl << endl;
823 827
       LOG_outfile.close();
824 828
     }

Loading…
Cancel
Save