Why did the parallel computing’s task return the state of failure?
%% para
ttest = struct;
htype = {‘h_gyr’, ‘h_sul’};
dtype = {‘d_gyr’, ‘d_sul’};
ptype = {‘p_gyr’, ‘p_sul’};
ttype = {‘t_gyr’, ‘t_sul’};
ztype = {‘z_gyr’, ‘z_sul’};
Dtype = {‘BD’, ‘MDD’, ‘SCH’};
morp = {‘depth’,’fractaldimension’,’gyrification’,’thickness’};
times = 10000;
load dataedge_rmcov.mat
%% obtain t and p
% disease type
for idtype = 2:length(Dtype)
ttest(idtype).name = Dtype{idtype};
% sites
for isite = 1:length(covariate(idtype).d_gyr(:,1))
for itype = 1:length(dtype) %network type
% obtain value T and value P
% [tmp_t, tmp_p] = gretna_permutation_ttest(covariate(idtype).(dtype{itype}){isite, imor}, …
% covariate(idtype).(htype{itype}){isite, imor}, times); % T-test
% % create parallel task to perform the ttest
% % divide to four parallel task(SD, FD, GI, CT)
clu = parcluster();
job = createJob(clu);
task = createTask(job, @gretna_permutation_ttest,2, { …
{covariate(idtype).(htype{itype}){isite, 1},covariate(idtype).(dtype{itype}){isite, 1},times}, …
{covariate(idtype).(htype{itype}){isite, 2},covariate(idtype).(dtype{itype}){isite, 2},times}, …
{covariate(idtype).(htype{itype}){isite, 3},covariate(idtype).(dtype{itype}){isite, 3},times}, …
{covariate(idtype).(htype{itype}){isite, 4},covariate(idtype).(dtype{itype}){isite, 4},times} …
});
submit(job);
wait(job);
res = fetchOutputs(job); % result of four morphological networks for one site of G-G or S-S network’s edges
for imor = 1:length(morp) % save data to each morphological network
% save t and p
ttest(idtype).(ttype{itype}){isite, imor} = res{imor,1}.real;
ttest(idtype).(ptype{itype}){isite, imor} = res{imor,2};
% p->z
for i = 1:length(ttest(idtype).p_gyr{isite, imor}(1,:))
p = ttest(idtype).(ptype{itype}){isite, imor}(:, i);
z = icdf(‘Normal’, 1-(p/2), 0, 1);
t = ttest(idtype).(ttype{itype}){isite, imor}(:, i);
Z(:, i) = z * sign(t);
end
ttest(idtype).(ztype{itype}){isite, imor} = Z;
end
end %network type(G-G and S-S)
% fprintf("%s site_%d %s process overn", Dtype{idtype}, isite, mor_index{imor});
end %site
end % disease type
save dataedge_ttest2.mat ttest
When I use parallen task to perform the `gretna_permutation_ttest` function,the first dataset run properly, but the second dataset get fault whose task’s state is failure. Why is this happening?
Result returned exactly
Result returned by exception%% para
ttest = struct;
htype = {‘h_gyr’, ‘h_sul’};
dtype = {‘d_gyr’, ‘d_sul’};
ptype = {‘p_gyr’, ‘p_sul’};
ttype = {‘t_gyr’, ‘t_sul’};
ztype = {‘z_gyr’, ‘z_sul’};
Dtype = {‘BD’, ‘MDD’, ‘SCH’};
morp = {‘depth’,’fractaldimension’,’gyrification’,’thickness’};
times = 10000;
load dataedge_rmcov.mat
%% obtain t and p
% disease type
for idtype = 2:length(Dtype)
ttest(idtype).name = Dtype{idtype};
% sites
for isite = 1:length(covariate(idtype).d_gyr(:,1))
for itype = 1:length(dtype) %network type
% obtain value T and value P
% [tmp_t, tmp_p] = gretna_permutation_ttest(covariate(idtype).(dtype{itype}){isite, imor}, …
% covariate(idtype).(htype{itype}){isite, imor}, times); % T-test
% % create parallel task to perform the ttest
% % divide to four parallel task(SD, FD, GI, CT)
clu = parcluster();
job = createJob(clu);
task = createTask(job, @gretna_permutation_ttest,2, { …
{covariate(idtype).(htype{itype}){isite, 1},covariate(idtype).(dtype{itype}){isite, 1},times}, …
{covariate(idtype).(htype{itype}){isite, 2},covariate(idtype).(dtype{itype}){isite, 2},times}, …
{covariate(idtype).(htype{itype}){isite, 3},covariate(idtype).(dtype{itype}){isite, 3},times}, …
{covariate(idtype).(htype{itype}){isite, 4},covariate(idtype).(dtype{itype}){isite, 4},times} …
});
submit(job);
wait(job);
res = fetchOutputs(job); % result of four morphological networks for one site of G-G or S-S network’s edges
for imor = 1:length(morp) % save data to each morphological network
% save t and p
ttest(idtype).(ttype{itype}){isite, imor} = res{imor,1}.real;
ttest(idtype).(ptype{itype}){isite, imor} = res{imor,2};
% p->z
for i = 1:length(ttest(idtype).p_gyr{isite, imor}(1,:))
p = ttest(idtype).(ptype{itype}){isite, imor}(:, i);
z = icdf(‘Normal’, 1-(p/2), 0, 1);
t = ttest(idtype).(ttype{itype}){isite, imor}(:, i);
Z(:, i) = z * sign(t);
end
ttest(idtype).(ztype{itype}){isite, imor} = Z;
end
end %network type(G-G and S-S)
% fprintf("%s site_%d %s process overn", Dtype{idtype}, isite, mor_index{imor});
end %site
end % disease type
save dataedge_ttest2.mat ttest
When I use parallen task to perform the `gretna_permutation_ttest` function,the first dataset run properly, but the second dataset get fault whose task’s state is failure. Why is this happening?
Result returned exactly
Result returned by exception %% para
ttest = struct;
htype = {‘h_gyr’, ‘h_sul’};
dtype = {‘d_gyr’, ‘d_sul’};
ptype = {‘p_gyr’, ‘p_sul’};
ttype = {‘t_gyr’, ‘t_sul’};
ztype = {‘z_gyr’, ‘z_sul’};
Dtype = {‘BD’, ‘MDD’, ‘SCH’};
morp = {‘depth’,’fractaldimension’,’gyrification’,’thickness’};
times = 10000;
load dataedge_rmcov.mat
%% obtain t and p
% disease type
for idtype = 2:length(Dtype)
ttest(idtype).name = Dtype{idtype};
% sites
for isite = 1:length(covariate(idtype).d_gyr(:,1))
for itype = 1:length(dtype) %network type
% obtain value T and value P
% [tmp_t, tmp_p] = gretna_permutation_ttest(covariate(idtype).(dtype{itype}){isite, imor}, …
% covariate(idtype).(htype{itype}){isite, imor}, times); % T-test
% % create parallel task to perform the ttest
% % divide to four parallel task(SD, FD, GI, CT)
clu = parcluster();
job = createJob(clu);
task = createTask(job, @gretna_permutation_ttest,2, { …
{covariate(idtype).(htype{itype}){isite, 1},covariate(idtype).(dtype{itype}){isite, 1},times}, …
{covariate(idtype).(htype{itype}){isite, 2},covariate(idtype).(dtype{itype}){isite, 2},times}, …
{covariate(idtype).(htype{itype}){isite, 3},covariate(idtype).(dtype{itype}){isite, 3},times}, …
{covariate(idtype).(htype{itype}){isite, 4},covariate(idtype).(dtype{itype}){isite, 4},times} …
});
submit(job);
wait(job);
res = fetchOutputs(job); % result of four morphological networks for one site of G-G or S-S network’s edges
for imor = 1:length(morp) % save data to each morphological network
% save t and p
ttest(idtype).(ttype{itype}){isite, imor} = res{imor,1}.real;
ttest(idtype).(ptype{itype}){isite, imor} = res{imor,2};
% p->z
for i = 1:length(ttest(idtype).p_gyr{isite, imor}(1,:))
p = ttest(idtype).(ptype{itype}){isite, imor}(:, i);
z = icdf(‘Normal’, 1-(p/2), 0, 1);
t = ttest(idtype).(ttype{itype}){isite, imor}(:, i);
Z(:, i) = z * sign(t);
end
ttest(idtype).(ztype{itype}){isite, imor} = Z;
end
end %network type(G-G and S-S)
% fprintf("%s site_%d %s process overn", Dtype{idtype}, isite, mor_index{imor});
end %site
end % disease type
save dataedge_ttest2.mat ttest
When I use parallen task to perform the `gretna_permutation_ttest` function,the first dataset run properly, but the second dataset get fault whose task’s state is failure. Why is this happening?
Result returned exactly
Result returned by exception parallel computing MATLAB Answers — New Questions