9
A
回答
3
目前,唯一的方法是使用MPI,並且您可以在Xavier Leroy's website上找到它的ocaml綁定。
8
使用以下invoke
組合子施加函數的值在另一個(叉形)處理,然後當施加()
值阻塞等待其結果是:
let invoke (f : 'a -> 'b) x : unit -> 'b =
let input, output = Unix.pipe() in
match Unix.fork() with
| -1 -> (let v = f x in fun() -> v)
| 0 ->
Unix.close input;
let output = Unix.out_channel_of_descr output in
Marshal.to_channel output (try `Res(f x) with e -> `Exn e) [];
close_out output;
exit 0
| pid ->
Unix.close output;
let input = Unix.in_channel_of_descr input in
fun() ->
let v = Marshal.from_channel input in
ignore (Unix.waitpid [] pid);
close_in input;
match v with
| `Res x -> x
| `Exn e -> raise e
相關問題
- 1. Ruby中的蒙特卡洛模擬
- 2. R - 如何並行化蒙特卡洛模擬的for循環?
- 3. 使用Brightway2進行蒙特卡洛模擬的負對數正態結果
- 4. 查找使用蒙特卡洛方法
- 5. 金融報價免費蒙特卡洛模擬器?
- 6. 用蒙特卡洛模擬使用八度的平均解決方案
- 7. 蒙特卡洛多重分佈
- 8. 蒙特卡洛試驗上AES 128 CBC
- 9. 蒙特卡洛方法崩潰?
- 10. C#蒙特卡洛仿真包需要
- 11. 蒙特卡洛標準偏差方程
- 12. 蒙特卡洛Pi不準確
- 13. 在R中進行簡單蒙特卡洛積分時出現錯誤結果
- 14. 如何在反應()函數中存儲蒙特卡洛模擬輸出在發光
- 15. R的蒙特卡羅骰子模擬
- 16. 爲什麼使用蒙特卡洛方法?
- 17. 蒙特卡洛搜索樹如何工作?
- 18. 蒙特卡洛仿真條件循環在MATLAB中
- 19. 與QuTiP並行的蒙特卡洛求解器
- 20. 如何使用蒙特卡洛方法來搜索極限概率
- 21. 蒙特卡洛模擬中「最後的好回覆」和「快速行動價值估計」的概念是什麼?
- 22. 使用並行工具箱的GPU上的簡單蒙特卡洛
- 23. 使用R做蒙特卡羅模擬,解決以下問題
- 24. 蒙地卡羅模擬器
- 25. 檢索的卡方檢驗蒙特卡羅模擬值
- 26. 使用蒙特卡洛方法計算pi java - 計算不起作用
- 27. 基於R兌現爲LatinHypercube /蒙特卡洛試驗相關
- 28. 作爲隨機和計算(蒙特卡洛)
- 29. 單位球體上的統一隨機(蒙特卡洛)分佈
- 30. Python/Numpy - 加速放射性衰變的蒙特卡洛方法
ocaml4multicore是可用的(有限制),請參閱:http://www.algo-prog.info/ocmc/web/ – nlucaroni 2009-09-24 14:43:44