1 ## Copyright (C) 2009 Riccardo Corradini <riccardocorradini@yahoo.it>
2 ## under the terms of the GNU General Public License.
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2 of the License, or
7 ## (at your option) any later version.
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program; If not, see <http://www.gnu.org/licenses/>.
18 # if you have 4 cores or a network of 4 computers with a ssh connection with no password and same openmpi 1.3.3 installation
19 # type at the terminal mpirun -np 4 octave --eval hellocell
23 # the string NEWORLD is just a label could be whatever you want
24 CW = MPI_Comm_Load("NEWORLD");
28 my_rank = MPI_Comm_rank(CW);
29 p = MPI_Comm_size(CW);
30 # TAG is very important to identify the message
36 message = {magic(3) 17 'fred'; ...
37 'AliceBettyCarolDianeEllen' 'yp' 42; ...
40 [info] = MPI_Send(message,rankvect,TAG,CW);
43 disp("We are at rank 0 that is master etc..");
44 [messager, info] = MPI_Recv(source,TAG,CW);