Improve logging
This commit is contained in:
джерело
9c759b3f04
коміт
4b0443583d
|
@ -62,12 +62,12 @@ for c in $clist
|
|||
do
|
||||
for nk in {1..16}
|
||||
do
|
||||
echo 'Starting run for c =' $c', kfact = '$nk | tee -a $logfile
|
||||
echo '** Starting run for c =' $c', kfact = '$nk | tee -a $logfile
|
||||
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/prelim'
|
||||
mkdir -p $dir
|
||||
cd $dir
|
||||
LiebLin_Catalogue_Fixed_c_k_Nscaling $whichDSF $c $nk $kBT $target_sumrule 0 $nr_minutes | tee -a $basedir/$logfile
|
||||
cd $basedir
|
||||
echo 'Successfully completed run for c =' $c', kfact = '$nk'\n' | tee -a $logfile
|
||||
echo '** Successfully completed run for c =' $c', kfact = '$nk'.\n' | tee -a $logfile
|
||||
done
|
||||
done
|
||||
|
|
|
@ -48,7 +48,7 @@ for c in $clist
|
|||
do
|
||||
for nk in {1..16}
|
||||
do
|
||||
echo 'Starting plotting of DSFs for c =' $c', kfact = '$nk
|
||||
echo '** Starting plotting of DSFs for c =' $c', k = '$nk' kFo4.'
|
||||
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/plots'
|
||||
mkdir -p $dir
|
||||
cd $dir
|
||||
|
@ -74,6 +74,6 @@ do
|
|||
done
|
||||
|
||||
cd $basedir
|
||||
echo ' Successfully plotted DSFs for c =' $c', kfact = '$nk'\n'
|
||||
echo '** Successfully plotted DSFs for c =' $c', k = '$nk'kFo4.\n'
|
||||
done
|
||||
done
|
||||
|
|
|
@ -93,10 +93,20 @@ int main(int argc, char* argv[])
|
|||
Secs_left = int(Max_Secs - (ActualTime - StartTime));
|
||||
|
||||
Scan_Info resulting_info;
|
||||
if (srsat < target_sumrule && Secs_left > Max_Secs/2)
|
||||
if (srsat < target_sumrule && Secs_left > Max_Secs/2) {
|
||||
// Improve the icmin calculation by one chunk:
|
||||
cout << "---\nTime left = " << Secs_left << " seconds." << endl;
|
||||
if (srsat > 0) {
|
||||
cout << "Continue with N = " << N << ". Sumrule previously achieved: " << srsat << endl;
|
||||
} else {
|
||||
cout << "Start with N = " << N << "." << endl;
|
||||
}
|
||||
resulting_info = Scan_LiebLin (whichDSF, c_int, L, N, iKmin, iKmax, kBT,
|
||||
Secs_left, target_sumrule, refine);
|
||||
cout << "Done with N = " << N
|
||||
<< ". Sumrule obtained: " << resulting_info.sumrule_obtained
|
||||
<< endl;
|
||||
}
|
||||
|
||||
if (resulting_info.sumrule_obtained > target_sumrule) {
|
||||
// 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[])
|
|||
ActualTime = omp_get_wtime();
|
||||
|
||||
Secs_left = int(Max_Secs - (ActualTime - StartTime));
|
||||
cout << "Done with N = " << N << ". Sumrule obtained: " << resulting_info.sumrule_obtained
|
||||
<< "\tTime left = " << Secs_left << " seconds." << endl;
|
||||
|
||||
if (Secs_left < 60) {
|
||||
if (Secs_left < 30) {
|
||||
if (resulting_info.sumrule_obtained > target_sumrule) {
|
||||
cout << "Breaking out after completing N = " << N << " since time left = " << Secs_left << endl;
|
||||
cout << "---\nBreaking out after completing N = " << N
|
||||
<< " since time left = " << Secs_left << " seconds." << endl;
|
||||
}
|
||||
else {
|
||||
cout << "Breaking out while working on N = " << N << " since allocated time is exhausted." << endl;
|
||||
cout << "---\nBreaking out while working on N = " << N
|
||||
<< " since allocated time is exhausted." << endl;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -819,6 +819,10 @@ namespace ABACUS {
|
|||
<< exp(-paused_thread_data.logscale * paused_thread_data.lowest_il_with_nthreads_neq_0) << endl;
|
||||
LOG_outfile << "Resulting info: " << scan_info << endl;
|
||||
}
|
||||
time_t current_time = time(nullptr);
|
||||
char timestr[100];
|
||||
strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S", gmtime(¤t_time));
|
||||
LOG_outfile << "Run completion timestamp: " << timestr << " UTC" << endl;
|
||||
LOG_outfile << "ABACUS version " << ABACUS_VERSION << ", copyright J.-S. Caux." << endl << endl;
|
||||
LOG_outfile.close();
|
||||
}
|
||||
|
|
Завантаження…
Посилання в новій задачі