source: issm/trunk-jpl/src/m/os/ismpi.m@ 13646

Last change on this file since 13646 was 13646, checked in by Mathieu Morlighem, 12 years ago

CHG: cosmetics, removed multiple blank lines

File size: 761 bytes
Line 
1function flag=ismpi()
2%ISMPI - figure out if MPI package was compiled with ISSM
3%
4% Usage:
5% flag=ismpi();
6
7configfile=[issmdir() '/bin/config.h']; %should find it in the install target
8if ~exist(configfile,'file'),
9 error(['File ' configfile ' not found. ISSM has not been configured yet!']);
10end
11
12%go through the file, and recover the line we want
13flag=2;
14fid=fopen(configfile,'r');
15if(fid==-1), error(['could not open file: ' configfile]); end
16
17while(true),
18 tline=fgets(fid);
19 if ~ischar(tline), break, end
20 if strncmp(tline,'/* #undef _HAVE_MPI_ */',23),
21 flag=0;
22 break;
23 end
24 if strncmp(tline,'#define _HAVE_MPI_',18),
25 flag=1;
26 break;
27 end
28end
29fclose(fid);
30if flag==2,
31 error('could not determine whether MPI was or was not compiled');
32end
Note: See TracBrowser for help on using the repository browser.