Routine Name MatMPI_Delete_all()
Routine Location MatlabMPI\MatMPI_Delete_all.m
Routine Purpose ---
Routine Arguments { --- }
Routine Outputs { --- }
Routine Size 66 line(s)
Routine Comment
Click here
Parent Routines
Child Routines
Routine Body

01  function MatMPI_Delete_all()
02  % MatMPI_Delete_all  -  Deletes leftover MatlabMPI files.
03  %
04  %  MatMPI_Delete_all()
05  %
06  %
07  
08  % First load MPI_COMM_WORLD.
09  load 'MatMPI / MPI_COMM_WORLD.mat' ;
10  
11  % Set newline string.
12  nl = sprintf('\n') ;
13  % Get single quote character.
14  q = strrep(' '' ' ,' ' ,'') ;
15  
16  % Get number of machines.
17  n_m = MPI_COMM_WORLD.machine_db.n_machine ;
18  
19  % Loop backwards over each machine.
20  for i_m = n_m: - 1:1
21      
22      % Get number of processes to launch on this machine.
23      n_proc_i_m = MPI_COMM_WORLD.machine_db.n_proc(1 ,i_m) ;
24      
25      if (n_proc_i_m >=  1)
26          
27          % Get communication directory.
28          comm_dir = MPI_COMM_WORLD.machine_db.dir{1 ,i_m} ;
29          
30          % Delete buffer and lock files in this directory.
31          delete([comm_dir ' / p *_p *_t *_buffer.mat']) ;
32          delete([comm_dir ' / p *_p *_t *_lock.mat']) ;
33      end
34      
35  end
36  
37  % Delete MatMPI directory.
38  delete('MatMPI /* ') ;
39  delete('MatMPI') ;
40  
41  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42  % MatlabMPI
43  % Dr. Jeremy Kepner
44  % MIT Lincoln Laboratory
45  % kepner@ll.mit.edu
46  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47  % Copyright 2002 Massachusetts Institute of Technology
48  %
49  % Permission is herby granted, without payment, to copy, modify, display
50  % and distribute this software and its documentation, if any, for any
51  % purpose, provided that the above copyright notices and the following
52  % three paragraphs appear in all copies of this software.  Use of this
53  % software constitutes acceptance of these terms and conditions.
54  %
55  % IN NO EVENT SHALL MIT BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
56  % SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
57  % THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF MIT HAS BEEN ADVISED OF THE
58  % POSSIBILITY OF SUCH DAMAGE.
59  %
60  % MIT SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING,
61  % BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
62  % FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
63  %
64  % THIS SOFTWARE IS PROVIDED "AS IS," MIT HAS NO OBLIGATION TO PROVIDE
65  % MAINTENANCE, SUPPORT, UPDATE, ENHANCEMENTS, OR MODIFICATIONS.
66