Improve logging

Esse commit está contido em:
Jean-Sébastien 2021-12-12 20:34:06 +01:00
commit 4b0443583d
4 arquivos alterados com 24 adições e 10 exclusões

Ver arquivo

@ -62,12 +62,12 @@ for c in $clist
do do
for nk in {1..16} for nk in {1..16}
do 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' dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/prelim'
mkdir -p $dir mkdir -p $dir
cd $dir cd $dir
LiebLin_Catalogue_Fixed_c_k_Nscaling $whichDSF $c $nk $kBT $target_sumrule 0 $nr_minutes | tee -a $basedir/$logfile LiebLin_Catalogue_Fixed_c_k_Nscaling $whichDSF $c $nk $kBT $target_sumrule 0 $nr_minutes | tee -a $basedir/$logfile
cd $basedir 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
done done

Ver arquivo

@ -48,7 +48,7 @@ for c in $clist
do do
for nk in {1..16} for nk in {1..16}
do 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' dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/plots'
mkdir -p $dir mkdir -p $dir
cd $dir cd $dir
@ -74,6 +74,6 @@ do
done done
cd $basedir 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
done done

Ver arquivo

@ -93,10 +93,20 @@ int main(int argc, char* argv[])
Secs_left = int(Max_Secs - (ActualTime - StartTime)); Secs_left = int(Max_Secs - (ActualTime - StartTime));
Scan_Info resulting_info; 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: // 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, resulting_info = Scan_LiebLin (whichDSF, c_int, L, N, iKmin, iKmax, kBT,
Secs_left, target_sumrule, refine); Secs_left, target_sumrule, refine);
cout << "Done with N = " << N
<< ". Sumrule obtained: " << resulting_info.sumrule_obtained
<< endl;
}
if (resulting_info.sumrule_obtained > target_sumrule) { if (resulting_info.sumrule_obtained > target_sumrule) {
// Move files to storage, keeping a copy of the .src file in the current directory // 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(); ActualTime = omp_get_wtime();
Secs_left = int(Max_Secs - (ActualTime - StartTime)); 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) { 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 { 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; break;
} }

Ver arquivo

@ -819,6 +819,10 @@ namespace ABACUS {
<< exp(-paused_thread_data.logscale * paused_thread_data.lowest_il_with_nthreads_neq_0) << endl; << exp(-paused_thread_data.logscale * paused_thread_data.lowest_il_with_nthreads_neq_0) << endl;
LOG_outfile << "Resulting info: " << scan_info << 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(&current_time));
LOG_outfile << "Run completion timestamp: " << timestr << " UTC" << endl;
LOG_outfile << "ABACUS version " << ABACUS_VERSION << ", copyright J.-S. Caux." << endl << endl; LOG_outfile << "ABACUS version " << ABACUS_VERSION << ", copyright J.-S. Caux." << endl << endl;
LOG_outfile.close(); LOG_outfile.close();
} }