Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use process unique file naming for kwave files #234

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,26 @@
datacast = 'single';
end

% Extract the filename from the optical path, add the current time in milliseconds,
% and add the process id to make the filename unique

% Extract basename from the optical path
[~, basename, ~] = fileparts(optical_path);

% Get current time in HH-mm-ss-SSS format
date_str = char(datetime('now', 'Format', 'HH-mm-ss-SSS'));

% Get the process id
pid = feature('GetPid');

% Construct the unique temporary path name
tmp_path_name = sprintf('kwave__%s__%s__%d', basename, date_str, pid);

input_args = {'DataCast', datacast, 'PMLInside', settings.pml_inside, ...
'PMLAlpha', settings.pml_alpha, 'PMLSize', 'auto', ...
'PlotPML', settings.plot_pml, 'RecordMovie', settings.record_movie, ...
'MovieName', settings.movie_name, 'PlotScale', [-1, 1], 'LogScale', settings.acoustic_log_scale, ...
'Smooth', p0_smoothing};
'Smooth', p0_smoothing, 'DataName', tmp_path_name};

if settings.gpu == true
time_series_data = kspaceFirstOrder2DG(kgrid, medium, source, sensor, input_args{:});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,26 @@
datacast = 'single';
end

% Extract the filename from the optical path, add the current time in milliseconds,
% and add the process id to make the filename unique

% Extract basename from the optical path
[~, basename, ~] = fileparts(optical_path);

% Get current time in HH-mm-ss-SSS format
date_str = char(datetime('now', 'Format', 'HH-mm-ss-SSS'));

% Get the process id
pid = feature('GetPid');

% Construct the unique temporary path name
tmp_path_name = sprintf('kwave__%s__%s__%d', basename, date_str, pid);

input_args = {'DataCast', datacast, 'PMLInside', settings.pml_inside, ...
'PMLAlpha', double(settings.pml_alpha), 'PMLSize', 'auto', ...
'PlotPML', settings.plot_pml, 'RecordMovie', settings.record_movie, ...
'MovieName', settings.movie_name, 'PlotScale', [-1, 1], 'LogScale', settings.acoustic_log_scale, ...
'Smooth', p0_smoothing};
'Smooth', p0_smoothing, 'DataName', tmp_path_name};

if settings.gpu == true
time_series_data = kspaceFirstOrder3DG(kgrid, medium, source, sensor, input_args{:});
Expand Down
Loading