Skip to content

Instantly share code, notes, and snippets.

@UnixJunkie
Created January 9, 2013 07:37
Show Gist options
  • Save UnixJunkie/4491378 to your computer and use it in GitHub Desktop.
Save UnixJunkie/4491378 to your computer and use it in GitHub Desktop.
more Parmap problem reproduce trial
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