Changeset 910 for trunk/src/series.m
- Timestamp:
- Jun 13, 2015, 7:20:37 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r909 r910 1481 1481 errormsg='';%default error message 1482 1482 xmlfile=fullfile(path_series,'PARAM.xml'); 1483 test_batch=0;%default: ,no batch mode available1483 %test_batch=0;%default: ,no batch mode available 1484 1484 if ~exist(xmlfile,'file') 1485 1485 [success,message]=copyfile(fullfile(path_series,'PARAM.xml.default'),xmlfile); 1486 1486 end 1487 % RunTime='';1488 1487 if strcmp(ActionExt,'.sh') 1489 1488 if exist(xmlfile,'file') 1490 1489 s=xml2struct(xmlfile); 1491 1490 if strcmp(RunMode,'cluster_oar') && isfield(s,'BatchParam') 1492 % if isfield(s.BatchParam,'RunTime')1493 % RunTime=s.BatchParam.RunTime;1494 % end1495 1491 if isfield(s.BatchParam,'NbCore') 1496 1492 NbCore=s.BatchParam.NbCore; 1497 1493 end 1498 1494 elseif (strcmp(RunMode,'background')||strcmp(RunMode,'local')) && isfield(s,'RunParam') 1499 % if isfield(s.RunParam,'RunTime')1500 % RunTime=s.RunParam.RunTime;1501 % end1502 1495 if isfield(s.RunParam,'NbCore') 1503 1496 NbCore=s.RunParam.NbCore; … … 1505 1498 end 1506 1499 end 1507 % if isempty(RunTime) && strcmp(RunMode,'cluster_oar')1508 % errormsg='RunTime name not found in PARAM.xml, compiled version .sh cannot run on cluster';1509 % return1510 % end1511 1500 end 1512 1501 … … 1727 1716 end 1728 1717 nbfield_j=numel(ref_j); % number of j indices 1729 BlockLength=numel(ref_i);%default 1730 if isempty(Param.IndexRange.NbSlice) 1731 NbProcess=NbCore;% choose one process per core by default if NbSlice is not imposed 1732 switch RunMode 1733 case 'cluster_oar' 1734 BlockLength= ceil(20/(CPUTime*nbfield_j));% short iterations are grouped such that the minimum time of a process is 20 min. 1735 NbProcess=ceil(numel(ref_i)/BlockLength) ; % nbre of processes sent to oar 1736 end 1737 else 1738 NbProcess=Param.IndexRange.NbSlice;% the parameter NbSlice sets the nbre of run processes 1739 NbCore=min(NbCore,NbProcess);% reduces the number of cores if it exceeds the number of processes 1740 end 1741 1742 %BlockLength=ceil(numel(ref_i)/NbProcess);% nbre of input fields in each process 1743 %nbfield_j=numel(ref_j); % number of j indices 1718 BlockLength=numel(ref_i);% by default, job involves the full set of i field indices 1719 NbProcess=1; 1720 switch RunMode 1721 case {'cluster_oar','cluster_pbs'} 1722 if isempty(Param.IndexRange.NbSlice)% if NbSlice is not defined 1723 BlockLength= ceil(20/(CPUTime*nbfield_j));% short iterations are grouped such that the minimum time of a process is 20 min. 1724 BlockLength=max(BlockLength,ceil(numel(ref_i)/1000));% possibly increase the BlockLength to have less than 1000 jobs 1725 NbProcess=ceil(numel(ref_i)/BlockLength) ; % nbre of processes sent to oar 1726 else 1727 NbProcess=Param.IndexRange.NbSlice;% the parameter NbSlice sets the nbre of run processes 1728 NbCore=min(NbCore,NbProcess);% reduces the number of cores if it exceeds the number of processes 1729 end 1730 end 1744 1731 1745 1732 %% record nbre of output files and starting time for computation for status
Note: See TracChangeset
for help on using the changeset viewer.