diff --git a/KMH-DMFT/KMH-DMFT_hpc/full-mpi_single-line_matjob.sh b/KMH-DMFT/KMH-DMFT_hpc/full-mpi_single-line_matjob.sh index 252eebf..cee5cf2 100644 --- a/KMH-DMFT/KMH-DMFT_hpc/full-mpi_single-line_matjob.sh +++ b/KMH-DMFT/KMH-DMFT_hpc/full-mpi_single-line_matjob.sh @@ -80,11 +80,11 @@ cd $SLURM_SUBMIT_DIR # Brings the shell into the directory from which you’ve s # Just fill this part as if it was a regular Bash script that you want to # run on your computer. # -# >> DMFT-Workflow -#matlab -batch KMH-DMFT_dry #----------------- -#matlab -batch KMH-DMFT_autostop # Uncomment just -#matlab -batch KMH-DMFT_autostep # one of these... -#matlab -batch KMH-DMFT_refresh #----------------- +# >> DMFT-Workflow (uncomment just one of these...) +matlab -batch "runDMFT.dry_line('ed_kane_mele',true,-1,0,0.5,8,'t2',0.1)" +matlab -batch "runDMFT.autostop_line('ed_kane_mele',true,-1,0,0.5,8,'t2',0.1)" +matlab -batch "runDMFT.autostep_line('ed_kane_mele',true,-1,0,8,'t2',0.1)" +matlab -batch RunningDMFT_refresh # runDMFT.refresh_line() in progress... # # # ==== END OF JOB COMMANDS ===== # diff --git a/KMH-DMFT/KMH-DMFT_hpc/mpi-serial_single-line_matjob.sh b/KMH-DMFT/KMH-DMFT_hpc/mpi-serial_single-line_matjob.sh index b4b31c3..3ff2ddb 100644 --- a/KMH-DMFT/KMH-DMFT_hpc/mpi-serial_single-line_matjob.sh +++ b/KMH-DMFT/KMH-DMFT_hpc/mpi-serial_single-line_matjob.sh @@ -80,11 +80,11 @@ cd $SLURM_SUBMIT_DIR # Brings the shell into the directory from which you’ve s # Just fill this part as if it was a regular Bash script that you want to # run on your computer. # -# >> DMFT-Workflow -#matlab -batch KMH-DMFT_dry #----------------- -#matlab -batch KMH-DMFT_autostop # Uncomment just -#matlab -batch KMH-DMFT_autostep # one of these... -#matlab -batch KMH-DMFT_refresh #----------------- +# >> DMFT-Workflow (uncomment just one of these...) +matlab -batch "runDMFT.dry_line('ed_kane_mele',true,-1,0,0.5,8,'t2',0.1)" +matlab -batch "runDMFT.autostop_line('ed_kane_mele',true,-1,0,0.5,8,'t2',0.1)" +matlab -batch "runDMFT.autostep_line('ed_kane_mele',true,-1,0,8,'t2',0.1)" +matlab -batch RunningDMFT_refresh # runDMFT.refresh_line() in progress... # # # ==== END OF JOB COMMANDS ===== # diff --git a/KMH-DMFT/KMH-DMFT_mat/PostDMFT/DMFTenergies.m b/KMH-DMFT/KMH-DMFT_mat/DMFTenergies.m similarity index 100% rename from KMH-DMFT/KMH-DMFT_mat/PostDMFT/DMFTenergies.m rename to KMH-DMFT/KMH-DMFT_mat/DMFTenergies.m diff --git a/KMH-DMFT/KMH-DMFT_mat/PostDMFT/PlotDMFT.m b/KMH-DMFT/KMH-DMFT_mat/PlotDMFT.m similarity index 100% rename from KMH-DMFT/KMH-DMFT_mat/PostDMFT/PlotDMFT.m rename to KMH-DMFT/KMH-DMFT_mat/PlotDMFT.m diff --git a/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/README.md b/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/README.md deleted file mode 100644 index 7b837c2..0000000 --- a/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# RunningDMFT -Running QcmPlab DMFT codes from MATLAB - ----------- - -### Choose your favorite workflow: - -#### Production - -- `_dry.m` The most basic scenario: linear increase of U, no feedback, just some noninvasive check of convergence to flag out, _a posteriori_, which points should be discarded. - -- `_autostop.m` Basic linspace in U, without any feedback mechanism. Stops when dmft does not converge (to avoid wasting cpu-time). - -- `_autostep.m` Gradually increases U by feedback-controlled steps, i.e. if dmft does not converge the point is discarded and the step reduced. Self-mixing is fixed (but you might update it manually, on the flight). - - -#### Refinement - -- `_refresh.m` Systematically enters the folder structure of a pre-existent calculation and uses the given restart and input files to perform some additional dmft loops. Useful if something has been added to the driver. - -#### Testing & Setup - -- `_livemixing.m` Interactive-ish workflow: on-the-flight manual updates of the mixing ratio, while dmft waits for you (in a dumb way); Hubbard steps are inevitably fixed. - - -#### Work-in-Progress & To-Do - -- [ ] `_automixing.m` Automatic controll of self-mixing. Requires inspecting evolution of the dmft error, could be cumbersome. - -- [ ] `_ai.m` Automatic control of both self-mixing and Hubbard steps. Difficult for sure, maybe just not worth all the effort. - -- [ ] `_jobarray.m` Exploiting the array-env-variables provided by `SLURM` on HPC facilities. diff --git a/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_autostep.m b/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_autostep.m deleted file mode 100644 index 464ac8e..0000000 --- a/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_autostep.m +++ /dev/null @@ -1,112 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% HOW TO USE? -% -% - Put this script, together with an input-file for your driver in a path -% > This path will contain directories for all the U values you set-up. -% - Set-up the name of your driver program (without .f90 extension) -% > e.g. driver = 'ed_kane_mele'; -% - Set SOI to your desire: --> you will get a fixed-SOI linear span -% - Adjust Umin and Umax to your desire --> U \in [Umin, Umax] -% - Adjust Uold to catch a 'restart-folder' in the path [!applies -> -1] -% - Select doMPI (true.or.false) to run with openMPI or not -% - Run everything with $ matlab -batch RunningDMFT_autostep -% - At the end you will find some additional output in the U=%f folders -% > a LOG_dmft.txt which is just a mirror of the DMFT output (via tee) -% > a LOG_time.txt which is a wall-clock-time value for the whole DMFT -% - Also a additional output files in the main (external) path -% > a U_list.txt that stores all the used U-values (for easier post..) -% > possibly some error-flag files in the format 'ERROR_U=%f' -% if you see them you *may* have to discard the corresponding folder -% > check it for convergence! (look at LOG_dmft.txt) -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -driver = 'ed_kane_mele'; doMPI = true; - -% Let MATLAB see the goddamn PATH %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% --> works only if matlab has been started from a unix terminal! (0^0~~,) -path = getenv('PATH'); -path = [path ':/usr/local/bin']; -setenv('PATH', path) -clear path -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -Ulist = fopen('U_list.txt','a'); - -%% Phase-Line: single loop %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -SOI = 0; % Input Spin-Orbit -Umin = 0; Umax = 10; % Input Hubbard -Wmix = 0.3; % Input Self-Mixing - -Ustep = [0.5, 0.25, 0.1, 0.05, 0.01]; % To be auto-determined...hopefully! -NUstep = length(Ustep); - -notConvFlag = false; % Convergence-fail *flag* -notConvCount = 0; % Convergence-fail *counter* -notConvThreshold = NUstep-1; % Maximum #{times} we accept DMFT to fail - -U = Umin; Uold = -1; -while U <= Umax % Hubbard loop ~~~~~~~~~~~~~~~~~~~~~~~~~~~~> - -UDIR= sprintf('U=%f',U); % Make a folder named 'U=...', where '...' -mkdir(UDIR); % is the given value for Hubbard interaction -cd(UDIR); % Enter the U-folder - -oldDIR=sprintf('../U=%f',Uold); % ------------------------------------ -if isfolder(oldDIR) % If it exist a "previous" folder: -restartpack = [oldDIR,'/*.restart']; % Copy all the restart files from the -copyfile(restartpack); % last dmft evaluation... -end % ------------------------------------ - -copyfile ../input* % Copy inside the **external** input file - -%% Run FORTRAN code (already compiled and added to PATH!) %%%%%%%%%%%%%%%%% -if doMPI -mpi = 'mpirun '; % Control of MPI -else % boolean flag... -mpi = []; -end -HUBBARD =sprintf(' uloc=%f',U); % OVERRIDE -T2 =sprintf(' t2=%f',SOI); % of -MIXING = sprintf(' wmixing=%f',Wmix); % PARAMETERS -outLOG = ' > LOG_dmft.txt'; -dmft_ed_call = [mpi,driver,HUBBARD,T2,MIXING,outLOG]; -tic -system(dmft_ed_call); % Fortran-call -chrono = toc; -file_id = fopen('LOG_time.txt','w'); -fprintf(file_id,'%f\n', chrono); % Write on time-log -fclose(file_id); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% HERE WE CATCH A FAILED (unconverged) DMFT LOOP -if isfile('ERROR.README') - notConvFlag = true; - notConvCount = notConvCount + 1; - movefile('ERROR.README',sprintf('../ERROR_U=%f',U)); -else - fprintf(Ulist,'%f\n', U); % Write on U-log -end -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -cd .. % Exit the U-folder - - -if notConvCount > notConvThreshold - error('DMFT not converged: phase-span stops now!'); -end - -if notConvFlag == true - U = Uold; % if nonconverged we don't want to update - notConvFlag = false; % > but we want to reset the flag(!) -else - Uold = U; % if converged we update Uold and proceed to... -end - -U = U + Ustep(notConvCount+1); % ...Hubbard update - -end % <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -fclose(Ulist); diff --git a/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_autostop.m b/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_autostop.m deleted file mode 100644 index 8c60e22..0000000 --- a/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_autostop.m +++ /dev/null @@ -1,92 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% HOW TO USE? -% -% - Put this script, together with an input-file for your model, in a path -% > This path will contain directories for all the U values you set-up. -% - Set-up the name of your driver program (without .f90 extension) -% > e.g. driver = 'ed_kane_mele'; -% - Adjust Umin, Umax and Ustep to your desire --> U = Umin:Ustep:Umax -% - Set SOI to your desire: --> you will get a fixed-SOI linear span -% - Adjust Uold to catch a 'restart-folder' in the path [!applies -> -1] -% - Select doMPI (true.or.false) to run with openMPI or not -% - Run everything with $ matlab -batch RunningDMFT_autostop -% - At the end you will find some additional output in the U=%f folders -% > a LOG_dmft.txt which is just a mirror of the DMFT output (via tee) -% > a LOG_time.txt which is a wall-clock-time value for the whole DMFT -% - Also an additional output file in the main (external) path -% > a U_list.txt that stores all the used U-values (for easier post..) -% NB. Only the converged calculations will update the U_list :D -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -driver = 'ed_kane_mele'; doMPI = true; - -% Let MATLAB see the goddamn PATH %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% --> works only if matlab has been started from a unix terminal! (0^0~~,) -path = getenv('PATH'); -path = [path ':/usr/local/bin']; -setenv('PATH', path) -clear path -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -Ulist = fopen('U_list.txt','a'); - -%% Phase-Line: single loop %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -SOI = 0; % Input Spin-Orbit -Umin = 1; Umax = 10; % Input Hubbard -Ustep = 0.25; % Phase-line step -Uold = -1; % Restart option - -U = Umin; -while U <= Umax % Hubbard loop ~~~~~~~~~~~~~~~~~~~~~~~~~~~~> - -UDIR= sprintf('U=%f',U); % Make a folder named 'U=...', where '...' -mkdir(UDIR); % is the given value for Hubbard interaction -cd(UDIR); % Enter the U-folder - -oldDIR=sprintf('../U=%f',Uold); % ------------------------------------ -if isfolder(oldDIR) % If it exist a "previous" folder: -restartpack = [oldDIR,'/*.restart']; % Copy all the restart files from the -copyfile(restartpack); % last dmft evaluation... -end % ------------------------------------ - -copyfile ../input* % Copy inside the **external** input file - -%% Run FORTRAN code (already compiled and added to PATH!) %%%%%%%%%%%%%%%%% -if doMPI -mpi = 'mpirun '; % Control of MPI -else % boolean flag... -mpi = []; -end -HUBBARD =sprintf(' uloc=%f',U); % OVERRIDE of -T2 =sprintf(' t2=%f',SOI); % PARAMETERS -outLOG = ' > LOG_dmft.txt'; -dmft_ed_call = [mpi,driver,HUBBARD,T2,outLOG]; -tic -system(dmft_ed_call); % Fortran-call -chrono = toc; -file_id = fopen('LOG_time.txt','w'); % Write on time-log -fprintf(file_id,'%f\n', chrono); -fclose(file_id); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% HERE WE CATCH A FAILED (unconverged) DMFT LOOP -if isfile('ERROR.README') - fclose(Ulist); % U-list stops here - error('DMFT not converged: phase-span stops now!') -end -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -cd .. % Exit the U-folder - -fprintf(Ulist,'%f\n', U); % Write on U-log - -Uold = U; -U = U + Ustep; % Hubbard update - -end % <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -fclose(Ulist); - diff --git a/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_dry.m b/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_dry.m deleted file mode 100644 index 2d128d7..0000000 --- a/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_dry.m +++ /dev/null @@ -1,89 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% HOW TO USE? -% -% - Put this script, together with an input-file for your model, in a path -% > This path will contain directories for all the U values you set-up. -% - Set-up the name of your driver program (without .f90 extension) -% > e.g. driver = 'ed_kane_mele'; -% - Adjust Umin, Umax and Ustep to your desire --> U = Umin:Ustep:Umax -% - Set SOI to your desire: --> you will get a fixed-SOI linear span -% - Adjust Uold to catch a 'restart-folder' in the path [!applies -> -1] -% - Select doMPI (true.or.false) to run with openMPI or not -% - Run everything with $ matlab -batch RunningDMFT_dry -% - At the end you will find some additional output in the U=%f folders -% > a LOG_dmft.txt which is just a mirror of the DMFT output (via tee) -% > a LOG_time.txt which is a wall-clock-time value for the whole DMFT -% - Also an additional output file in the main (external) path -% > a U_list.txt that stores all the used U-values (for easier post..) -% NB. Only the converged calculations will update the U_list :D -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -driver = 'ed_kane_mele'; doMPI = false; - -% Let MATLAB see the goddamn PATH %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% --> works only if matlab has been started from a unix terminal! (0^0~~,) -path = getenv('PATH'); -path = [path ':/usr/local/bin']; -setenv('PATH', path) -clear path -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -Ulist = fopen('U_list.txt','a'); - -%% Phase-Line: single loop %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -SOI = 0; % Input Spin-Orbit -Umin = 1; Umax = 10; % Input Hubbard -Ustep = 0.25; % Phase-line step -Uold = -1; % Restart option - -U = Umin; -while U <= Umax % Hubbard loop ~~~~~~~~~~~~~~~~~~~~~~~~~~~> - -UDIR= sprintf('U=%f',U); % Make a folder named 'U=...', where '...' -mkdir(UDIR); % is the given value for Hubbard interaction -cd(UDIR); % Enter the U-folder - -oldDIR=sprintf('../U=%f',Uold); % ------------------------------------ -if isfolder(oldDIR) % If it exist a "previous" folder: -restartpack = [oldDIR,'/*.restart']; % Copy all the restart files from the -copyfile(restartpack); % last dmft evaluation... -end % ------------------------------------ - -copyfile ../input* % Copy inside the **external** input file - -%% Run FORTRAN code (already compiled and added to PATH!) %%%%%%%%%%%%%%%%% -if doMPI -mpi = 'mpirun '; % Control of MPI -else % boolean flag... -mpi = []; -end -HUBBARD =sprintf(' uloc=%f',U); % OVERRIDE of -T2 =sprintf(' t2=%f',SOI); % PARAMETERS -outLOG = ' > LOG_dmft.txt'; -dmft_ed_call = [mpi,driver,HUBBARD,T2,outLOG]; -tic -system(dmft_ed_call); % Fortran-call -chrono = toc; -file_id = fopen('LOG_time.txt','w'); % Write on time-log -fprintf(file_id,'%f\n', chrono); -fclose(file_id); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% HERE WE CATCH A FAILED (unconverged) DMFT LOOP -if ~isfile('ERROR.README') - fprintf(Ulist,'%f\n', U); % Update U-list (only if converged) -end -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -cd .. % Exit the U-folder - -Uold = U; -U = U + Ustep; % Hubbard update - -end % <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -fclose(Ulist); - diff --git a/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_livemixing.m b/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_livemixing.m deleted file mode 100644 index c80ee37..0000000 --- a/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_livemixing.m +++ /dev/null @@ -1,113 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% HOW TO USE? -% -% - Put this script, together with an input-file for your driver in a path -% > This path will contain directories for all the U values you set-up. -% - Set-up the name of your driver program (without .f90 extension) -% > e.g. driver = 'ed_kane_mele'; -% - Adjust Umin, Umax and Ustep to your desire --> U = Umin:Ustep:Umax -% - Set SOI to your desire: --> you will get a fixed-SOI linear span -% - Adjust Uold to catch a 'restart-folder' in the path [!applies -> -1] -% - Adjust notConvThreshold to control how much DMFT will wait for you (!) -% - Select doMPI (true.or.false) to run with openMPI or not -% - Run everything with $ matlab -batch RunningDMFT_livemixing -% - Once in a while control for the presence of ERROR.README in the path -% > If you see it, DMFT is not converging; you might want to inspect the -% the output files and update wmixing in the **external** input-file -% to a suitable value. At the next run DMFT will catch the update ;) -% - At the end you will find some additional output in the U=%f folders -% > a LOG_dmft.txt which is just a mirror of the DMFT output (via tee) -% > a LOG_time.txt which is a wall-clock-time value for the whole DMFT -% - Also an additional output file in the main (external) path -% > a U_list.txt that stores all the used U-values (for easier post..) -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -driver = 'ed_kane_mele'; doMPI = false; - -% Let MATLAB see the goddamn PATH %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% --> works only if matlab has been started from a unix terminal! (0^0~~,) -path = getenv('PATH'); -path = [path ':/usr/local/bin']; -setenv('PATH', path) -clear path -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -Ulist = fopen('U_list.txt','a'); - -%% Phase-Line: single loop %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -SOI = 0; % Input Spin-Orbit -Umin = 1; Umax = 10; % Input Hubbard -Ustep = 0.25; % Hubbard updates - -notConverged = 0; % Convergence-fail *counter* -notConvThreshold = 5; % Maximum #{times} we accept DMFT to fail -% ----------------------------> Available time to change wmix on the flight - -U = Umin; Uold = -1; -doUpdate = true; -while U <= Umax % Hubbard loop ~~~~~~~~~~~~~~~~~~~~~~~~~~~~> - -UDIR= sprintf('U=%f',U); % Make a folder named 'U=...', where '...' -mkdir(UDIR); % is the given value for Hubbard interaction -cd(UDIR); % Enter the U-folder - -oldDIR=sprintf('../U=%f',Uold); % ------------------------------------ -if isfolder(oldDIR) % If it exist a "previous" folder: -restartpack = [oldDIR,'/*.restart']; % Copy all the restart files from the -copyfile(restartpack); % last dmft evaluation... -end % ------------------------------------ - -copyfile ../input* % Copy inside the **external** input file - -%% Run FORTRAN code (already compiled and added to PATH!) %%%%%%%%%%%%%%%%% -if doMPI -mpi = 'mpirun '; % Control of MPI -else % boolean flag... -mpi = []; -end -HUBBARD =sprintf(' uloc=%f',U); % OVERRIDE of -T2 =sprintf(' t2=%f',SOI); % PARAMETERS -outLOG = ' | tee LOG_dmft.txt'; -dmft_ed_call = [mpi,driver,HUBBARD,T2,outLOG]; -tic -system(dmft_ed_call); % Fortran-call -chrono = toc; -file_id = fopen('LOG_time.txt','w'); -fprintf(file_id,'%f\n', chrono); % Write on time-log -fclose(file_id); -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% HERE WE CATCH A FAILED (unconverged) DMFT LOOP -if isfile('ERROR.README') - notConverged = notConverged + 1; - movefile('ERROR.README','../ERROR.README'); -else - fprintf(Ulist,'%f\n', U); % Write on U-log -end -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -cd .. % Exit the U-folder - - -if notConverged > notConvThreshold - error('DMFT not converged: phase-span stops now!') -elseif notConverged > 0 && notConverged < notConvThreshold - % You manage *the mixing* manually, by modifying on-the-flight - % the **external** input-file at runtime. Very effective when feasible. - doUpdate = false % -------------------> So you don't want to update... -end - -if doUpdate - Uold = U; - U = U + Ustep % Hubbard update -else - U = Uold + Ustep % old-Hubbard update (if nonconverged!) -end - -end % <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -fclose(Ulist); - diff --git a/KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_refresh.m b/KMH-DMFT/KMH-DMFT_mat/RunningDMFT_refresh.m similarity index 100% rename from KMH-DMFT/KMH-DMFT_mat/RunningDMFT/RunningDMFT_refresh.m rename to KMH-DMFT/KMH-DMFT_mat/RunningDMFT_refresh.m diff --git a/KMH-DMFT/KMH-DMFT_mat/PostDMFT/PostDMFT.m b/KMH-DMFT/KMH-DMFT_mat/postDMFT.m similarity index 100% rename from KMH-DMFT/KMH-DMFT_mat/PostDMFT/PostDMFT.m rename to KMH-DMFT/KMH-DMFT_mat/postDMFT.m