Changeset 1584


Ignore:
Timestamp:
08/05/09 13:58:13 (16 years ago)
Author:
Eric.Larour
Message:

simplified script that uses OS tools

Location:
issm/trunk/src/m/classes/public
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/LaunchQueueJobGeneric.m

    r1464 r1584  
    1414end
    1515
    16 if ispc,
    17         SCP='winscp';
    18 else
    19         SCP='scp';
    20 end
    21 
    2216if ~strcmpi(options.batch,'yes'),
    2317
    24         %if we are running locally, no need to call ssh to launch the job. We figure out by comparing the
    25         %hostname to the cluster name
    26         [result,hostname]=system('hostname -s');hostname=hostname(1:end-1);
    27         disp('uploading input file and queueing script');
    28         if strcmpi(hostname,md.cluster),
    29                 if md.qmu_analysis,
    30                         system(['cp ' md.name '.bin' ' ' md.name '.queue ' md.name '.qmu.in ' ' ' executionpath]);
    31                 else
    32                         system(['cp ' md.name '.bin' ' ' md.name '.queue' ' ' executionpath]);
    33                 end
    34         else
    35                 if md.qmu_analysis,
    36                         system([SCP ' -v ' md.name '.bin' ' ' md.name '.queue ' md.name '.qmu.in ' ' ' md.cluster ':' executionpath]);
    37                 else
    38                         system([SCP ' -v ' md.name '.bin' ' ' md.name '.queue' ' ' md.cluster ':' executionpath]);
    39                 end
     18        %what files are we sending?
     19        packages={[md.name '.bin'],[md.name '.queue']};
     20        if md.qmu_analysis,
     21                packages{end+1}=[md.name '.qmu.in '];
    4022        end
    4123
     24        disp('uploading input file and queueing script');
     25        scpout(md.cluster,executionpath,packages);
     26       
    4227        disp('launching solution sequence on remote cluster');
    43         %now call the queuing script to launch the job.
    44         if strcmpi(hostname,md.cluster),
    45                 system(['cd ' executionpath ' && source ' md.name '.queue ']);
    46         else
    47                 system(['ssh  ' md.cluster ' ''cd ' executionpath ' && source ' md.name '.queue ''']);
     28        issmssh(md.cluster,['cd ' executionpath ' && source ' md.name '.queue ']);
     29
     30        %waitonlock will work if the lock is on the same machine only:
     31        if ~strcmpi(hostname,md.cluster),
     32                disp('solution launched on remote cluster. log in to detect job completion, then run md=loadresultsfromcluster(md)');
     33                md.waitonlock=0;
    4834        end
    4935
     
    5440        md.waitonlock=0;
    5541end
    56 
    57 
  • issm/trunk/src/m/classes/public/loadresultsfromcluster.m

    r1111 r1584  
    1111[codepath,executionpath]=ClusterParameters(md.cluster,cluster_rc_location);
    1212
    13 %if we are running locally, no need to call ssh to recover the logs and results. We figure out by comparing the
    14 %hostname to the cluster name
    15 [result,hostname]=system('hostname -s');hostname=hostname(1:end-1);
     13%What packages are we picking up from remote cluster
     14packages={[md.name '.outlog'],[md.name '.errlog'], [md.name '.outbin']};
     15if md.qmu_analysis,
     16        packages{end+1}=[md.name '.qmu.err'];
     17        packages{end+1}=[md.name '.qmu.out'];
     18        packages{end+1}='dakota_tabular.dat';
     19end
    1620
    17 %Go pickup output file and logs on cluster
    18 if strcmpi(hostname,md.cluster),
    19         if md.qmu_analysis,
    20                 system(['cp ' executionpath '/' md.name '.outlog ' executionpath '/' md.name '.errlog ' executionpath '/' md.name '.outbin ' executionpath '/' md.name '.qmu.err ' executionpath '/' md.name '.qmu.out ' executionpath '/dakota_tabular.dat ./']); %get outlog, errlog and outbin files
    21         else
    22                 system(['cp ' executionpath '/' md.name '.outlog ' executionpath '/' md.name '.errlog ' executionpath '/' md.name '.outbin ./']); %get outlog, errlog and outbin files
    23         end
    24 else
    25         if md.qmu_analysis,
    26                 system(['scp ' md.cluster ':' executionpath '/' md.name '.outlog ' md.cluster ':' executionpath '/' md.name '.errlog ' md.cluster ':' executionpath '/' md.name '.outbin ' md.cluster ':' executionpath '/' md.name '.qmu.err ' md.cluster ':' executionpath '/' md.name '.qmu.out ' md.cluster ':' executionpath '/dakota_tabular.dat ./']); %get outlog, errlog and outbin files
    27         else
    28                 system(['scp ' md.cluster ':' executionpath '/' md.name '.outlog ' md.cluster ':' executionpath '/' md.name '.errlog ' md.cluster ':' executionpath '/' md.name '.outbin ./']); %get outlog, errlog and outbin files
    29         end
    30 end
     21%copy files from cluster to present directory
     22scpin(md.cluster, executionpath, packages);
    3123
    3224%read log files onto  fields
Note: See TracChangeset for help on using the changeset viewer.