Skip to content

Commit

Permalink
Add a SLURM-array aware script for DMFT 2D phase diagrams
Browse files Browse the repository at this point in the history
It reads the array task id via getenv(), and converts the result to double.
If the resulting number is not a NaN (i.e. if the env variable is defined),
it avoid looping over all spin-orbit coupling values and just computes the
line selected by slurm.

The called fixed-SO lines are of 'dry' type, in the runDMFT sense.
  • Loading branch information
beddalumia committed Apr 26, 2022
1 parent cc0f13b commit fd2f45e
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions KMH-DMFT/KMH-DMFT_mat/DMFT_grid.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
driver = 'ed_kane_mele_AFMxy';
doMPI = true;

% SETUP ARRAY OF SOI VALUES
spin_orbit = linspace(0,0.3,10);
Nsoi = length(spin_orbit);

% GET SLURM ARRAY TASK ID (if undefined would be NaN)
aID = str2double(getenv('SLURM_ARRAY_TASK_ID'));

if isnan(aID)
% COMPUTE ALL SOI LINES -> 1:Nsoi
iSTART = 1;
iSTOP = Nsoi;
else
% COMPUTE SOI(aID) ONLY -> aID:aID
iSTART = aID;
iSTOP = aID;
end

%% SOC-Line: outer loop %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for iSOI = iSTART:iSTOP

SOI = spin_orbit(iSOI); % Input Spin-Orbit

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

copyfile ../input* % Copy inside the **external** input file

%% Phase-Line: inner loop %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Uold = NaN; % Restart point
Umin = 0.00; % Phase-line iSTART
Ustep = 0.10; % Phase-line step
Umax = 10.0; % Phase-line end

runDMFT.dry_line(driver,doMPI,Uold,Umin,Ustep,Umax,'t2',SOI,'wmixing',0.25);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

cd .. % Exit the SOI-folder

end

0 comments on commit fd2f45e

Please sign in to comment.