0001 function [server_codepath server_executionpath]=ProcessParallelParametersFromCieloRc(server_name,cielo_rc_location)
0002
0003
0004
0005
0006
0007
0008
0009
0010 lines_per_server=5;
0011
0012 fid=fopen(cielo_rc_location);
0013 if fid==-1,
0014 error('Could not find cielo.rc file in delivery directory');
0015 end
0016
0017 found=0;
0018
0019
0020 line=fgetl(fid);
0021 if ~strcmp(line,'begin'),
0022 error('cielo.rc file in delivery directory should always start with the begin statement');
0023 end
0024
0025
0026 while 1
0027 line=fgetl(fid);
0028
0029
0030 if strcmp(line,'end'),
0031 break;
0032 end
0033
0034 if ~ischar(line),
0035 error('cielo.rc file in delivery directory should end with an end statement');
0036 end
0037
0038 if length(line)==0,
0039 continue;
0040 end
0041
0042 if strcmp(line(1),'#'),
0043 continue
0044 end
0045
0046
0047 if length(line)>11,
0048 if strcmp(line(1:11),'server_name'),
0049
0050
0051 splittedstring=strsplit(line,'=');
0052 this_server_name=splittedstring{2};
0053 if strcmp(this_server_name,server_name),
0054
0055
0056 line=fgetl(fid);
0057 line=fgetl(fid);
0058 line=fgetl(fid);
0059
0060
0061 line=fgetl(fid);
0062 splittedstring=strsplit(line,'=');
0063 descriptor=splittedstring{1};
0064 value=splittedstring{2};
0065 if ~strcmp(descriptor,'server_codepath'),
0066 error('server settings in cielo.rc don''t follow the correct syntax');
0067 end
0068 server_codepath=value;
0069 found=1;
0070
0071
0072
0073 line=fgetl(fid);
0074 splittedstring=strsplit(line,'=');
0075 descriptor=splittedstring{1};
0076 value=splittedstring{2};
0077 if ~strcmp(descriptor,'server_executionpath'),
0078 error('server settings in cielo.rc don''t follow the correct syntax');
0079 end
0080 server_executionpath=value;
0081
0082 else
0083
0084 for i=1:lines_per_server,
0085 line=fgetl(fid);
0086 end
0087 continue;
0088 end
0089 end
0090 end
0091 end
0092
0093 fclose(fid);
0094
0095 if found==0,
0096 error(['ProcessParallelParametersFromCieloRc error message: could not find setting for cluster ' server_name 'in cielo.rc file']);
0097 end
0098
0099 end