Using Meroon with MPI
These steps seem to work to run programs that use Meroon with MPI.
- Configure and build gambit with mpicc. The following commands will build a gambit and put it in /usr/local/Gambit-C/current/{bin,include,lib,...}
- Change directory to the Gambit source directory; run make mostlyclean if necessary.
- ./configure CC=mpicc --enable-single-host --enable-multiple-versions
- make
- sudo make install
- Make sure /usr/local/Gambit-C/current/bin is in your path.
- Make Meroon with the Gambit built with mpicc and install:
- Change directory to the Meroon source directory. Remove all files beginning with _meroon if necessary.
- ./make_meroon
- sudo cp _meroon.o1 /usr/local/Gambit-C/current/lib/
- sudo ln -s /usr/local/Gambit-C/current/bin/gsi /usr/local/Gambit-C/current/bin/gsi++
- sudo ln -s /usr/local/Gambit-C/current/bin/gsc /usr/local/Gambit-C/current/bin/gsc++
- Create a file /usr/local/Gambit-C/current/lib/gambcext that contains
(case (string->symbol (car (##command-line))) ((gsi++ gsc++) (load "~~/lib/_meroon.o1")) (else #f))
You should now have a working gsc++ and gsi++.
- Build and compile your program that uses Meroon.
- Here's a file point-test.scm that uses Meroon:
% cat point-test.scm
(define-class Point Object
((= x)
(= y)))
(define a (make-Point 1. 2.))
(pp (list (Point-x a) (Point-y a)))
- Compile it: gsc++ point-test.scm
- Run it:
% mpirun -np 4 gsi++ point-test.o1
[ Meroon V3 Paques2001+1 $Revision: 1.2 $ ]
(1. 2.)
[ Meroon V3 Paques2001+[ Meroon V3 Paques2001+11 $Revision: 1.2 $ ]
$Revision: 1.2 $ ]
(1. 2.)
(1. 2.)
[ Meroon V3 Paques2001+1 $Revision: 1.2 $ ]
(1. 2.)
- To actually use the MPI API, you'll need to use the Gambit Foreign Function Interface (FFI) to map the C constants and routines to Scheme constants and routines. See the Gambit documentation about how to do this.