Tags:
tag this topic
create new tag
view all tags
<verbatim> % File: clumeq.m" % Author: Albert Law [bleuant@cim.mcgill.ca] (McGill University, Montreal, Quebec, Canada) % Description: This is written for CLUMEQ [http://www.clumeq.mcgill.ca/] % execution. It reads in "batch.m" and then writes a bunch of M-files and % PBS file that it will automatically add the the queue. % Note #1: Must only be executed on hn.clumeq.mcgill.ca % Note #2: The entire point is the run ALL the test cases in parallel at % one time or else it is faster to execute the test case (singular) on a % local machine. % Note #3: Not well documented as this was done as a fast hack. % Note #4: All the directories are hardcoded. Beware! % only proceed if all other queues have already been processed [s, out] = system ('qstat | grep alaw'); while (sum(size(out)) > 0) disp(fix(clock)); system('sleep 600'); [s, out] = system ('qstat | grep alaw'); end; fid = fopen('batch.m'); % open up "batch.m" for CLUMEQ parrallel processing % set the header information for the PBS file headerPBS = ['#PBS -l ncpus=1 '; '#PBS -V '; 'cd /home2/alaw/et/clumeq '; '/home/software/matlab/bin/matlab < ';]; % read the first 30-lines of "batch.m" for header information headerM = repmat(' ', 30, 256); iter = 1; while ((feof(fid) ~= 1) && (iter <= 30)) temp = fgets(fid); headerM(iter,1:size(temp,2)) = temp; iter = iter + 1; end; iterFOEF = 1; while (feof(fid) ~= 1) temp = fgetl(fid); if ((max(size(temp))>=2) & (strcmpi (temp(1:2), 'go'))) % this line does contain a "go" command % write the M-file temp_fid = fopen (['clumeq', filesep, 'batch_', num2str(iterFOEF), '.m'], 'w'); fprintf(temp_fid, '%s\n', 'cd ..'); iterH = 1; while (iterH <= size(headerM,1)) fprintf(temp_fid, '%s\n', headerM(iterH,:)); iterH = iterH + 1; end; fprintf(temp_fid, '\n%s\n', temp); fclose(temp_fid); % write the PBS file temp_fid = fopen (['clumeq', filesep, 'batch-', num2str(iterFOEF), '.pbs'], 'w'); iterH = 1; while (iterH < size(headerPBS,1)) fprintf(temp_fid, '%s\n', headerPBS(iterH,:)); iterH = iterH + 1; end; fprintf(temp_fid, '%s\n', strcat(headerPBS(iterH,:), [' batch_', num2str(iterFOEF), '.m'])); fclose(temp_fid); % submit the PBS file to the CLUMEQ queue system(['qsub clumeq', filesep, 'batch-', num2str(iterFOEF), '.pbs']); iterFOEF = iterFOEF + 1; end; end; fclose(fid); </verbatim>
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2006-05-10
-
bleuant
Home
Site map
BETA web
Communications web
Faculty web
Imager web
LCI web
Main web
SPL web
Sandbox web
TWiki web
TestCases web
LCI Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
E
dit
A
ttach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback