loadresultsfromcluster

PURPOSE ^

LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster

SYNOPSIS ^

function md=loadresultsfromcluster(md,solutiontype)

DESCRIPTION ^

LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster

   Usage:
      md=loadresultsfromcluster(md,solutiontype);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function md=loadresultsfromcluster(md,solutiontype)
0002 %LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
0003 %
0004 %   Usage:
0005 %      md=loadresultsfromcluster(md,solutiontype);
0006 
0007 %Get cielo.rc location
0008 cielo_rc_location=which('cielo.rc');
0009 
0010 %Figure out parameters for this particular cluster
0011 [codepath,executionpath]=ProcessParallelParametersFromCieloRc(md.cluster,cielo_rc_location);
0012 
0013 %if we are running locally, no need to call ssh to recover the logs and results. We figure out by comparing the
0014 %hostname to the cluster name
0015 [result,hostname]=system('hostname -s');hostname=hostname(1:end-1);
0016 
0017 %Go pickup output file and logs on cluster
0018 if strcmpi(hostname,md.cluster),
0019     system(['cp ' executionpath '/' md.name '.*o* ./']); %get outlog, errlog and outbin files
0020 else
0021     system(['scp ' md.cluster ':' executionpath '/' md.name '.*o* ./']); %get outlog, errlog and outbin files
0022 end
0023 
0024 %read log files onto  fields
0025 md.errlog=readfile([md.name '.errlog']);
0026 md.outlog=readfile([md.name '.outlog']);
0027 
0028 if ~isempty(md.errlog),
0029     disp(['loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields']);
0030 end
0031 
0032 %If we are here, no errors in the solution sequence, call loadresultsfromdisk.
0033 md=loadresultsfromdisk(md,[md.name '.outbin'],solutiontype);
0034 
0035 %erase the log and output files
0036 system(['rm -rf ' md.name '.outlog ' md.name '.errlog' md.name '.outbin']);

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003