Created
January 9, 2013 07:37
-
-
Save UnixJunkie/4491378 to your computer and use it in GitHub Desktop.
more Parmap problem reproduce trial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Printf | |
let main _ = | |
Parmap.debugging true; | |
let cores = int_of_string Sys.argv.(1) in | |
let array1_length = 1000 in | |
let array2_length = 100000 in | |
let float_bound = 10.0 in | |
print_endline "Building array1"; | |
let array1 = | |
Array.init | |
array1_length | |
(fun indice -> | |
Array.init array2_length (fun indice -> Random.float float_bound)) | |
in | |
print_endline "array1 built"; | |
print_endline "Parmap"; | |
let f = | |
(fun array -> | |
(Array.map | |
(fun float -> float +.Random.float float_bound) | |
array)) | |
in | |
let new_array1 = | |
Parmap.array_parmap | |
~ncores: cores | |
f | |
array1 | |
in | |
print_endline | |
(sprintf | |
"new_array1 length: %d" | |
(Array.length new_array1)) | |
;; | |
main () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment