-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_cluster_jat.m
74 lines (69 loc) · 2.39 KB
/
run_cluster_jat.m
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
function [clu, tree] = run_cluster_jat(handles)
dim = handles.params.inputs;
fname = handles.params.fname;
fname_in = handles.params.fname_in;
% DELETE PREVIOUS FILES
fileexist = exist([fname '.dg_01.lab'],'file');
if(fileexist~=0)
delete([fname '.dg_01.lab']);
delete([fname '.dg_01']);
end
dat = load(fname_in);
n = length(dat);
fid = fopen(sprintf('%s.run',fname),'wt');
fprintf(fid,'NumberOfPoints: %s\n',num2str(n));
fprintf(fid,'DataFile: %s\n',fname_in);
fprintf(fid,'OutFile: %s\n',fname);
fprintf(fid,'Dimensions: %s\n',num2str(dim));
fprintf(fid,'MinTemp: %s\n',num2str(handles.params.mintemp));
fprintf(fid,'MaxTemp: %s\n',num2str(handles.params.maxtemp));
fprintf(fid,'TempStep: %s\n',num2str(handles.params.tempstep));
fprintf(fid,'SWCycles: %s\n',num2str(handles.params.SWCycles));
fprintf(fid,'KNearestNeighbours: %s\n',num2str(handles.params.KNearNeighb));
fprintf(fid,'MSTree|\n');
fprintf(fid,'DirectedGrowth|\n');
fprintf(fid,'SaveSuscept|\n');
fprintf(fid,'WriteLables|\n');
fprintf(fid,'WriteCorFile~\n');
if handles.params.randomseed ~= 0
fprintf(fid,'ForceRandomSeed: %s\n',num2str(handles.params.randomseed));
end
fclose(fid);
[str,maxsize,endian]=computer;
handles.params.system=str;
switch handles.params.system
case {'PCWIN','PCWIN64'}
if exist([pwd '\cluster.exe'])==0
directory = which('cluster.exe');
copyfile(directory,pwd);
end
dos(sprintf('cluster.exe %s.run',fname));
case {'MAC'}
if exist([pwd '/cluster_mac.exe'])==0
directory = which('cluster_mac.exe');
copyfile(directory,pwd);
end
run_mac = sprintf('./cluster_mac.exe %s.run',fname);
unix(run_mac);
case {'MACI','MACI64'}
if exist([pwd '/cluster_maci.exe'])==0
directory = which('cluster_maci.exe');
copyfile(directory,pwd);
end
run_maci = sprintf('./cluster_maci.exe %s.run',fname);
unix(run_maci);
otherwise %(GLNX86, GLNXA64, GLNXI64 correspond to linux)
if exist([pwd '/cluster_linux.exe'])==0
directory = which('cluster_linux.exe');
copyfile(directory,pwd);
end
run_linux = sprintf('./cluster_linux.exe %s.run',fname);
unix(run_linux);
end
clu = load([fname '.dg_01.lab']);
tree = load([fname '.dg_01']);
delete(sprintf('%s.run',fname));
delete *.mag
delete *.edges
delete *.param
delete(fname_in);