New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 4140 – NEMO

Changeset 4140


Ignore:
Timestamp:
2013-10-25T18:19:03+02:00 (11 years ago)
Author:
andrewryan
Message:

added a command option to allow custom submit commands to be run by the quick start script

Location:
branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/TOOLS/OBSTOOLS/OOO/ooo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/TOOLS/OBSTOOLS/OOO/ooo/ooo.py

    r4138 r4140  
    2525    parser.add_argument("--dry-run", action="store_true", 
    2626                        help="Flag to test namelist building without submitting.") 
     27    parser.add_argument("--cmd", dest="command", default="./opa", 
     28                        help="Submit task to run.") 
    2729    parser.add_argument("-v", "--verbose", action="store_true", 
    2830                        help="Prints difference between before and after namelists.") 
     
    114116    # Run job 
    115117    if not args.dry_run: 
    116         run.submit() 
     118        run.submit(command=args.command) 
    117119     
    118120 
  • branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/TOOLS/OBSTOOLS/OOO/ooo/run.py

    r4127 r4140  
    66""" 
    77import subprocess 
     8import shlex 
    89import os 
    910 
     
    1112    pass 
    1213 
    13 def submit(): 
     14def submit(command="./opa"): 
    1415    """Simple function that runs the code. 
    1516 
     
    2223    :returns: retcode 
    2324    """ 
    24     exe = "./opa" 
    25     if os.path.exists(exe): 
    26         retcode = subprocess.call([exe]) 
    27     else: 
    28         raise SubmitError("can not find {}".format(exe)) 
     25    retcode = subprocess.call(shlex.split(command)) 
    2926    return retcode 
    3027 
Note: See TracChangeset for help on using the changeset viewer.