Changeset 487


Ignore:
Timestamp:
Jun 28, 2012, 12:16:58 PM (12 years ago)
Author:
sommeria
Message:

Problems with the new launch_jobs resolved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r486 r487  
    13081308        switch Param.Program
    13091309            case {'civ_matlab'}
    1310                 filename_bat=regexprep(Param.OutputFile,'(\w+)([/\\])(\w+$)','$1$20_BAT$2$3.m');
     1310                filename_bat=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_BAT$2$3.m');
     1311                filename_bat=regexprep(filename_bat,'-','__');
    13111312            case {'CivX','CivAll','civ_matlab.sh'}
    13121313                switch computer
    13131314                    case {'PCWIN','PCWIN64'}
    1314                         filename_bat=regexprep(Param.OutputFile,'(\w+)([/\\])(\w+$)','$1$20_BAT$2$3.bat');
     1315                        filename_bat=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_BAT$2$3.bat');
    13151316                    case {'GLNX86','GLNXA64','MACI64'}
    1316                         filename_bat=regexprep(Param.OutputFile,'(\w+)([/\\])(\w+$)','$1$20_BAT$2$3.sh');
     1317                        filename_bat=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_BAT$2$3.sh');
    13171318                end
    13181319        end
     
    13291330        % special case for civ_matlab on cluster
    13301331        if strcmp(Param.Program,'civ_matlab') && strcmp(Param.RunMode,'cluster')
    1331             filename_bat2=regexprep(Param.OutputFile,'(\w+)([/\\])(\w+$)','$1$20_BAT$2$3.sh');
     1332            filename_bat2=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_BAT$2$3.sh');
    13321333            [fid,message]=fopen(filename_bat2,'w');
    13331334            if isequal(fid,-1)
     
    39813982    case 'CivX'
    39823983        if Param.CheckCiv1
    3983             filename=regexprep(Param.OutputFile,'(\w+)([/\\])(\w+$)','$1$20_CMX$2$3.civ1.cmx');
     3984            filename=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_CMX$2$3.civ1.cmx');
    39843985            if isequal(Param.Civ1.Dt,0)
    39853986                Param.Civ1.Dt=1 ;%case of 'displacement' mode
     
    40484049       
    40494050        if Param.CheckCiv2
    4050             filename=regexprep(Param.OutputFile,'(\w+)([/\\])(\w+$)','$1$20_CMX$2$3.civ2.cmx');
     4051            filename=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_CMX$2$3.civ2.cmx');
    40514052
    40524053            if isequal(Param.Civ2.Dt,'0')
     
    41214122        end
    41224123    case {'civ_matlab','civ_matlab.sh'}
    4123         filename=regexprep(Param.OutputFile,'(\w+)([/\\])(\w+$)','$1$20_XML$2$3.xml');
     4124        filename=regexprep(Param.OutputFile,'(.+)([/\\])(.+$)','$1$20_XML$2$3.xml');
    41244125        save(struct2xml(Param),filename);
    41254126end
     
    41344135    case 'CivX'
    41354136        if isunix % check: necessaire aussi en RUN?
    4136             cmd=[cmd '#!/bin/bash \n '...
    4137                 '#$ -cwd \n '...
    4138                 'hostname && date \n '...
     4137            cmd=[cmd '#!/bin/bash \n'...
     4138                '#$ -cwd \n'...
     4139                'hostname && date \n'...
    41394140                'umask 002 \n'];%allow writting access to created files for user group
    41404141        end
    41414142    case 'CivAll'
    41424143        if isunix % check: necessaire aussi en RUN?
    4143             cmd=[cmd '#!/bin/bash \n '...
    4144                 '#$ -cwd \n '...
    4145                 'hostname && date \n '...
     4144            cmd=[cmd '#!/bin/bash \n'...
     4145                '#$ -cwd \n'...
     4146                'hostname && date \n'...
    41464147                'umask 002 \n'];%allow writting access to created files for user group
    41474148        end
     
    41544155        case 'CivX'
    41554156            if(isunix) %unix (or Mac) system
    4156                 cmd=[cmd 'cp -f ' regexprep(filename,'(\w+)/(\w+$)','$1/0_CMX/$2.civ1.cmx ') regexprep(filename,'(\w+)/(\w+$)','$1/$2.cmx \n')...% the cmx file gives the name to the nc file
    4157                     Param.xml.Civ1Bin ' -f ' regexprep(filename,'(\w+)/(\w+$)','$1/$2.cmx >') regexprep(filename,'(\w+)/(\w+$)','$1/0_LOG/$2.civ1.log \n')... % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx
    4158                     'rm ' regexprep(filename,'(\w+)/(\w+$)','$1/$2.cmx \n')];
     4157                cmd=[cmd 'cp -f ' regexprep(filename,'(.+)/(.+$)','$1/0_CMX/$2.civ1.cmx ') regexprep(filename,'(.+)/(.+$)','$1/$2.cmx \n')...% the cmx file gives the name to the nc file
     4158                    Param.xml.Civ1Bin ' -f ' regexprep(filename,'(.+)/(.+$)','$1/$2.cmx >') regexprep(filename,'(.+)/(.+$)','$1/0_LOG/$2.civ1.log \n')... % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx
     4159                    'rm ' regexprep(filename,'(.+)/(.+$)','$1/$2.cmx \n')];
    41594160            else %Windows system
    41604161                filename=regexprep(filename,'\\','\\\\');
    4161                 cmd=['copy /Y ' regexprep(filename,'(\w+)\\\\(\w+$)','"$1\\\\0_CMX\\\\$2.civ1.cmx" ') regexprep(filename,'(\w+)\\\\(\w+$)','"$1\\\\$2.civ1.cmx" \n')...
    4162                     '"' regexprep(Param.xml.Civ1Bin,'\\','\\\\') '" -f ' regexprep(filename,'(\w+)\\\\(\w+$)','"$1\\\\$2.cmx" > ')...
    4163                     regexprep(filename,'(\w+)\\\\(\w+$)','"$1\\\\0_LOG\\\\$2.civ1.log" \n')... % redirect standard output to the log file
    4164                     'del ' regexprep(filename,'(\w+)\\\\(\w+$)','"$1\\\\$2.cmx" \n')];
     4162                cmd=['copy /Y ' regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\0_CMX\\\\$2.civ1.cmx" ') regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\$2.civ1.cmx" \n')...
     4163                    '"' regexprep(Param.xml.Civ1Bin,'\\','\\\\') '" -f ' regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\$2.cmx" > ')...
     4164                    regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\0_LOG\\\\$2.civ1.log" \n')... % redirect standard output to the log file
     4165                    'del ' regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\$2.cmx" \n')];
    41654166            end
    41664167        case 'CivAll'
     
    42614262        case 'CivX'
    42624263            if(isunix)
    4263                 cmd=[cmd 'cp -f '  regexprep(filename,'(\w+)/(\w+$)','$1/0_CMX/$2.civ2.cmx ') regexprep(filename,'(\w+)/(\w+$)','$1/$2.cmx \n')...
    4264                     Param.xml.Civ2Bin ' -f ' regexprep(filename,'(\w+)/(\w+$)','$1/$2.cmx >') regexprep(filename,'(\w+)/(\w+$)','$1/0_LOG/$2.civ2.log \n')...% redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx
    4265                     'rm ' regexprep(filename,'(\w+)/(\w+$)','$1/$2.cmx \n')];%rename .cmx as .checkciv2.cmx, the result file is named [filename '.nc'] by CIVx
     4264                cmd=[cmd 'cp -f '  regexprep(filename,'(.+)/(.+$)','$1/0_CMX/$2.civ2.cmx ') regexprep(filename,'(.+)/(.+$)','$1/$2.cmx \n')...
     4265                    Param.xml.Civ2Bin ' -f ' regexprep(filename,'(.+)/(.+$)','$1/$2.cmx >') regexprep(filename,'(.+)/(.+$)','$1/0_LOG/$2.civ2.log \n')...% redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx
     4266                    'rm ' regexprep(filename,'(.+)/(.+$)','$1/$2.cmx \n')];%rename .cmx as .checkciv2.cmx, the result file is named [filename '.nc'] by CIVx
    42664267            else
    42674268                filename=regexprep(filename,'\\','\\\\');
    4268                 cmd=[cmd 'copy /Y ' regexprep(filename,'(\w+)\\\\(\w+$)','"$1\\\\0_CMX\\\\$2.civ2.cmx" ') regexprep(filename,'(\w+)\\\\(\w+$)','"$1\\\\$2.cmx" \n')...
    4269                     '"' regexprep(Param.xml.Civ2Bin,'\\','\\\\') '" -f "' regexprep(filename,'(\w+)\\\\(\w+$)','"$1\\\\$2.cmx" > ')...
    4270                      regexprep(filename,'(\w+)\\\\(\w+$)','"$1\\\\0_LOG\\\\$2.civ2.log" \n')... % redirect standard output to the log file
    4271                     'del ' regexprep(filename,'(\w+)\\\\(\w+$)','"$1\\\\$2.cmx" \n')];
     4269                cmd=[cmd 'copy /Y ' regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\0_CMX\\\\$2.civ2.cmx" ') regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\$2.cmx" \n')...
     4270                    '"' regexprep(Param.xml.Civ2Bin,'\\','\\\\') '" -f "' regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\$2.cmx" > ')...
     4271                     regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\0_LOG\\\\$2.civ2.log" \n')... % redirect standard output to the log file
     4272                    'del ' regexprep(filename,'(.+)\\\\(.+$)','"$1\\\\$2.cmx" \n')];
    42724273            end
    42734274        case 'CivAll'
     
    43764377                        case {'GLNX86','GLNXA64','MACI64'}
    43774378                    end
    4378         cmd=['civ_matlab(''' regexprep(filename,'(\w+)([/\\])(\w+$)','$1$20_XML$2$3.xml') ''','''...
     4379        cmd=['civ_matlab(''' regexprep(filename,'(.+)([/\\])(.+$)','$1$20_XML$2$3.xml') ''','''...
    43794380            filename '.nc'');'];
    43804381    case 'civ_matlab.sh'
     
    43884389                    'hostname && date \n '...
    43894390                    'umask 002 \n'...
    4390                     Param.xml.CivmBin ' ' Param.xml.RunTime ' ' regexprep(filename,'(\w+)([/\\])(\w+$)','$1$20_XML$2$3.xml') ' ' Param.OutputFile '.nc'];%allow writting access to created files for user group
     4391                    Param.xml.CivmBin ' ' Param.xml.RunTime ' ' regexprep(filename,'(.+)([/\\])(.+$)','$1$20_XML$2$3.xml') ' ' Param.OutputFile '.nc'];%allow writting access to created files for user group
    43914392        end
    43924393end   
     
    44144415        ' -fi2 ' fi2_value ' -fi3 ' num2str(Param.(fixname).CheckF3) ...
    44154416        ' -threshC ' num2str(Param.(fixname).MinCorr) MaxVel_string MaskName_string...
    4416         ' >' regexprep(filename,'(\w+)/(\w+$)','$1/0_LOG/$2.')  lower(fixname) '.log 2>&1'];
     4417        ' >' regexprep(filename,'(.+)/(.+$)','$1/0_LOG/$2.')  lower(fixname) '.log 2>&1'];
    44174418else
    44184419    cmd=['"' Param.xml.FixBin '" -f "' filename '.nc" -fi1 ' num2str(Param.(fixname).CheckFmin2)...
     
    44384439        ' -n ' num2str(Param.(patchname).Ny) ' -ro ' num2str(Param.(patchname).FieldSmooth)...
    44394440        ' -nopt ' num2str(Param.(patchname).SubdomainSize) ...
    4440         '  > ' regexprep(filename,'(\w+)/(\w+$)','$1/0_LOG/$2.')  lower(patchname) '.log 2>&1']; % redirect standard output to the log file
     4441        '  > ' regexprep(filename,'(.+)/(.+$)','$1/0_LOG/$2.')  lower(patchname) '.log 2>&1']; % redirect standard output to the log file
    44414442else
    44424443    cmd=['"' Param.xml.PatchBin...
Note: See TracChangeset for help on using the changeset viewer.