Changeset 18089


Ignore:
Timestamp:
06/03/14 04:59:08 (11 years ago)
Author:
Eric.Larour
Message:

CHG: fixed issue for users of csh and tcsh shell. Needed to add \n at end of line.
Also created a new field 'shell' in the generic cluster, which defaults to '/bin/sh'. This
field can be changed to '/bin/csh'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/clusters/generic.m

    r17720 r18089  
    2020                valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
    2121                verbose=1;
     22                shell='/bin/sh';
    2223                %}}}
    2324        end
     
    7071                        disp(sprintf('    valgrindsup: %s',cluster.valgrindsup));
    7172                        disp(sprintf('    verbose: %s',cluster.verbose));
     73                        disp(sprintf('    shell: %s',cluster.shell));
    7274                end
    7375                %}}}
     
    8789
    8890                                fid=fopen([modelname '.queue'],'w');
    89                                 fprintf(fid,'#!/bin/sh\n');
     91                                fprintf(fid,'#!%s\n',cluster.shell);
    9092                                if ~isvalgrind,
    9193                                        if cluster.interactive
    9294                                                if IssmConfig('_HAVE_MPI_'),
    93                                                         fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
     95                                                        fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s \n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
    9496                                                else
    9597                                                        fprintf(fid,'%s/issm.exe %s %s %s ',cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
     
    202204
    203205                        if ~ispc,
     206
     207                                %figure out what shell extension we will use:
     208                                if isempty(strfind(cluster.shell,'csh')),
     209                                        shellext='sh';
     210                                else
     211                                        shellext='csh';
     212                                end
     213
    204214                                %compress the files into one zip.
    205215                                compressstring=['tar -zcf ' dirname '.tar.gz '];
     
    216226
    217227                                if cluster.verbose, disp('launching solution sequence on remote cluster'); end
    218                                 launchcommand=['source ' cluster.etcpath '/environment.sh && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
     228                                launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
    219229                                        ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && source  ' modelname '.queue '];
    220230                                issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
Note: See TracChangeset for help on using the changeset viewer.