I get no output from the task

조회 수: 9 (최근 30일)
Rashid
Rashid 2013년 2월 6일
Hello, I have a function, which runs perfectly fine on its own, with the following header:
[ensemble_2drift_dwm_nb, acc_2drift_dwm_nb, ens_hist_2drift_dwm_nb, result_2drift_dwm_nb, preds_2drift_dwm_nb, result_test_2drift_dwm_nb, preds_test_2drift_dwm_nb, avg_result_test_2drift_dwm_nb, exp_hist_2drift_dwm_nb] = dwm03_bin_testset(data_2drift_train, lab_2drift_train, 0.5, 0.01, 1, naivebc_r, data_2drift_test, lab_2drift_test)
now I want to run the above function in a separate task. For this purpose I use the following code:
j1 = createJob();
t1 = createTask(j1, @dwm03_bin_testset, 9, {data_2drift_train, lab_2drift_train, 0.5, 0.01, 1, naivebc_r, data_2drift_test, lab_2drift_test});
submit(j1);
waitForState(j1);
get(t1, 'State')
taskoutput1 = get(t1, 'OutputArguments');
Problem: After running this script, the variable taskoutput1, which is supposed to store the output from the function call, is 0x0 cell array.
Now, I was testing this and noticed that I get 'finished' state of the job much faster than I should. Also, I am not sure whether the function call in the task uses the same path as normal function call, because when I was testing with a simple function, and put it in some other folder, which was included in path, I was getting 0x0 cell array as an output as well.
Can anyone shed some light on this issue? My version of Matlab is R2011a. Thanks.

채택된 답변

Jason Ross
Jason Ross 2013년 2월 6일
편집: Jason Ross 2013년 2월 6일
Check the task for an Error, something like
taskerror1 = get(t1, 'Error')
This might help you to debug your issue. You can also get the ErrorMessage and ErrorIdentifier, as well.
  댓글 수: 4
Rashid
Rashid 2013년 2월 6일
thanks again, tried the first way and it worked
Jason Ross
Jason Ross 2013년 2월 6일
Great! Keep in mind that any job you submit to the cluster will have those files/directories attached. If you don't want that, use the second option.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by