cluster changes WDM part 1

This commit is contained in:
Silas Oettinghaus
2025-09-17 14:39:32 +02:00
parent 4099f6820f
commit f543194c08

View File

@@ -1,5 +1,12 @@
%%% Run parameters
% TX
% --- FIRST LINE: evaluate settings located beside this script ---
run(fullfile(fileparts(mfilename('fullpath')),'WDM_settings.m'));
% optional: size local parpool from Slurm allocation (minimal, no arrays)
cpus = str2double(getenv('SLURM_CPUS_PER_TASK'));
if ~isfinite(cpus) || cpus < 1, cpus = max(1, feature('numcores')); end
p = gcp('nocreate'); if isempty(p), parpool('local', cpus); end
M = 4;
m = floor(log2(M)*10)/10;
@@ -218,6 +225,42 @@ for realiz = 1:num_realiz
end
res = struct(); % placeholder
res.gmi_vnle_bitwise = gmi_vnle_bitwise; % placeholder
res.snr_vnle = snr_vnle;
res.ber_vnle = ber_vnle;
% ---------------------------------------------
% result filename (timestamp + optional job id)
t = datetime('now','TimeZone','local','Format','yyyyMMdd_HHmmss');
jobid = getenv('SLURM_JOB_ID'); if isempty(jobid), jobid = 'nojid'; end
host = getenv('HOSTNAME'); if isempty(host), host = 'localhost'; end
% Output directory depends on platform
if ispc
output_root = fullfile('C:\Users\Silas\Documents\MATLAB\Datensätze\FWM_2025\');
else
output_root = '/work_beegfs/sutef391/results_WDM';
end
if ~exist(output_root,'dir'), mkdir(output_root); end
% Build filename
t = datetime('now','TimeZone','local','Format','yyyyMMdd_HHmmss');
jobid = getenv('SLURM_JOB_ID'); if isempty(jobid), jobid = 'nojid'; end
host = getenv('HOSTNAME'); if isempty(host), host = 'localhost'; end
fname = sprintf('WDM_%s_%s_%s.mat', char(t), host, jobid);
% Save results
save(fullfile(output_root, fname), 'res', '-v7.3');
fprintf('Saved results to: %s\n', fullfile(output_root, fname));
figure();hold on;
cols = linspecer(N);
for l = 1:N