From 9c759b3f0439d2f52d118dbc2e4bc92e5ca5a076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien?= Date: Sun, 12 Dec 2021 17:13:31 +0100 Subject: [PATCH] Rework catalogue building --- include/ABACUS_Scan.h | 69 ++++++----- scripts/build_LiebLin_catalogue_k_fixed.sh | 14 ++- ...> build_LiebLin_catalogue_k_fixed_dsfs.sh} | 27 +++-- ...d_LiebLin_catalogue_k_fixed_dsfs_plots.sh} | 28 +++-- scripts/plot_dsf_k_fixed.py | 10 +- .../LiebLin_Catalogue_Fixed_c_k_Nscaling.cc | 24 +++- ...talogue_Fixed_c_k_Nscaling_Smoothen_DSF.cc | 109 ------------------ src/SCAN/General_Scan.cc | 92 ++++++++------- src/UTILS/Data_File_Name.cc | 12 +- 9 files changed, 165 insertions(+), 220 deletions(-) rename scripts/{build_LiebLin_catalogue_k_fixed_dsf.sh => build_LiebLin_catalogue_k_fixed_dsfs.sh} (72%) rename scripts/{build_LiebLin_catalogue_k_fixed_plot_dsf.sh => build_LiebLin_catalogue_k_fixed_dsfs_plots.sh} (65%) delete mode 100644 src/EXECS/LiebLin_Catalogue_Fixed_c_k_Nscaling_Smoothen_DSF.cc diff --git a/include/ABACUS_Scan.h b/include/ABACUS_Scan.h index cc6b2a3..ba4bd8d 100644 --- a/include/ABACUS_Scan.h +++ b/include/ABACUS_Scan.h @@ -101,35 +101,6 @@ namespace ABACUS { Vect Descendent_States_with_iK_Stepped_Down_rightIx2only (std::string ScanIx2_label, const Heis_Bethe_State& OriginState, bool disperse_only_current_exc, bool preserve_nexc); - // Functions in src/SCAN/General_Scan.cc: - void Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT, - int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect rank, Vect nr_processors); - void Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT, - int Max_Secs, DP target_sumrule, bool refine); - void Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, std::string defaultScanStatename, int iKmin, int iKmax, - int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect rank, Vect nr_processors); - void Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, std::string defaultname, int iKmin, int iKmax, - int Max_Secs, DP target_sumrule, bool refine); - void Scan_LiebLin_Geometric_Quench (DP c_int, DP L_1, int type_id_1, long long int id_1, DP L_2, int N, - int iK_UL, int Max_Secs, DP target_sumrule, bool refine); - - void Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, - int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect rank, Vect nr_processors); - void Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, - int Max_Secs, DP target_sumrule, bool refine); - void Scan_Heis (char whichDSF, XXZ_Bethe_State& AveragingState, std::string defaultScanStatename, int iKmin, int iKmax, - int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect rank, Vect nr_processors); - void Scan_Heis (char whichDSF, XXX_Bethe_State& AveragingState, std::string defaultScanStatename, int iKmin, int iKmax, - int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect rank, Vect nr_processors); - void Scan_Heis (char whichDSF, XXZ_gpd_Bethe_State& AveragingState, std::string defaultScanStatename, int iKmin, int iKmax, - int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect rank, Vect nr_processors); - - void Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, - int Max_Secs, DP target_sumrule, bool refine, int rank, int nr_processors); - void Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, int Max_Secs, bool refine); - void Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int iKneeded, int Max_Secs, bool refine); - void Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int Max_Secs, bool refine); - // Functions to prepare and wrapup parallel scans: void Prepare_Parallel_Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT, std::string defaultname, int paralevel, Vect rank_lower_paralevels, @@ -228,10 +199,50 @@ namespace ABACUS { std::ostream& operator<< (std::ostream& s, const Scan_Info& info); + // Functions in src/SCAN/General_Scan.cc: template Scan_Info General_Scan (char whichDSF, int iKmin, int iKmax, int iKmod, DP kBT, Tstate& AveragingState, Tstate& SeedScanState, std::string defaultScanStatename, int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect rank, Vect nr_processors); + Scan_Info Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT, + int Max_Secs, DP target_sumrule, bool refine, + int paralevel, Vect rank, Vect nr_processors); + Scan_Info Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT, + int Max_Secs, DP target_sumrule, bool refine); + Scan_Info Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, std::string defaultScanStatename, + int iKmin, int iKmax, + int Max_Secs, DP target_sumrule, bool refine, + int paralevel, Vect rank, Vect nr_processors); + Scan_Info Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, std::string defaultname, + int iKmin, int iKmax, + int Max_Secs, DP target_sumrule, bool refine); + Scan_Info Scan_LiebLin_Geometric_Quench (DP c_int, DP L_1, int type_id_1, long long int id_1, DP L_2, int N, + int iK_UL, int Max_Secs, DP target_sumrule, bool refine); + + Scan_Info Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, + int Max_Secs, DP target_sumrule, bool refine, + int paralevel, Vect rank, Vect nr_processors); + Scan_Info Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, + int Max_Secs, DP target_sumrule, bool refine); + Scan_Info Scan_Heis (char whichDSF, XXZ_Bethe_State& AveragingState, std::string defaultScanStatename, + int iKmin, int iKmax, + int Max_Secs, DP target_sumrule, bool refine, + int paralevel, Vect rank, Vect nr_processors); + Scan_Info Scan_Heis (char whichDSF, XXX_Bethe_State& AveragingState, std::string defaultScanStatename, + int iKmin, int iKmax, + int Max_Secs, DP target_sumrule, bool refine, + int paralevel, Vect rank, Vect nr_processors); + Scan_Info Scan_Heis (char whichDSF, XXZ_gpd_Bethe_State& AveragingState, std::string defaultScanStatename, + int iKmin, int iKmax, + int Max_Secs, DP target_sumrule, bool refine, + int paralevel, Vect rank, Vect nr_processors); + + Scan_Info Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, + int Max_Secs, DP target_sumrule, bool refine, int rank, int nr_processors); + Scan_Info Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, int Max_Secs, bool refine); + Scan_Info Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int iKneeded, int Max_Secs, bool refine); + Scan_Info Scan_ODSLF (char whichDSF, DP Delta, int N, int M, int Max_Secs, bool refine); + //**************************************************************************** diff --git a/scripts/build_LiebLin_catalogue_k_fixed.sh b/scripts/build_LiebLin_catalogue_k_fixed.sh index b5b9eb8..2fd81ac 100755 --- a/scripts/build_LiebLin_catalogue_k_fixed.sh +++ b/scripts/build_LiebLin_catalogue_k_fixed.sh @@ -42,7 +42,15 @@ kBT=$2 target_sumrule=$3 nr_minutes=$4 -logfile='run_'$whichDSF'_kBT_'$kBT'_sr_'$target_sumrule'_'$(date '+%Y-%m-%d-%Hh%M')'.log' +correlator='rho-rho' +if [[ $whichDSF == 'o' ]]; then + correlator='psidag-psi' +elif [[ $whichDSF == 'g' ]]; then + correlator='psi-psidag' +fi + +mkdir -p logs +logfile='logs/run_'$whichDSF'_kBT_'$kBT'_sr_'$target_sumrule'_'$(date '+%Y-%m-%d-%Hh%M')'.log' touch $logfile clist=(1024 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625) @@ -55,11 +63,11 @@ do for nk in {1..16} do echo 'Starting run for c =' $c', kfact = '$nk | tee -a $logfile - dir='c_'$c'/kBT_'$kBT'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule + 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 diff --git a/scripts/build_LiebLin_catalogue_k_fixed_dsf.sh b/scripts/build_LiebLin_catalogue_k_fixed_dsfs.sh similarity index 72% rename from scripts/build_LiebLin_catalogue_k_fixed_dsf.sh rename to scripts/build_LiebLin_catalogue_k_fixed_dsfs.sh index cf98b95..97a0ad3 100755 --- a/scripts/build_LiebLin_catalogue_k_fixed_dsf.sh +++ b/scripts/build_LiebLin_catalogue_k_fixed_dsfs.sh @@ -35,6 +35,13 @@ kBT=$2 target_sumrule=$3 width=$4 +correlator='rho-rho' +if [[ $whichDSF == 'o' ]]; then + correlator='psidag-psi' +elif [[ $whichDSF == 'g' ]]; then + correlator='psi-psidag' +fi + clist=(1024 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625) basedir="$(pwd)" @@ -53,16 +60,18 @@ do ommax=$(($nk*($nk + 8))) # Number of points: Nom=1000 - echo 'Starting computation of DSFs for c =' $c', kfact = '$nk | tee -a $logfile - dir='c_'$c'/kBT_'$kBT'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule + echo 'Starting computation of DSFs for c =' $c', kfact = '$nk + dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_'$c'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/store/data' cd $dir - echo $dir - mkdir -p plots/ - LiebLin_Catalogue_Fixed_c_k_Nscaling_Smoothen_DSF $whichDSF $c $nk $kBT $target_sumrule $ommin $ommax $Nom $width - mv *dsfs plots/ - mv K_* plots/ - mv Omega_* plots/ + for datadir in * + do + cd $datadir + N=${datadir#"N_"} + iK=$(($nk * $N/8)) + Smoothen_LiebLin_DSF_Scaled $whichDSF $c $N $N $iK $iK $kBT 0 $ommin $ommax $Nom $width + cd .. + done cd $basedir - echo ' Successfully computed DSFs for c =' $c', kfact = '$nk'\n' | tee -a $logfile + echo ' Successfully computed DSFs for c =' $c', kfact = '$nk'\n' done done diff --git a/scripts/build_LiebLin_catalogue_k_fixed_plot_dsf.sh b/scripts/build_LiebLin_catalogue_k_fixed_dsfs_plots.sh similarity index 65% rename from scripts/build_LiebLin_catalogue_k_fixed_plot_dsf.sh rename to scripts/build_LiebLin_catalogue_k_fixed_dsfs_plots.sh index 9bb679b..33f2eae 100755 --- a/scripts/build_LiebLin_catalogue_k_fixed_plot_dsf.sh +++ b/scripts/build_LiebLin_catalogue_k_fixed_dsfs_plots.sh @@ -32,6 +32,13 @@ kBT=$2 target_sumrule=$3 width=$4 +correlator='rho-rho' +if [[ $whichDSF == 'o' ]]; then + correlator='psidag-psi' +elif [[ $whichDSF == 'g' ]]; then + correlator='psi-psidag' +fi + clist=(1024 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625) basedir="$(pwd)" @@ -41,9 +48,14 @@ for c in $clist do for nk in {1..16} do - echo 'Starting plotting of DSFs for c =' $c', kfact = '$nk | tee -a $logfile - dir='c_'$c'/kBT_'$kBT'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule'/plots' + echo 'Starting plotting of DSFs for c =' $c', kfact = '$nk + 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 + # Move all K_, Omega_ and .dsfs files to the plots directory + mv ../data/*/K_* . + mv ../data/*/Omega_* . + mv ../data/*/*dsfs . dirlist="$(ls)" # Find the Omega file for file in * @@ -54,16 +66,14 @@ do done echo 'Omega file: ' $omegafile # For each .dsfs file, plot - for file in * + for file in *.dsfs do - if [[ $file = LiebLin*dsfs ]]; then - echo 'Found file ' $file - # invoke the python script - plot_dsf_k_fixed.py $omegafile $file - fi + echo 'Found file ' $file + # invoke the python script + plot_dsf_k_fixed.py $omegafile $file done cd $basedir - echo ' Successfully plotted DSFs for c =' $c', kfact = '$nk'\n' | tee -a $logfile + echo ' Successfully plotted DSFs for c =' $c', kfact = '$nk'\n' done done diff --git a/scripts/plot_dsf_k_fixed.py b/scripts/plot_dsf_k_fixed.py index e109db6..732d11e 100755 --- a/scripts/plot_dsf_k_fixed.py +++ b/scripts/plot_dsf_k_fixed.py @@ -23,11 +23,11 @@ plt.ylabel('$S (k, \omega)$') elements = dsffile.split('_') -c_int = elements[4] -L = elements[6] -N = elements[8] -iK = elements[13] -width = elements[23].partition('.')[0] +c_int = elements[3] +L = elements[5] +N = elements[7] +iK = elements[12] +width = elements[20].partition('.')[0] rho = int(N)/int(L) kokF = int(iK)*0.5/int(L) diff --git a/src/EXECS/LiebLin_Catalogue_Fixed_c_k_Nscaling.cc b/src/EXECS/LiebLin_Catalogue_Fixed_c_k_Nscaling.cc index 8884d6f..2e0c1ec 100644 --- a/src/EXECS/LiebLin_Catalogue_Fixed_c_k_Nscaling.cc +++ b/src/EXECS/LiebLin_Catalogue_Fixed_c_k_Nscaling.cc @@ -92,17 +92,35 @@ int main(int argc, char* argv[]) ActualTime = omp_get_wtime(); Secs_left = int(Max_Secs - (ActualTime - StartTime)); + Scan_Info resulting_info; if (srsat < target_sumrule && Secs_left > Max_Secs/2) // Improve the icmin calculation by one chunk: - Scan_LiebLin (whichDSF, c_int, L, N, iKmin, iKmax, kBT, Secs_left, target_sumrule, refine); + resulting_info = Scan_LiebLin (whichDSF, c_int, L, N, iKmin, iKmax, kBT, + Secs_left, target_sumrule, refine); + + if (resulting_info.sumrule_obtained > target_sumrule) { + // Move files to storage, keeping a copy of the .src file in the current directory + string command1 = "mkdir -p ../store/data/N_" + to_string(N); + system(command1.c_str()); + string command2 = "mv *_N_" + to_string(N) + "* ../store/data/N_" + to_string(N) + "/"; + system(command2.c_str()); + string command3 = "cp ../store/data/N_" + to_string(N) + "/*src ."; + system(command3.c_str()); + } ActualTime = omp_get_wtime(); Secs_left = int(Max_Secs - (ActualTime - StartTime)); - cout << "Done with N = " << N << ". Time left = " << Secs_left << " seconds." << endl; + cout << "Done with N = " << N << ". Sumrule obtained: " << resulting_info.sumrule_obtained + << "\tTime left = " << Secs_left << " seconds." << endl; if (Secs_left < 60) { - cout << "Breaking out after N = " << N << " since time left = " << Secs_left << endl; + if (resulting_info.sumrule_obtained > target_sumrule) { + cout << "Breaking out after completing N = " << N << " since time left = " << Secs_left << endl; + } + else { + cout << "Breaking out while working on N = " << N << " since allocated time is exhausted." << endl; + } break; } diff --git a/src/EXECS/LiebLin_Catalogue_Fixed_c_k_Nscaling_Smoothen_DSF.cc b/src/EXECS/LiebLin_Catalogue_Fixed_c_k_Nscaling_Smoothen_DSF.cc deleted file mode 100644 index 6ee6c14..0000000 --- a/src/EXECS/LiebLin_Catalogue_Fixed_c_k_Nscaling_Smoothen_DSF.cc +++ /dev/null @@ -1,109 +0,0 @@ -/********************************************************** - -This software is part of J.-S. Caux's ABACUS library. - -Copyright (c) J.-S. Caux. - ------------------------------------------------------------ - -File: LiebLin_Catalogue_Fixed_c_k_Nscaling_Smoothen_DSF.cc - -Purpose: Produces smoothened DSF for output from LiebLin_Catalogue_Fixed_c_k_Nscaling.cc - -***********************************************************/ - -#include -#include "ABACUS.h" - -using namespace std; -using namespace ABACUS; - - -int main(int argc, char* argv[]) -{ - - if (argc != 10) { // provide some info - - cout << endl << "Welcome to ABACUS\t(copyright J.-S. Caux)." << endl; - cout << endl << "Usage of LiebLin_Catalogue_Fixed_c_k_Nscaling_Smoothen_DSF executable: " << endl; - cout << endl << "Provide the following arguments:" << endl << endl; - cout << "char whichDSF \t\t Which structure factor should be calculated ? Options are: " - "d for rho rho, g for psi psi{dagger}, o for psi{dagger} psi" << endl; - cout << "DP c_int \t\t Value of the interaction parameter: use positive real values only" << endl; - cout << "int kfact \t\t momentum factor: momemntum will be set to kfact * kF/4" << endl; - cout << "DP kBT \t\t Temperature (positive only of course)" << endl; - cout << "DP target_sumrule \t sumrule saturation you're satisfied with" << endl; - cout << "DP ommin" << endl << "DP ommax \t\t Min and max frequencies to cover in smoothened DSF" << endl; - cout << "Nom \t\t\t Number of frequency points used for discretization" << endl; - cout << "DP width \t\t Gaussian width used in smoothing, in units of two-particle level spacing" << endl; - } - - else { // correct nr of arguments - int ia = 1; - char whichDSF = *argv[ia++]; - DP c_int = atof(argv[ia++]); - int kfact = atoi(argv[ia++]); - DP kBT = atof(argv[ia++]); - DP target_sumrule = atof(argv[ia++]); - int DiK = 1; // only do fixed momentum - DP ommin = atof(argv[ia++]); - DP ommax = atof(argv[ia++]); - int Nom = atoi(argv[ia++]); - DP width = atof(argv[ia++]); - - int iN = 0; - - int nN = 16; - Vect Nv(nN); - // Multiples of 32 up to 256 - for (int i = 1; i <= 8; ++i) Nv[i-1] = 32*i; - // Then steps of 64 up to 512 - for (int i = 1; i <= 4; ++i) Nv[7+i] = 256 + 64*i; - // Then steps of 128 up to 1024 - for (int i = 1; i <= 4; ++i) Nv[11+i] = 512 + 128*i; - - for (int iN = 0; iN < nN; ++iN) { - - int N = Nv[iN]; - DP L = N; - int iKmin = (kfact * N)/8; - int iKmax = iKmin; - DP srsat = 0.0; - - stringstream SRC_stringstream; string SRC_string; - Data_File_Name (SRC_stringstream, whichDSF, c_int, L, N, iKmin, iKmax, kBT, 0.0, ""); - SRC_stringstream << ".src"; - SRC_string = SRC_stringstream.str(); const char* SRC_Cstr = SRC_string.c_str(); - - fstream srcfile; - srcfile.open(SRC_Cstr, fstream::in); - if (srcfile.fail()) { - srsat = 0.0; - } - else { - srcfile >> srsat; - } - srcfile.close(); - - if (srsat > target_sumrule) { - // Compute the DSF - stringstream filenameprefix; - Data_File_Name (filenameprefix, whichDSF, c_int, L, N, iKmin, iKmax, kBT, 0.0, ""); - string prefix = filenameprefix.str(); - - DP normalization = twoPI * L; - - Write_K_File (L, iKmin, iKmax); - Write_Omega_File (Nom, ommin, ommax); - - // We use the scaled width function as default: - DP sumcheck; - sumcheck = Smoothen_RAW_into_SF_LiebLin_Scaled (prefix, L, N, iKmin, iKmax, DiK, ommin, ommax, Nom, width, normalization); - } - - } // for N - - } // else if arguments given OK - - return(0); -} diff --git a/src/SCAN/General_Scan.cc b/src/SCAN/General_Scan.cc index 368c688..3d328b5 100644 --- a/src/SCAN/General_Scan.cc +++ b/src/SCAN/General_Scan.cc @@ -853,9 +853,9 @@ namespace ABACUS { // General version for equilibrium correlators at generic (possibly finite) temperature: - void Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT, - int Max_Secs, DP target_sumrule, bool refine, - int paralevel, Vect rank, Vect nr_processors) + Scan_Info Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT, + int Max_Secs, DP target_sumrule, bool refine, + int paralevel, Vect rank, Vect nr_processors) { // This function scans the Hilbert space of the LiebLin gas, @@ -960,30 +960,26 @@ namespace ABACUS { spsfile.close(); // Perform the scan: - General_Scan (whichDSF, iKmin, iKmax, 100000000, kBT, spstate, SeedScanState, "", - Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors); - - return; + return General_Scan (whichDSF, iKmin, iKmax, 100000000, kBT, spstate, SeedScanState, "", + Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors); } - void Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT, - int Max_Secs, DP target_sumrule, bool refine) + Scan_Info Scan_LiebLin (char whichDSF, DP c_int, DP L, int N, int iKmin, int iKmax, DP kBT, + int Max_Secs, DP target_sumrule, bool refine) { int paralevel = 0; Vect rank(0,1); Vect nr_processors(0,1); - Scan_LiebLin (whichDSF, c_int, L, N, iKmin, iKmax, kBT, Max_Secs, target_sumrule, - refine, paralevel, rank, nr_processors); - - return; + return Scan_LiebLin (whichDSF, c_int, L, N, iKmin, iKmax, kBT, Max_Secs, target_sumrule, + refine, paralevel, rank, nr_processors); } // Scanning on an excited state defined by a set of Ix2: - void Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, string defaultScanStatename, - int iKmin, int iKmax, int Max_Secs, DP target_sumrule, bool refine, - int paralevel, Vect rank, Vect nr_processors) + Scan_Info Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, string defaultScanStatename, + int iKmin, int iKmax, int Max_Secs, DP target_sumrule, bool refine, + int paralevel, Vect rank, Vect nr_processors) { // This function is as Scan_LiebLin for generic T defined above, except that the // averaging is now done on a state defined by AveragingStateIx2 @@ -1024,30 +1020,28 @@ namespace ABACUS { DP kBT = 0.0; // Perform the scan: - General_Scan (whichDSF, iKmin, iKmax, 100000000, kBT, AveragingState, SeedScanState, defaultScanStatename, - Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors); - - return; - + return General_Scan (whichDSF, iKmin, iKmax, 100000000, kBT, + AveragingState, SeedScanState, defaultScanStatename, + Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors); } // Simplified function call of the above: - void Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, string defaultScanStatename, - int iKmin, int iKmax, int Max_Secs, DP target_sumrule, bool refine) + Scan_Info Scan_LiebLin (char whichDSF, LiebLin_Bethe_State AveragingState, string defaultScanStatename, + int iKmin, int iKmax, int Max_Secs, DP target_sumrule, bool refine) { int paralevel = 0; Vect rank(0,1); Vect nr_processors(0,1); - Scan_LiebLin (whichDSF, AveragingState, defaultScanStatename, iKmin, iKmax, Max_Secs, - target_sumrule, refine, paralevel, rank, nr_processors); - - return; + return Scan_LiebLin (whichDSF, AveragingState, defaultScanStatename, iKmin, iKmax, Max_Secs, + target_sumrule, refine, paralevel, rank, nr_processors); } // Scanning on a previously-defined AveragingState - void Scan_Heis (char whichDSF, XXZ_Bethe_State& AveragingState, string defaultScanStatename, int iKmin, int iKmax, - int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect rank, Vect nr_processors) + Scan_Info Scan_Heis (char whichDSF, XXZ_Bethe_State& AveragingState, string defaultScanStatename, + int iKmin, int iKmax, + int Max_Secs, DP target_sumrule, bool refine, + int paralevel, Vect rank, Vect nr_processors) { // General state scanning for Heisenberg chains @@ -1070,8 +1064,10 @@ namespace ABACUS { } // Scanning on a previously-defined AveragingState - void Scan_Heis (char whichDSF, XXX_Bethe_State& AveragingState, string defaultScanStatename, int iKmin, int iKmax, - int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect rank, Vect nr_processors) + Scan_Info Scan_Heis (char whichDSF, XXX_Bethe_State& AveragingState, string defaultScanStatename, + int iKmin, int iKmax, + int Max_Secs, DP target_sumrule, bool refine, + int paralevel, Vect rank, Vect nr_processors) { // General state scanning for Heisenberg chains @@ -1088,14 +1084,16 @@ namespace ABACUS { else ABACUSerror("Unknown whichDSF in Scan_Heis."); // Now the scan itself - General_Scan (whichDSF, iKmin, iKmax, AveragingState.chain.Nsites, 0.0, AveragingState, SeedScanState, - defaultScanStatename, Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors); + return General_Scan (whichDSF, iKmin, iKmax, AveragingState.chain.Nsites, 0.0, AveragingState, SeedScanState, + defaultScanStatename, Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors); } // Scanning on a previously-defined AveragingState - void Scan_Heis (char whichDSF, XXZ_gpd_Bethe_State& AveragingState, string defaultScanStatename, int iKmin, int iKmax, - int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect rank, Vect nr_processors) + Scan_Info Scan_Heis (char whichDSF, XXZ_gpd_Bethe_State& AveragingState, string defaultScanStatename, + int iKmin, int iKmax, + int Max_Secs, DP target_sumrule, bool refine, + int paralevel, Vect rank, Vect nr_processors) { // General state scanning for Heisenberg chains @@ -1112,14 +1110,15 @@ namespace ABACUS { else ABACUSerror("Unknown whichDSF in Scan_Heis."); // Now the scan itself - General_Scan (whichDSF, iKmin, iKmax, AveragingState.chain.Nsites, 0.0, AveragingState, SeedScanState, - defaultScanStatename, Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors); + return General_Scan (whichDSF, iKmin, iKmax, AveragingState.chain.Nsites, 0.0, AveragingState, SeedScanState, + defaultScanStatename, Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors); } - void Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, - int Max_Secs, DP target_sumrule, bool refine, int paralevel, Vect rank, Vect nr_processors) + Scan_Info Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, + int Max_Secs, DP target_sumrule, bool refine, + int paralevel, Vect rank, Vect nr_processors) { // This function scans the Hilbert space of the Heisenberg spin-1/2 chain // for the function identified by whichDSF. @@ -1190,25 +1189,24 @@ namespace ABACUS { else ABACUSerror("Unknown whichDSF in Scan_Heis."); // Now the scan itself - General_Scan (whichDSF, iKmin, iKmax, N, 0.0, GroundState, SeedScanState, "", - Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors); + return General_Scan (whichDSF, iKmin, iKmax, N, 0.0, GroundState, SeedScanState, "", + Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors); } else ABACUSerror("Delta out of range in Heis_Structure_Factor"); - return; + return Scan_Info(); } - void Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, - int Max_Secs, DP target_sumrule, bool refine) + Scan_Info Scan_Heis (char whichDSF, DP Delta, int N, int M, int iKmin, int iKmax, + int Max_Secs, DP target_sumrule, bool refine) { int paralevel = 0; Vect rank(0,1); Vect nr_processors(0,1); - Scan_Heis (whichDSF, Delta, N, M, iKmin, iKmax, Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors); - - return; + return Scan_Heis (whichDSF, Delta, N, M, iKmin, iKmax, + Max_Secs, target_sumrule, refine, paralevel, rank, nr_processors); } diff --git a/src/UTILS/Data_File_Name.cc b/src/UTILS/Data_File_Name.cc index 03b4514..cb4fa59 100644 --- a/src/UTILS/Data_File_Name.cc +++ b/src/UTILS/Data_File_Name.cc @@ -33,9 +33,9 @@ namespace ABACUS { { name << "LiebLin_"; if (whichDSF == 'Z') name << "Z"; - else if (whichDSF == 'd') name << "Rho_Rho"; - else if (whichDSF == 'g') name << "Psi_Psidag"; - else if (whichDSF == 'o') name << "Psidag_Psi"; + else if (whichDSF == 'd') name << "rho-rho"; + else if (whichDSF == 'g') name << "psi-psidag"; + else if (whichDSF == 'o') name << "psidag-psi"; else if (whichDSF == 'q') name << "GeomQuench"; else if (whichDSF == '1') name << "Type_I_Exp_Data"; else if (whichDSF == 'B') name << "BECg2"; @@ -58,9 +58,9 @@ namespace ABACUS { { name << "LiebLin_"; if (whichDSF == 'Z') name << "Z"; - else if (whichDSF == 'd') name << "Rho_Rho"; - else if (whichDSF == 'g') name << "Psi_Psidag"; - else if (whichDSF == 'o') name << "Psidag_Psi"; + else if (whichDSF == 'd') name << "rho-rho"; + else if (whichDSF == 'g') name << "psi-psidag"; + else if (whichDSF == 'o') name << "psidag-psi"; else if (whichDSF == 'q') name << "GeomQuench"; else if (whichDSF == '1') name << "Type_I_Exp_Data"; else if (whichDSF == 'B') name << "BECg2";