Routine Name MPI_Send( dest, tag, comm, varargin )
Routine Location MatlabMPI\MPI_Send.m
Routine Purpose ---
Routine Arguments { comm, dest, tag, varargin }
Routine Outputs { --- }
Routine Size 51 line(s)
Routine Comment
Click here
Parent Routines
Child Routines
Routine Body

01  function MPI_Send( dest , tag , comm , varargin )
02  % MPI_Send  -  Sends variables to dest.
03  %
04  %  MPI_Send( dest, tag, comm, var1, var2, ...)
05  %
06  %    Send message containing variables to dest with a given tag
07  %
08  %    dest can be an iteger from 0 to comm_size-1
09  %    tag can be any integer
10  %    comm is an MPI Communicator (typically a copy of MPI_COMM_WORLD)
11  %
12  
13  % Get processor rank.
14  my_rank = MPI_Comm_rank(comm) ;
15  
16  % Create buffer and lock file.
17  buffer_file = MatMPI_Buffer_file(my_rank ,dest ,tag ,comm) ;
18  lock_file = MatMPI_Lock_file(my_rank ,dest ,tag ,comm) ;
19  
20  % Save buf to file.
21  save(buffer_file ,'varargin') ;
22  
23  % Create lock file.
24  fclose(fopen(lock_file ,'w')) ;
25  
26  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27  % MatlabMPI
28  % Dr. Jeremy Kepner
29  % MIT Lincoln Laboratory
30  % kepner@ll.mit.edu
31  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32  % Copyright 2002 Massachusetts Institute of Technology
33  %
34  % Permission is herby granted, without payment, to copy, modify, display
35  % and distribute this software and its documentation, if any, for any
36  % purpose, provided that the above copyright notices and the following
37  % three paragraphs appear in all copies of this software.  Use of this
38  % software constitutes acceptance of these terms and conditions.
39  %
40  % IN NO EVENT SHALL MIT BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
41  % SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
42  % THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF MIT HAS BEEN ADVISED OF THE
43  % POSSIBILITY OF SUCH DAMAGE.
44  %
45  % MIT SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING,
46  % BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
47  % FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
48  %
49  % THIS SOFTWARE IS PROVIDED "AS IS," MIT HAS NO OBLIGATION TO PROVIDE
50  % MAINTENANCE, SUPPORT, UPDATE, ENHANCEMENTS, OR MODIFICATIONS.
51