2010年1月18日月曜日

IDL de Multithread

公式テキストはこちら『Multi-Threading in IDL』

そして公式テキストからわかること

  • Multithread 環境下でも FFT はぜんぜんはやくならない
  • 具体的には2Core使っても1.5倍程度にしかならない

えーと。どうしろと。

Multithread.pro なんてものを見つけました。こちら

えーとなになに。

MULTITHREAD.PRO provides a means to make use of multiple CPUs on a single computer. While some of the IDL routines are already able to parallel process over several CPUs, it is not possible with all IDL commands, or even user written routines.

This procedure uses the IDL_Bridge objects to create multiple IDL session instances on the executing machine (one per CPU), copies the necessary variables to each session, executes a command that use those variables and then harvests and re-assembles the data for output.

For example, to calculate Z = X^2 + Y^2

X = FINDGEN( 10000L)
Y = X
multithread,'Z=x[i:j]^2 + y[i:j]^2', ['x','y'], ['z'], /WAIT

will return Z at the calling scope.

This routine is particularly useful for processing multiple files:

filenames = FILE_SEARCH('*.txt')
multithread,'process_files,filenames[i:j]', ['filenames'], /WAIT

where the user routine PROCESS_FILES would be executed for each of the files in the filenames variable.

Multithread.pro が使えるのかどうかについてはわかりませんが、どうやら IDL_Bridge が IDL における Multithread の鍵を握っているらしい。しかし実際にはプロセスモデルっぽいですね。スレッドは?

0 件のコメント:

コメントを投稿

この投稿へのリンク:

リンクを作成

<< ホーム