これは、tic/tocとジョブのプロパティを使用して非常に簡単にデバッグできます。私はこれを実行する場合、私はあなたがほとんどの時間を提出し、起動の間に失われていることがわかり
Creating the cluster: 0.01 sec
Creating a job: 0.02 sec
Creating the tasks: 0.04 sec
Submitting the job: 0.19 sec
Waiting time: 4.13 sec
Fetching Results: 0.02 sec
Job Properties
Create Time: Mon May 22 10:30:23 BST 2017
Submit Time: Mon May 22 10:30:23 BST 2017
Start Time: Mon May 22 10:30:26 BST 2017
Finish Time: Mon May 22 10:30:27 BST 2017
を以下の取得例
clc; close all; clear;
a = 10;
tic;
c = parcluster();
fprintf('Creating the cluster: %.2f sec\n', toc);
tic;
job = createJob(c);
fprintf('Creating a job: %.2f sec\n', toc);
tic;
createTask(job, @exp, 1, {a});
createTask(job, @sin, 1, {a});
fprintf('Creating the tasks: %.2f sec\n', toc);
tic;
submit(job);
fprintf('Submitting the job: %.2f sec\n', toc);
% Most of the time goes on scheduling the job here
% pause(10);
tic;
wait(job)
fprintf('Waiting time: %.2f sec\n', toc);
tic;
results = fetchOutputs(job);
fprintf('Fetching Results: %.2f sec\n\n', toc);
fprintf('Job Properties\n');
fprintf('Create Time: %s \n', job.CreateTime);
fprintf('Submit Time: %s \n', job.SubmitTime);
fprintf('Start Time: %s \n', job.StartTime);
fprintf('Finish Time: %s \n', job.FinishTime);
delete(job);
については、以下を参照してください。実行自体は非常に高速です。あなたはpause(10)
からコメントを削除することによって、ポーズを導入する場合は、ジョブのスケジュールおよび実行されている間、あなたは、あなたのコードの早い段階でジョブを実行する他のいくつかの操作を行うと考えることができ、したがって、次の
Creating the cluster: 0.01 sec
Creating a job: 0.02 sec
Creating the tasks: 0.04 sec
Submitting the job: 0.19 sec
Waiting time: 0.06 sec
Fetching Results: 0.02 sec
Job Properties
Create Time: Mon May 22 10:31:44 BST 2017
Submit Time: Mon May 22 10:31:44 BST 2017
Start Time: Mon May 22 10:31:47 BST 2017
Finish Time: Mon May 22 10:31:48 BST 2017
を取得します続いてコードをさらにフェッチします。これが参考になることを願っています。
ありがとうございました!私はそれをチェックします〜 – Jason