Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpi in toplevel #11

Open
pklehre-ocamlec opened this issue May 16, 2022 · 1 comment
Open

mpi in toplevel #11

pklehre-ocamlec opened this issue May 16, 2022 · 1 comment

Comments

@pklehre-ocamlec
Copy link

Is it possible to use mpi via the toplevel (ocaml, utop, or jupyter)? I get the the following error message:

# #require "mpi";;
Error: The external function `caml_mpi_send_int' is not available

I am using the '4.14.0+domains+flambda' opam switch.

@xavierleroy
Copy link
Owner

I, too, find this error puzzling!

Looking at the output of ocamlobjinfo on the mpi.cma archive gives a clue:

File /home/xleroy/.opam/4.14.0/lib/mpi/mpi.cma
Force custom: YES
Extra C object files: -lcamlmpi -lmpi
Extra C options: -L/usr/lib/x86_64-linux-gnu
Extra dynamically-loaded libraries:

The library does not provide its OCaml-C stub code as a DLL, so that's why it cannot be loaded in a toplevel REPL. I would hope we could have the stub code as a DLL, if we used ocamlmklib to build mpi.cma. But there may be obscure MPI-specific problems.

TODO: try to build mpi.cma and mpi.cmxa using ocamlmklib.

Also, if you're using a distributed implementation of MPI (e.g. on a cluster), I'm not sure what happens if you use it interactively via the toplevel REPL on one node and non-interactively(?) on the other nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants