Initiated parallel

This commit is contained in:
Anthony Scemama 2018-10-16 00:27:58 +02:00
parent 883e369b4e
commit 408b7692a6
5 changed files with 23 additions and 2 deletions

View File

@ -1,6 +1,6 @@
.NOPARALLEL:
INCLUDE_DIRS=Nuclei,Utils,Basis,SCF,MOBasis,CI
INCLUDE_DIRS=Parallel,Nuclei,Utils,Basis,SCF,MOBasis,CI
LIBS=
PKGS=
OCAMLBUILD=ocamlbuild -j 0 -cflags $(ocamlcflags) -lflags $(ocamlcflags) $(ocamldocflags) -Is $(INCLUDE_DIRS) -ocamlopt $(ocamloptflags)

6
Parallel/Parallel.ml Normal file
View File

@ -0,0 +1,6 @@
(** Module for handling distributed parallelism *)
let size = Mpi.comm_size Mpi.comm_world
let rank = Mpi.comm_rank Mpi.comm_world

10
Parallel/Parallel.mli Normal file
View File

@ -0,0 +1,10 @@
(** Module for handling distributed parallelism *)
val size : int
(** Number of distributed processes. *)
val rank : Mpi.rank
(** Rannk of the current distributed processe. *)

2
_tags
View File

@ -1,4 +1,4 @@
true: package(str,unix,bigarray,lacaml,alcotest,zarith)
true: package(str,unix,bigarray,lacaml,alcotest,zarith,mpi)
<*.byte> : linkdep(Utils/math_functions.o), custom
<*.native>: linkdep(Utils/math_functions.o)
<odoc-ltxhtml>: not_hygienic

5
run_parallel.ml Normal file
View File

@ -0,0 +1,5 @@
let () =
Printf.printf "Hello from rank %d of %d.\n"
Parallel.rank Parallel.size