Changeset 2555


Ignore:
Timestamp:
10/28/09 08:41:52 (15 years ago)
Author:
Mathieu Morlighem
Message:

Now if waitonlock is activated and the job is not running on the same machine, ask the user to input 'y' one the job is completed and the results are automaticaly loaded

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

Legend:

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

    r2049 r2555  
    11function md=LaunchQueueJobGeneric(md,executionpath,options)
    2 %LAUNCHQUEUEJOBGENERIC - ...
     2%LAUNCHQUEUEJOBGENERIC - Generic routine to launch queueing job
    33%
    44%   Usage:
     
    2828        issmssh(md.cluster,['cd ' executionpath ' && source ' md.name '.queue ']);
    2929
    30         %waitonlock will work if the lock is on the same machine only:
    31         if ~strcmpi(oshostname(),md.cluster),
    32                 disp('solution launched on remote cluster. log in to detect job completion, then run md=loadresultsfromcluster(md)');
    33                 md.waitonlock=0;
    34         end
    35 
    3630else
    3731        disp('batch mode requested: not launching job interactively');
    3832        disp(['launch solution sequence by copying files ' md.name '.bin' ',' md.name '.queue and ' md.name '.qmu.in, onto remote cluster ' md.cluster]);
    3933        disp(['   then log int ' md.cluster ' and source queue file ' md.name '.queue']);
    40         md.waitonlock=0;
    4134end
  • issm/trunk/src/m/classes/public/LaunchQueueJobcosmos.m

    r2537 r2555  
    1818        disp('uploading input file,  queueing script and variables script');
    1919        if md.qmu_analysis,
    20                 eval(['!scp ' md.name '.bin' ' ' md.name '.queue '  md.name '.qmu.in ' md.cluster ':' executionpath]);
     20                system(['scp ' md.name '.bin' ' ' md.name '.queue '  md.name '.qmu.in ' md.cluster ':' executionpath]);
    2121        else
    22                 eval(['!scp ' md.name '.bin' ' ' md.name '.queue '  md.cluster ':' executionpath]);
     22                system(['scp ' md.name '.bin' ' ' md.name '.queue '  md.cluster ':' executionpath]);
    2323        end
    2424
     
    3131        disp(['launch solution sequence on remote cluster by logging into it and typing qsub -S/bin/csh ' md.name '.queue']);
    3232end
    33 md.waitonlock=0; %cannot wait for lock
  • issm/trunk/src/m/classes/public/LaunchQueueJobgemini.m

    r2537 r2555  
    1818        disp('uploading input file,  queueing script and variables script');
    1919        if md.qmu_analysis,
    20                 eval(['!scp ' md.name '.bin' ' ' md.name '.queue '  md.name '.qmu.in ' md.cluster ':' executionpath]);
     20                system(['scp ' md.name '.bin' ' ' md.name '.queue '  md.name '.qmu.in ' md.cluster ':' executionpath]);
    2121        else
    22                 eval(['!scp ' md.name '.bin' ' ' md.name '.queue '  md.cluster ':' executionpath]);
     22                system(['scp ' md.name '.bin' ' ' md.name '.queue '  md.cluster ':' executionpath]);
    2323        end
    2424       
     
    3131        disp(['launch solution sequence on remote cluster by logging into it and typing qsub < ' md.name '.queue']);
    3232end
    33 md.waitonlock=0; %cannot wait for lock
  • issm/trunk/src/m/classes/public/LaunchQueueJobgreenplanet.m

    r2378 r2555  
    1818        disp('uploading input file,  queueing script and variables script');
    1919        if md.qmu_analysis,
    20                 eval(['!scp -P 1025 -o HostKeyAlias=huey.jpl.nasa.gov ' md.name '.bin' ' ' md.name '.queue '  md.name '.qmu.in elarour@localhost:' executionpath]);
     20                system(['scp -P 1025 -o HostKeyAlias=huey.jpl.nasa.gov ' md.name '.bin' ' ' md.name '.queue '  md.name '.qmu.in elarour@localhost:' executionpath]);
    2121        else
    22                 eval(['!scp -P 1025 -o HostKeyAlias=huey.jpl.nasa.gov ' md.name '.bin' ' ' md.name '.queue elarour@localhost:' executionpath ]);
     22                system(['scp -P 1025 -o HostKeyAlias=huey.jpl.nasa.gov ' md.name '.bin' ' ' md.name '.queue elarour@localhost:' executionpath ]);
    2323        end
    2424else
     
    2828%new greenplanet cannot launch across cluster using ssh
    2929disp(['launch solution sequence on remote cluster by logging into it and typing qsub < ' md.name '.queue']);
    30 md.waitonlock=0;
  • issm/trunk/src/m/classes/public/solveparallel.m

    r2330 r2555  
    2525md=LaunchQueueJob(md,executionpath,options);
    2626
    27 %timing
    28 t1=clock;
    29 
    3027%Do we return, or just wait for results?
    3128if md.waitonlock~=0,
    3229        %we wait for the done file
    33         islock=waitonlock([executionpath '/' md.name '.lock'],md.waitonlock);
     30        islock=waitonlock(md,executionpath);
    3431        if islock==0,
    3532                %no results to be loaded
    36                 disp('The results must be loaded manually with loadmodelfromcluster.');
    37                 error(['solveparallel info message: time limit exceeded'])
     33                disp('The results must be loaded manually with md=loadmodelfromcluster(md).');
    3834        else
    3935                %load results
    40                 %stop timing
    41                 t2=clock;
    42                 displaystring(md.verbose,'\n%s\n',['solution converged in ' num2str(etime(t2,t1)) ' seconds']);
    43 
    4436                displaystring(md.verbose,'loading results from cluster');
    4537                md=loadresultsfromcluster(md);
  • issm/trunk/src/m/classes/public/waitonlock.m

    r2226 r2555  
    1 function flag=waitonlock(filename,timelimit)
     1function flag=waitonlock(md,executionpath)
    22%WAITONLOCK - wait for a file
    33%
     
    66%
    77%   Usage:
    8 %      flag=waitonlock(filename,timelimit)
     8%      flag=waitonlock(md,executionpath)
    99
    10 %initialize time and file presence test flag
    11 time=0;
    12 ispresent=0;
    13 disp(['waiting for ' filename ' hold on... (Ctrl+C to exit)'])
     10%Get filename (lock file) and options
     11filename=[executionpath '/' md.name '.lock'];
     12cluster=md.cluster;
     13timelinit=md.waitonlock;
    1414
    15 %loop till file .lock exist or time is up
    16 while (ispresent==0 & time<timelimit)
    17         ispresent=exist(filename,'file');
    18         pause(1);
    19         time=time+1/60;
     15%waitonlock will work if the lock is on the same machine only:
     16if ~strcmpi(oshostname(),cluster),
     17        disp('solution launched on remote cluster. log in to detect job completion.');
     18        choice=input('Is the job successfully completed? (y/n)','s');
     19        if ~strcmp(choice,'y'),
     20                disp('Results not loaded... exiting');
     21                flag=0;
     22        else
     23                flag=1;
     24        end
     25
     26%job is running on the same machine
     27else
     28
     29        %initialize time and file presence test flag
     30        time=0; ispresent=0;
     31        disp(['waiting for ' filename ' hold on... (Ctrl+C to exit)'])
     32
     33        %loop till file .lock exist or time is up
     34        while (ispresent==0 & time<timelimit)
     35                ispresent=exist(filename,'file');
     36                pause(1);
     37                time=time+1/60;
     38        end
     39
     40        %build output
     41        if (time>timelimit),
     42                disp(['waitonlock info message: time limit exceeded']);
     43                flag=0;
     44        else
     45                flag=1;
     46        end
    2047end
    21 
    22 %build output
    23 if (time>timelimit),
    24         flag=0;
    25 else
    26         flag=1;
    27 end
Note: See TracChangeset for help on using the changeset viewer.