Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.
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
3 changes: 3 additions & 0 deletions psom_build_dependencies.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@
num_out = num_all(length(cell_in)+1:length(cell_in)+length(cell_out));
num_clean = num_all(length(cell_in)+length(cell_out)+1:length(num_all));
nb_files = max(num_all);
if isempty(nb_files)
nb_files = 0;
end
clear num_all val_tmp ind_tmp

%% Build adjacency matrices for jobs x files
Expand Down
3 changes: 3 additions & 0 deletions psom_manager.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
error('Could not find the pipeline file %s. Please use psom_run_pipeline instead of psom_manager directly.',file_jobs);
end

% pause for ten second in case workers are not ready yet.
pause(30);

% a try/catch block is used to clean temporary file if the user is
% interrupting the pipeline of if an error occurs
try
Expand Down
2 changes: 1 addition & 1 deletion psom_pipeline_init.m
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@
end

path_work = path_search;
save(file_pipeline,'history','graph_deps','list_jobs','files_in','files_out','path_work')
save(file_pipeline,'history','graph_deps','list_jobs','files_in','files_out','path_work', '-mat')

%% Save the status
if flag_verbose>1
Expand Down
18 changes: 11 additions & 7 deletions psom_run_script.m
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
instr_job = sprintf('%sexit\n',instr_job);
end
end

instr_job = sprintf('#!/bin/sh\n%s',instr_job);
%% Write the script
if ~strcmp(opt.mode,'session')
if opt.flag_debug
Expand Down Expand Up @@ -404,13 +404,15 @@
% There might be a better way to find the job path and id,
% however, I do not know the code well
% enough at that point.
result_path = regexp(script,'(^.*)/logs','tokens'){1}{1};
agent_id = regexp(script,'psom_*(\w*)','tokens'){1}{1};
result_path = regexp(script,'(^.*)/logs','tokens');
result_path = result_path{1}{1};
agent_id = regexp(script,'psom_*(\w*)','tokens');
agent_id = agent_id{1}{1};
instr_cbrain = sprintf('%s %s %s', sub, result_path, agent_id);

% Check the max number of worker per node
% This will start ppn worker per node
psom_ppn = getenv("PSOM_WORKER_PPN")
psom_ppn = getenv('PSOM_WORKER_PPN')
if psom_ppn
file_conf = [result_path '/logs/PIPE_config.mat'];
pipe_opt = load(file_conf);
Expand Down Expand Up @@ -443,8 +445,10 @@
script = [' SPLIT_LINE singularity_exec_options'];
% There might be a better way to find the job path and id, however, I do not know the code well
% enough at that point.
result_path = regexp(opt.path_search,'(^.*)/logs','tokens'){1}{1};
agent_id = regexp(opt.name_job,'psom_*(\w*)','tokens'){1}{1};
result_path = regexp(opt.path_search,'(^.*)/logs','tokens');
result_path = result_path{1}{1};
agent_id = regexp(opt.name_job,'psom_*(\w*)','tokens');
agent_id = agent_id{1}{1};

if ~isempty(logs)
qsub_logs = [' -e ' logs.eqsub ' -o ' logs.oqsub ' '];
Expand All @@ -461,7 +465,7 @@
, sub, name_job ,qsub_logs, opt.qsub_options ...
, script , opt.singularity_image ,result_path, agent_id );

psom_ppn = getenv("PSOM_WORKER_PPN")
psom_ppn = getenv('PSOM_WORKER_PPN')
if psom_ppn
file_conf = [result_path '/logs/PIPE_config.mat'];
pipe_opt = load(file_conf);
Expand Down