This commit is contained in:
Sebastian Held 2012-11-16 21:44:46 +01:00
parent c45cd4ab70
commit fdd8f08a7b
3 changed files with 36 additions and 35 deletions

View File

@ -7,10 +7,10 @@ clear
close all close all
drawnow drawnow
Octave = exist('OCTAVE_VERSION','var') ~= 0; if isOctave
if Octave
confirm_recursive_rmdir(0); confirm_recursive_rmdir(0);
page_screen_output(0); % do not buffer output
page_output_immediately(1); % do not buffer output
end end
folder = fileparts( mfilename( 'fullpath' ) ); folder = fileparts( mfilename( 'fullpath' ) );
@ -23,7 +23,7 @@ options = {'--engine=multithreaded', '--engine=sse-compressed', '--engine=sse',
for o=1:numel(options) for o=1:numel(options)
disp( [datestr(now) ' *** TESTSUITE started (options: ' options{o} ')'] ); disp( [datestr(now) ' *** TESTSUITE started (options: ' options{o} ')'] );
% now list the tests % now list the tests
folders = dir(); folders = dir();
for f=1:numel(folders) for f=1:numel(folders)
@ -42,6 +42,7 @@ for o=1:numel(options)
% execute function % execute function
disp( [datestr(now) ' executing: ' folders(f).name '/' scripts(s).name] ); disp( [datestr(now) ' executing: ' folders(f).name '/' scripts(s).name] );
[~,fname] = fileparts( scripts(s).name ); [~,fname] = fileparts( scripts(s).name );
fflush(1); % flush stdout
pass = feval( fname, options{o}, 'run_testsuite' ); pass = feval( fname, options{o}, 'run_testsuite' );
end end
end end

View File

@ -11,26 +11,26 @@ function RunOpenEMS(Sim_Path, Sim_File, opts, Settings)
% %
% opts: list of openEMS options % opts: list of openEMS options
% possible options: % possible options:
% --disable-dumps Disable all field dumps for faster simulation % --disable-dumps Disable all field dumps for faster simulation
% --debug-material Dump material distribution to a vtk file for debugging % --debug-material Dump material distribution to a vtk file for debugging
% --debug-PEC Dump metal distribution to a vtk file for debugging % --debug-PEC Dump metal distribution to a vtk file for debugging
% --debug-operator Dump operator to vtk file for debugging % --debug-operator Dump operator to vtk file for debugging
% --debug-boxes Dump e.g. probe boxes to vtk file for debugging % --debug-boxes Dump e.g. probe boxes to vtk file for debugging
% --debug-CSX Write CSX geometry file to debugCSX.xml % --debug-CSX Write CSX geometry file to debugCSX.xml
% --engine=<type> Choose engine type % --engine=<type> Choose engine type
% --engine=fastest fastest available engine (default) % --engine=fastest fastest available engine (default)
% --engine=basic basic FDTD engine % --engine=basic basic FDTD engine
% --engine=sse engine using sse vector extensions % --engine=sse engine using sse vector extensions
% --engine=sse_compressed engine using compressed operator + sse vector extensions % --engine=sse_compressed engine using compressed operator + sse vector extensions
% --engine=MPI engine using compressed operator + sse vector extensions + MPI parallel processing % --engine=MPI engine using compressed operator + sse vector extensions + MPI parallel processing
% --engine=multithreaded engine using compressed operator + sse vector extensions + MPI + multithreading % --engine=multithreaded engine using compressed operator + sse vector extensions + MPI + multithreading
% --numThreads=<n> Force use n threads for multithreaded engine % --numThreads=<n> Force use n threads for multithreaded engine
% --no-simulation only run preprocessing; do not simulate % --no-simulation only run preprocessing; do not simulate
% %
% Additional global arguments % Additional global arguments
% --showProbeDiscretization Show probe discretization information % --showProbeDiscretization Show probe discretization information
% --nativeFieldDumps Dump all fields using the native field components % --nativeFieldDumps Dump all fields using the native field components
% -v,-vv,-vvv Set debug level: 1 to 3 % -v,-vv,-vvv Set debug level: 1 to 3
% %
% %
% settings: list of Matlab settings % settings: list of Matlab settings
@ -104,7 +104,7 @@ end
savePath = pwd; savePath = pwd;
cd(Sim_Path); cd(Sim_Path);
if (enable_ssh) if (enable_ssh)
scp_options = [scp_options ' -C']; scp_options = [scp_options ' -C'];
ssh_options = [ssh_options ' -x -C']; ssh_options = [ssh_options ' -x -C'];
@ -123,17 +123,17 @@ if (enable_ssh)
error('openEMS:RunOpenEMS', 'unable to find host, abort openEMS'); error('openEMS:RunOpenEMS', 'unable to find host, abort openEMS');
end end
end end
% create a tmp working dir % create a tmp working dir
[status, result] = unix([ssh_command ' ' ssh_options ' ' Settings.SSH.host ' "mktemp -d /tmp/openEMS_XXXXXXXXXXXX"']); [status, result] = unix([ssh_command ' ' ssh_options ' ' Settings.SSH.host ' "mktemp -d /tmp/openEMS_XXXXXXXXXXXX"']);
if (status~=0) if (status~=0)
disp(result); disp(result);
error('openEMS:RunOpenEMS','mktemp failed to create tmp directory!'); error('openEMS:RunOpenEMS','mktemp failed to create tmp directory!');
end end
ssh_work_path = strtrim(result); %remove tailing \n ssh_work_path = strtrim(result); %remove tailing \n
disp(['Running remote openEMS on ' Settings.SSH.host ' at working dir: ' ssh_work_path]); disp(['Running remote openEMS on ' Settings.SSH.host ' at working dir: ' ssh_work_path]);
%copy openEMS all simulation files to the ssh host %copy openEMS all simulation files to the ssh host
[stat, res] = unix([scp_command ' ' scp_options ' * ' Settings.SSH.host ':' ssh_work_path '/']); [stat, res] = unix([scp_command ' ' scp_options ' * ' Settings.SSH.host ':' ssh_work_path '/']);
if (stat~=0) if (stat~=0)
@ -147,7 +147,7 @@ if (enable_ssh)
else else
append_unix = []; append_unix = [];
end end
status = unix([ssh_command ' ' ssh_options ' ' Settings.SSH.host ' "cd ' ssh_work_path ' && ' Settings.SSH.bin ' ' Sim_File ' ' opts '"' append_unix]); status = unix([ssh_command ' ' ssh_options ' ' Settings.SSH.host ' "cd ' ssh_work_path ' && ' Settings.SSH.bin ' ' Sim_File ' ' opts '"' append_unix]);
if (status~=0) if (status~=0)
disp(result); disp(result);
error('openEMS:RunOpenEMS','ssh openEMS failed!'); error('openEMS:RunOpenEMS','ssh openEMS failed!');
@ -160,14 +160,14 @@ if (enable_ssh)
if (stat~=0); if (stat~=0);
disp(res); disp(res);
error('openEMS:RunOpenEMS','scp failed!'); error('openEMS:RunOpenEMS','scp failed!');
end end
%cleanup %cleanup
[stat, res] = unix([ssh_command ' ' ssh_options ' ' Settings.SSH.host ' rm -r ' ssh_work_path]); [stat, res] = unix([ssh_command ' ' ssh_options ' ' Settings.SSH.host ' rm -r ' ssh_work_path]);
if (stat~=0); if (stat~=0);
disp(res); disp(res);
warning('openEMS:RunOpenEMS','remote cleanup failed!'); warning('openEMS:RunOpenEMS','remote cleanup failed!');
end end
else else
args = [Sim_File ' ' opts]; args = [Sim_File ' ' opts];
if isfield(Settings,'LogFile') && isfield(Settings,'Silent') if isfield(Settings,'LogFile') && isfield(Settings,'Silent')
@ -180,6 +180,6 @@ else
invoke_openEMS(args); invoke_openEMS(args);
end end
end end
cd(savePath); cd(savePath);
return return

View File

@ -32,11 +32,11 @@ end
filename = mfilename('fullpath'); filename = mfilename('fullpath');
dir = fileparts( filename ); dir = fileparts( filename );
openEMS_Path = [dir filesep '../..' filesep]; openEMS_Path = [dir filesep '../..' filesep];
if isunix if isunix
openEMS_Path = [openEMS_Path 'openEMS.sh']; openEMS_Path = [openEMS_Path 'openEMS.sh'];
else else
openEMS_Path = [openEMS_Path 'openEMS']; openEMS_Path = [openEMS_Path 'openEMS'];
end end
command = [openEMS_Path ' ' opts]; command = [openEMS_Path ' ' opts];