-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparallelPrelimSortDirectory.m
More file actions
41 lines (27 loc) · 1.18 KB
/
parallelPrelimSortDirectory.m
File metadata and controls
41 lines (27 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function parallelPrelimSortDirectory(dateCode, wildcardString, nClusters, nHosts)
load('dataLocation.mat');
baseName = [dataLocation,'/',dateCode,'/'];
wildcard = ['RL',dateCode,'_',wildcardString];
fileList = dir([baseName,wildcard]);
jm = findResource('scheduler','type','lsf');
set(jm,'ClusterMatlabRoot','/opt/matlab');
job = createJob(jm);
queueString = '-W 12:00 -q short';
set(jm,'SubmitArguments',['-R "rusage[matlab_dc_lic=1]" ',queueString]);
filesPerHost = ceil(length(fileList)/nHosts);
startFile = 1; endFile = 1;
while endFile < length(fileList)
endFile = startFile + filesPerHost - 1;
if endFile > length(fileList)
endFile = length(fileList);
end
for n = 1:(endFile - startFile + 1)
wholeNames{n} = [baseName, fileList(startFile + n - 1).name];
disp(wholeNames{n});
end
disp('Grouping as job...');
functionArgs = {wholeNames, nClusters};
createTask(job, @prelimSortFiles, 0, functionArgs);
startFile = endFile + 1;
end
submit(job);