Changeset 5546


Ignore:
Timestamp:
08/24/10 14:08:32 (15 years ago)
Author:
Eric.Larour
Message:

New runtime name, which is model name + PID + date. Allows multiple runs on same model

Location:
issm/trunk/src/m/classes
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/@model/model.m

    r5524 r5546  
    1212        %Model general information
    1313        md.notes='';
    14         md.name='';
     14        md.name='';
     15        md.runtimename=''; %name used when running a parallel job
    1516        md.counter=0; %1 mesh, 2 geography, 3 parameterize
    1617        md.domainoutline=NaN;
  • issm/trunk/src/m/classes/public/loadresultsfromcluster.m

    r5162 r5546  
    1010%Figure out parameters for this particular cluster
    1111[codepath,executionpath,login,port]=ClusterParameters(md.cluster,cluster_rc_location);
     12
     13%Figure out the  directory where all the files are in:
     14directory=[executionpath '/' md.runtimename '/'];
    1215
    1316%What packages are we picking up from remote cluster
     
    2629
    2730%copy files from cluster to present directory
    28 issmscpin(md.cluster, login, port, executionpath, packages);
     31issmscpin(md.cluster, login, port, directory, packages);
    2932
    3033%read log files onto  fields
  • issm/trunk/src/m/classes/public/queue/ClusterLaunchCommand.m

    r3176 r5546  
    1 function command=ClusterLaunchCommand(cluster,name,executionpath)
     1function command=ClusterLaunchCommand(cluster,runtimename,name,executionpath)
    22%CLUSTERLAUNCHCOMMAND: build command to launch job on cluster
    33%
     
    77%if cluster is current hostname, just source queue file
    88if strcmpi(oshostname(),cluster),
    9         command=['cd ' executionpath ' && source ' name '.queue '];
     9        command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxvf ' runtimename '.tar.gz  && source ' name '.queue '];
    1010else
    1111        if strcmpi(cluster,'cosmos'),
    12                 command=['cd ' executionpath ' && rm -rf ' name '.lock ' name '.outlog ' name '.errlog ' name '.outbin && qsub -S/bin/sh ' name '.queue '];
     12                command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxvf ' runtimename '.tar.gz && qsub -S/bin/sh ' name '.queue '];
    1313        elseif strcmpi(cluster,'gemini'),
    14                 command=['cd ' executionpath ' && rm -rf ' name '.lock ' name '.outlog ' name '.errlog ' name '.outbin && qsub ' name '.queue '];
     14                command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxvf ' runtimename '.tar.gz && qsub ' name '.queue '];
    1515        elseif strcmpi(cluster,'pollux'),
    16                 command=['cd ' executionpath ' && rm -rf ' name '.lock ' name '.outlog ' name '.errlog ' name '.outbin && qsub ' name '.queue '];
     16                command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxvf ' runtimename '.tar.gz && qsub ' name '.queue '];
    1717        elseif strcmpi(cluster,'castor'),
    18                 command=['cd ' executionpath ' && rm -rf ' name '.lock ' name '.outlog ' name '.errlog ' name '.outbin && qsub ' name '.queue '];
     18                command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxvf ' runtimename '.tar.gz && qsub ' name '.queue '];
    1919        elseif strcmpi(cluster,'pfe'),
    20                 command=['cd ' executionpath ' && rm -rf ' name '.lock ' name '.outlog ' name '.errlog ' name '.outbin && qsub ' name '.queue '];
     20                command=['cd ' executionpath ' && rm -rf ./' runtimename ' && mkdir ' runtimename ' && cd ' runtimename ' && mv ../' runtimename '.tar.gz ./ && tar -zxvf ' runtimename '.tar.gz && qsub ' name '.queue '];
    2121        else
    2222                error('ClusterLaunchCommand error message: unknown cluster command');
  • issm/trunk/src/m/classes/public/queue/ClusterScript.m

    r5264 r5546  
    1111        fprintf(fid,'#!/bin/bash\n');
    1212        fprintf(fid,'#PBS -l select=%i:ncpus=1\n',np);
     13        fprintf(fid,'#PBS -N %s\n',name);
    1314        fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds.
    1415        fprintf(fid,'#PBS -q %s\n',queue);
     
    2627
    2728        fprintf(fid,'#!/bin/sh\n');
    28         fprintf(fid,'rm -rf %s/%s.lock\n',executionpath,name);
    2929        if mem_debug==0,
    3030                fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',np,codepath,EnumToString(analysis_type),executionpath,name,name,name,name,name);
     
    3939        fprintf(fid,'#!/bin/sh\n');
    4040        fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds.
     41        fprintf(fid,'#PBS -N %s\n',name);
    4142        fprintf(fid,'#PBS -l ncpus=%i\n',np);
    4243        if ~isempty(queue),
  • issm/trunk/src/m/classes/public/queue/LaunchQueueJob.m

    r3173 r5546  
    2121if ~strcmpi(options.batch,'yes'),
    2222       
    23         %what files are we sending?
    24         packages={[md.name '.bin'],[md.name '.queue']};
     23        %compress the files into one zip.
     24        compressstring=['tar -zcvf ' md.runtimename '.tar.gz ' md.name '.bin ' md.name '.queue '];
    2525        if md.qmu_analysis,
    26                 packages{end+1}=[md.name '.qmu.in'];
     26                compressstring=[compressstring md.name '.qmu.in'];
    2727        end
    28 
     28        system(compressstring);
     29       
    2930        disp('uploading input file and queueing script');
    30         issmscpout(md.cluster,executionpath,login,port,packages);
     31        issmscpout(md.cluster,executionpath,login,port,{[md.runtimename '.tar.gz']});
    3132
    3233        disp('launching solution sequence on remote cluster');
    33         issmssh(md.cluster,login,port,ClusterLaunchCommand(md.cluster,md.name,executionpath));
     34        issmssh(md.cluster,login,port,ClusterLaunchCommand(md.cluster,md.runtimename,md.name,executionpath));
    3435
    3536else
  • issm/trunk/src/m/classes/public/solveparallel.m

    r5357 r5546  
    55%      md=solveparallel(md);
    66
     7%First, build a runtime name that is unique, that we will use to create
     8%directories, name jobs, etc ...
     9c=clock;
     10md.runtimename=sprintf('%s-%i-%i-%i-%i-%i-%i',md.name,GetPId,c(2),c(3),c(1),c(4),c(5));
    711
    812%Get cluster.rc location
     
    1115%Figure out parameters for this particular cluster
    1216[codepath,executionpath,login,port]=ClusterParameters(md.cluster,cluster_rc_location);
    13 
    14 %Append name of directory if specified in options:
    15 executionpath=[executionpath '/' options.directory];
    1617
    1718%Marshall model data into a binary file.
  • issm/trunk/src/m/classes/public/waitonlock.m

    r5299 r5546  
    99
    1010%Get filename (lock file) and options
    11 filename=[executionpath '/' md.name '.lock'];
     11filename=[executionpath '/' md.runtimename '/' md.name '.lock'];
    1212cluster=md.cluster;
    1313timelimit=md.waitonlock;
     
    2222                time=0; ispresent=0;
    2323                while (ispresent==0 & time<timelimit)
    24                         [status, result]=system(['ssh -q -p ' num2str(port) ' ' login '@localhost "if ( -e ' executionpath '/' md.name '.lock ) echo 1"']);
     24                        [status, result]=system(['ssh -q -p ' num2str(port) ' ' login '@localhost "if ( -e ' executionpath '/' md.runtimename '/' md.name '.lock ) echo 1"']);
     25                        result
    2526                        if ~isempty(result),
    2627                                if ismember('1',result),
Note: See TracChangeset for help on using the changeset viewer.