Rework catalogue building
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 <omp.h>
|
||||
#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<int> 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);
|
||||
}
|
||||
+45
-47
@@ -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<int> rank, Vect<int> 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<int> rank, Vect<int> 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<int> rank(0,1);
|
||||
Vect<int> 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<int> rank, Vect<int> 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<int> rank, Vect<int> 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<int> rank(0,1);
|
||||
Vect<int> 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<int> rank, Vect<int> 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<int> rank, Vect<int> 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<int> rank, Vect<int> 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<int> rank, Vect<int> 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<int> rank, Vect<int> 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<int> rank, Vect<int> 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<int> rank, Vect<int> 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<int> rank, Vect<int> 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<int> rank(0,1);
|
||||
Vect<int> 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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user