source: trunk/src/cluster_command_pbs.m @ 1109

Last change on this file since 1109 was 1019, checked in by sommeria, 7 years ago

more general cluster commands introduced

File size: 2.0 KB
Line 
1%'cluster_command': creates the command string for launching jobs in the cluster
2%------------------------------------------------------------------------
3% function cmd=cluster_command_pbs(ListProcess,ActionFullName,DirLog,NbProcess, NbCore,CPUTimeProcess)
4%
5%OUTPUT
6% cmd=system command (char string) to launch jobs
7%%
8%
9%INPUT:
10% ListProcessFile: name of the file containing the list of processes to perform
11% ActionFullName: name given to the action (function activated by series)
12% DirLog: name of the folder used to store the log files from calculations
13% NbProcess: number of processes in the list, these processed are grouped by the systwm into jobs dipatched to NbCore cores
14% NbCore: number of computer cores to which the processes are dispatched
15% CPUTimeProcess: estimated CPU time for an individual process (in min)
16
17function cmd=cluster_command_pbs(ListProcessFile,ActionFullName,DirLog,NbProcess, NbCore,CPUTimeProcess)
18 
19          max_walltime=3600*20; % 20h max total calculation (cannot exceed 24 h)
20        walltime_onejob=1800; % seconds, max estimated time for asingle file index value
21       % ListProcess=fullfile(DirPBS,'job_list.txt'); % create name of the global executable file
22        fid=fopen(ListProcess,'w');
23        for iprocess=1:length(batch_file_list)
24            fprintf(fid,[batch_file_list{iprocess} '\n']); % list of exe files
25        end
26        fclose(fid);
27        system(['chmod +x ' ListProcess]); % set the file to executable
28        cmd=['qsub -n CIVX '...
29            '-t idempotent --checkpoint ' num2str(walltime_onejob+60) ' '...
30            '-l /core=' num2str(NbCore) ','...
31            'walltime=' datestr(min(1.05*walltime_onejob/86400*max(NbProcess*BlockLength*nbfield_j,NbCore)/NbCore,max_walltime/86400),13) ' '...
32            '-E ' regexprep(ListProcessFile,'\.txt\>','.stderr') ' '...
33            '-O ' regexprep(ListProcessFile,'\.txt\>','.log') ' '...
34            '"oar-parexec -s -f ' ListProcessFile ' '...
35            '-l ' ListProcessFile '.log"'];
Note: See TracBrowser for help on using the repository browser.