Matlab Tools for Multiple Instruction Single Data (MISD)?

4 ビュー (過去 30 日間)
Juan Pablo Segovia
Juan Pablo Segovia 2017 年 5 月 8 日
コメント済み: Walter Roberson 2017 年 5 月 9 日
Hello,          I have a problem that has more than one million functions to evaluate, all different, for the same data group. Morphologically this type of problem is called MISD (Multiple Instructions Single Data), each mathematical function can be written as a matlab function, with input and output arguments. What is the most efficient way to solve this type of problems with matlab ?.
  2 件のコメント
Jan
Jan 2017 年 5 月 8 日
It depends on how the functions are stored. Please give us a small example.
Juan Pablo Segovia
Juan Pablo Segovia 2017 年 5 月 8 日
編集済み: Walter Roberson 2017 年 5 月 8 日
Jan,     
Thanks for your interest in the problem, for example: the main program declares the global variables,
Name Size Bytes Class Attributes
N1 1x1 8 double global
N6 1x1 8 double global
Px 82251x1 658008 double global
S 4496388x6 215826624 double global
V = test0001;
For higher execution speed all the functions were explicitly generated:
% Funtion test0001
Function vpe = test0001
Global s px n1 n6
Vpe = - ((s (px, 2) -n6 + 1). * (S (px, 2) -n6 + 2) * (s (px, 2) -n6 + 3)) / 6;
Return

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 5 月 8 日
global variables are the slowest kind of variables. You would be better to parameterize your functions
  7 件のコメント
Juan Pablo Segovia
Juan Pablo Segovia 2017 年 5 月 9 日
Walter, many thanks to you for the advice, you have some examples of similar code or you can recommend me bibliography related to this subject.
I reiterate my gratitude, sincerely J.P.
Walter Roberson
Walter Roberson 2017 年 5 月 9 日
If you have a vector of symbolic expressions, I would probably be tempted to factor() the length of the vector, reshape() with the last (largest) factor as the first dimension, then use matlabFunction on each column, asking to generate files. The purpose here is to batch enough work together to make it worth while to talk to a worker considering communications overhead.
If the expressions are to be reused multiple times, leave the default matlabFunction optimization on; otherwise, the optimization phase might be more expense than it is worth.
After that you can create workers, AddAttachedFiles, and parfeval() to invoke the functions on the current data.
Note: matlabFunction does not currently do well on vectors of functions where the components might require looping or piecewise(): in current implementations it tries put 'if' statements inside the horzcat or vertcat operator. matlabFunction also currently does not do well on int() with a vector of locations to be integrated.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by