Changeset 23074


Ignore:
Timestamp:
08/07/18 20:02:12 (7 years ago)
Author:
dmenemen
Message:

speeding up test by downloading and building MITgcm only if needed

Location:
issm/trunk-jpl/test
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/test/MITgcm/build.sh

    r22669 r23074  
    66modelpath="$2"
    77
    8 if [ -e ~/.bashrc ]; then
    9         source ~/.bashrc
     8#if [ -e ~/.bashrc ]; then
     9#    source ~/.bashrc
     10#fi
     11
     12# Get MITgcm code, if needed
     13if [ ! -d "$modelpath/../MITgcm/install" ]; then
     14    cd $modelpath/../MITgcm
     15    source install.sh
     16    cd $modelpath
    1017fi
    1118
    12 # Clean up build directory
     19# Create build directory, if needed
    1320cd $modelpath
    1421if [ ! -d "build" ]; then mkdir build; fi
    15 rm -f build/*
     22cd build
    1623
    17 # Get MITgcm code, if needed
    18 if [ ! -d "$SLR_DIR/components/mitgcm/install" ]; then
    19    cd $modelpath/../MITgcm
    20    source install.sh
    21    cd $modelpath
     24#create MITgcm makefile for this run, if needed
     25if [ ! -f Makefile ]; then
     26    if [ $hostname == "pleiades" ]; then
     27        $modelpath/../MITgcm/install/tools/genmake2 -of $SLR_DIR/models/ice-ocean/configs/linux_amd64_gfortran+mpi_ice_nas -mo ../code -rd $modelpath/../MITgcm/install
     28    else
     29        $modelpath/../MITgcm/install/tools/genmake2 -mpi -mo $modelpath/../MITgcm/code -rd $modelpath/../MITgcm/install
     30    fi
    2231fi
    2332
    24 #create MITgcm makefile and code links for this run
    25 cd build
    26 if [ ! -f Makefile ]; then
    27 
    28         if [ $hostname == "pleiades" ]; then
    29                 $SLR_DIR/components/mitgcm/install/tools/genmake2 -of $SLR_DIR/models/ice-ocean/configs/linux_amd64_gfortran+mpi_ice_nas -mo ../code -rd $SLR_DIR/components/mitgcm/install
    30         else
    31                 $modelpath/../MITgcm/install/tools/genmake2 -mpi -mo $modelpath/../MITgcm/code -rd $modelpath/../MITgcm/install
    32         fi
     33#create MITgcm code links for this run, if needed
     34if [ ! -f BUILD_INFO.h ]; then
    3335    make depend
    3436fi
     37
    3538make -j 4
  • issm/trunk-jpl/test/NightlyRun/test4001.m

    r23018 r23074  
    136136
    137137    %specify computational grid in SIZE.h
    138     fidi=fopen('../MITgcm/code/SIZE.h.bak','r');
    139     fido=fopen('../MITgcm/code/SIZE.h','w');
    140     tline = fgetl(fidi);
    141     fprintf(fido,'%s\n',tline);
    142     while 1
     138    if ~exist('../MITgcm/code/SIZE.h')
     139        fidi=fopen('../MITgcm/code/SIZE.h.bak','r');
     140        fido=fopen('../MITgcm/code/SIZE.h','w');
    143141        tline = fgetl(fidi);
    144         if ~ischar(tline), break, end
    145         %do the change here:
    146         if strcmpi(tline,'     &           sNx =  20,'),
    147             fprintf(fido,'%s%i%s\n','     &           sNx =  ',round(Nx/nPx),',');
    148             continue;
     142        fprintf(fido,'%s\n',tline);
     143        while 1
     144            tline = fgetl(fidi);
     145            if ~ischar(tline), break, end
     146            %do the change here:
     147            if strcmpi(tline,'     &           sNx =  20,'),
     148                fprintf(fido,'%s%i%s\n','     &           sNx =  ',round(Nx/nPx),',');
     149                continue;
     150            end
     151            if strcmpi(tline,'     &           sNy =  20,'),
     152                fprintf(fido,'%s%i%s\n','     &           sNy =  ',round(Ny/nPy),',');
     153                continue;
     154            end
     155            if strcmpi(tline,'     &           nPx =   1,'),
     156                fprintf(fido,'%s%i%s\n','     &           nPx = ',nPx,',');
     157                continue;
     158            end
     159            if strcmpi(tline,'     &           nPy =   2,'),
     160                fprintf(fido,'%s%i%s\n','     &           nPy = ',nPy,',');
     161                continue;
     162            end
     163            fprintf(fido,'%s\n',tline);
    149164        end
    150         if strcmpi(tline,'     &           sNy =  20,'),
    151             fprintf(fido,'%s%i%s\n','     &           sNy =  ',round(Ny/nPy),',');
    152             continue;
    153         end
    154         if strcmpi(tline,'     &           nPx =   1,'),
    155             fprintf(fido,'%s%i%s\n','     &           nPx = ',nPx,',');
    156             continue;
    157         end
    158         if strcmpi(tline,'     &           nPy =   2,'),
    159             fprintf(fido,'%s%i%s\n','     &           nPy = ',nPy,',');
    160             continue;
    161         end
    162         fprintf(fido,'%s\n',tline);
     165        %close  files
     166        fclose(fidi);
     167        fclose(fido);
    163168    end
    164     %close  files
    165     fclose(fidi);
    166     fclose(fido);
    167 
    168          system(['../MITgcm/build.sh generic ' pwd '/../MITgcm']);
     169
     170    system(['../MITgcm/build.sh generic ' pwd '/../MITgcm']);
    169171end
    170172% }}}
  • issm/trunk-jpl/test/NightlyRun/test4002.m

    r23068 r23074  
    44%Script control parameters
    55steps=[1 2 3 4 5 6 7 8 9 10 11 12];
     6steps=[1 2 3 4 5];
    67final_time=1/365;
    78
     
    136137
    137138    %specify computational grid in SIZE.h
    138     fidi=fopen('../MITgcm/code/SIZE.h.bak','r');
    139     fido=fopen('../MITgcm/code/SIZE.h','w');
    140     tline = fgetl(fidi);
    141     fprintf(fido,'%s\n',tline);
    142     while 1
     139    if ~exist('../MITgcm/code/SIZE.h')
     140        fidi=fopen('../MITgcm/code/SIZE.h.bak','r');
     141        fido=fopen('../MITgcm/code/SIZE.h','w');
    143142        tline = fgetl(fidi);
    144         if ~ischar(tline), break, end
    145         %do the change here:
    146         if strcmpi(tline,'     &           sNx =  20,'),
    147             fprintf(fido,'%s%i%s\n','     &           sNx =  ',round(Nx/nPx),',');
    148             continue;
    149         end
    150         if strcmpi(tline,'     &           sNy =  20,'),
    151             fprintf(fido,'%s%i%s\n','     &           sNy =  ',round(Ny/nPy),',');
    152             continue;
    153         end
    154         if strcmpi(tline,'     &           nPx =   1,'),
    155             fprintf(fido,'%s%i%s\n','     &           nPx = ',nPx,',');
    156             continue;
    157         end
    158         if strcmpi(tline,'     &           nPy =   2,'),
    159             fprintf(fido,'%s%i%s\n','     &           nPy = ',nPy,',');
    160             continue;
    161         end
    162143        fprintf(fido,'%s\n',tline);
     144        while 1
     145            tline = fgetl(fidi);
     146            if ~ischar(tline), break, end
     147            %do the change here:
     148            if strcmpi(tline,'     &           sNx =  20,'),
     149                fprintf(fido,'%s%i%s\n','     &           sNx =  ',round(Nx/nPx),',');
     150                continue;
     151            end
     152            if strcmpi(tline,'     &           sNy =  20,'),
     153                fprintf(fido,'%s%i%s\n','     &           sNy =  ',round(Ny/nPy),',');
     154                continue;
     155            end
     156            if strcmpi(tline,'     &           nPx =   1,'),
     157                fprintf(fido,'%s%i%s\n','     &           nPx = ',nPx,',');
     158                continue;
     159            end
     160            if strcmpi(tline,'     &           nPy =   2,'),
     161                fprintf(fido,'%s%i%s\n','     &           nPy = ',nPy,',');
     162                continue;
     163            end
     164            fprintf(fido,'%s\n',tline);
     165        end
     166        %close  files
     167        fclose(fidi);
     168        fclose(fido);
    163169    end
    164     %close  files
    165     fclose(fidi);
    166     fclose(fido);
    167 
    168          system(['../MITgcm/build.sh generic ' pwd '/../MITgcm']);
     170
     171    system(['../MITgcm/build.sh generic ' pwd '/../MITgcm']);
    169172end
    170173% }}}
Note: See TracChangeset for help on using the changeset viewer.