#!/usr/bin/env python #\if DOXYGEN_IGNORE ############################################################ # # # Copyright (C) 2016 by John Spitzak # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 3 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the # # Free Software Foundation, Inc., # # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # # #\endif ######################################################################## ################################################################################ #\defgroup difxruncalc DiFXrunCalc # #\brief Run the calc process on a job or group of jobs on the DiFX server. # # Usage: DiFXrunCalc [options] directory # # DiFXrunCalc will run the "calc" process on a group of jobs in a single # specified directory on the DiFX server. The jobs must have .input and .calc # files associated with them, and may or may not have .im files as well (the # products of previous calc runs which will be over written). By default all # jobs in the directory will have calc run on them but a subset may be selected # by specifying job names. The calc process is calcif2, but an alternative # can be used. # #

Command Line Arguments

# # #
-c, --calc APP
Run the given calc application instead of the default # calcif2. #
-D, --difx VERSION
Run using a specific DiFX version. If not specified # the value of the DIFX_VERSION environment variable will # be used. Failing that, "DIFX-DEVEL" will be used. #
-h, --help
Print help information and quit. #
-H, --hostname NAME
Use NAME as the host of the DiFX Server program. # Default is to use DIFX_CONTROL_HOST environment variable. #
-j, --jobs JOBNAMES
Run the given calc application on the specified job(s) # within the given directory. This argument can contain # wildcard characters recognized by an ls command. # Job names do not contain any file extensions. #
-P, --port PORT
Use PORT as the TCP port to communicated with the DiFX Server. # Default is to use DIFX_CONTROL_PORT environment variable. #
-t, --timeout SEC
Use SEC seconds as the timeout value for each job. This is the # amount of time DiFXrun will wait before it gives up on a # "silent" (i.e. no messages received from) job and declares it # non-responsive. Default value is 300.0. #
" % ( sys.argv[0] ) print "" print "Options can include:" print "" print " --calc APP" print " -c APP Run the given APP as the calc application instead of the" print " default \"calcif2\"." print "" print " --difx VERSION" print " -D VERSION Run using a specific DiFX version. If not specified" print " the value of the DIFX_VERSION environment variable will" print " be used. Failing that, \"DIFX-DEVEL\" will be used." print "" print " --help" print " -h Print this help information and quit." print "" print " --hostname NAME" print " -H NAME Use NAME as the host of the difxServer program." print " Default is to use DIFX_CONTROL_HOST environment variable." print "" print " --jobs JOBS" print " -j JOBS Run calc on the specified jobs within the directory." print " Wildcard characters are permitted. Job names do not" print " contain any file extensions." print "" print " --port PORT" print " -P PORT Use PORT as the TCP port to communicated with the difxServer." print " Default is to use DIFX_CONTROL_PORT environment variable." print "" exit( 0 ) elif sys.argv[i] in [ "-H", "--hostname" ]: host = sys.argv[i+1] i = i + 2 elif sys.argv[i] in [ "-c", "--calc" ]: calcApp = sys.argv[i+1] i = i + 2 elif sys.argv[i] in [ "-D", "--difx" ]: DiFXVersion = sys.argv[i+1] i = i + 2 elif sys.argv[i] in [ "-j", "--jobs" ]: jobList = sys.argv[i+1] i = i + 2 elif sys.argv[i] in [ "-P", "--port" ]: port = int( sys.argv[i+1] ) i = i + 2 elif sys.argv[i] in [ "-t", "--timeout" ]: timeout = int( sys.argv[i+1] ) i = i + 2 else: passDir = sys.argv[i] i = i + 1 except RuntimeError: print "Usage: %s [options] <.input path>" % ( sys.argv[0] ) exit( 0 ) # Start the vex2difx class, set the version, etc. print "Making client connection..." difx = DiFXvex2difx.Client() difx.connect() if not difx.socketOK: difx.close() exit( 0 ) difx.monitor() difx.version( DiFXVersion ) difx.newFileCallback( newFileCallback ) difx.processCompleteCallback( processCompleteCallback ) difx.waitTime( timeout ) difx.v2dFile( jobList ) if calcApp != None: difx.calcCommand( calcApp ) difx.calcOnly( True ) if passDir == None: print "Please specify a directory path for this operation." else: difx.passPath( passDir ) difx.runVex2Difx() difx.close()