-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #2 touches the MF-running scripts [+ polish on DMFT-SLURM scripts] Some bugs have been fixed at beddalumia/QcmP-LAB@856ab5e and now we can say that every MF script runs smoothly (single-line, full-diagram, phase maps, energy surfaces!) --------- We are ready to attack the nasty plotting scripts now (by extending the +plotDMFT package within DMFT-LAB) 🚀
- Loading branch information
1 parent
72d9cdb
commit c0a9410
Showing
4 changed files
with
38 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,32 @@ | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
%% 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 DryMF_line | ||
% - At the end you will find some additional output in the U=%f folders | ||
% > a LOG_mf.txt which is just a mirror of the MF output (via tee) | ||
% > a LOG_time.txt which is a wall-clock-time value for the whole MF | ||
% - 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 = 'mf_km_2d'; 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'); | ||
|
||
%% SOC-Line: outer loop %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
driver = 'mf_km_2d'; | ||
doMPI = false; % >> MF-code is not MPI-safe << | ||
|
||
spin_orbit = [0,0.02,0.04,0.06,0.08,0.1,0.2,0.3]; | ||
Nsoi = length(spin_orbit); | ||
for iSOI = 1:Nsoi % Spin-Orbit loop =========================> | ||
Nopms = 4; % #{order parameters} | ||
|
||
SOI = spin_orbit(iSOI); % Input Spin-Orbit | ||
%% SOC-Line: outer loop %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
for iSOI = 1:Nsoi | ||
|
||
soiDIR= sprintf('SOI=%f',SOI); % Make a folder named 'SOI=...', where '...' | ||
mkdir(soiDIR); % is the given value for SpinOrb interaction | ||
cd(soiDIR); % Enter the SOI-folder | ||
SOI = spin_orbit(iSOI); % Input Spin-Orbit | ||
|
||
copyfile ../input* % Copy inside the **external** input file | ||
soiDIR= sprintf('SOI=%f',SOI); % Make a folder named 'SOI=...', where '...' | ||
mkdir(soiDIR); % is the given value for SpinOrb interaction | ||
cd(soiDIR); % Enter the SOI-folder | ||
|
||
%% Phase-Line: inner loop %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
copyfile ../input* % Copy inside the **external** input file | ||
|
||
Umin = 0; Umax = 8; % Input Hubbard | ||
Ustep = 0.1; % Phase-line step | ||
Uold = -1; % Restart option | ||
%% Phase-Line: inner loop %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
U = Umin; | ||
while U <= Umax % Hubbard loop ~~~~~~~~~~~~~~~~~~~~~~~~~~~> | ||
Uold = NaN; % Restart point | ||
Umin = 0.00; % Phase-line start | ||
Ustep = 0.25; % Phase-line step | ||
Umax = 8.00; % Phase-line end | ||
|
||
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 | ||
runDMFT.dry_line(driver,doMPI,Uold,Umin,Ustep,Umax,'t2',SOI,'nparams',Nopms); | ||
|
||
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 mf evaluation... | ||
end % ------------------------------------ | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
copyfile ../input* % Copy inside the **external** input file | ||
cd .. % Exit the SOI-folder | ||
|
||
%% 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.mf'; | ||
mf_call = [mpi,driver,HUBBARD,T2,outLOG]; | ||
tic | ||
system(mf_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) MF 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 % <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
cd .. % Exit the SOI-folder | ||
|
||
end % <========================================= | ||
|
||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
fclose(Ulist); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters