Index: /issm/trunk-jpl/test/NightlyRun/GetIds.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/GetIds.py	(revision 23176)
+++ /issm/trunk-jpl/test/NightlyRun/GetIds.py	(revision 23176)
@@ -0,0 +1,66 @@
+#! /usr/bin/env python
+from IdToName import *
+from IdFromString import *
+import numpy as np
+
+def GetIds(ids_names):
+	"""
+	GetIds - output ids from a given array of IDs and test names
+
+		 the test names can be any string or sub-string present
+		 in the test's name (first line of corresponding file)
+
+		 test names are case sensitive
+ 
+	    Usage:
+		ids=GetIds(101)
+		ids=GetIds('Dakota')
+		ids=GetIds([101,102...])
+		ids=GetIds([\'Dakota\',\'Slr\'...])
+		ids=GetIds([[101,102...],[\'Dakota\',\'Slr\'...]])
+	"""
+
+	ids = []
+
+	# 1 input, either an id or a test name
+	if type(ids_names) == str:
+		ids = IdFromString(ids_names)
+		if len(ids) == 0:
+			# fail silently
+			return []
+			#raise RuntimeError('runme.py: GetIds.py: No tests with names matching "'+ids_names+'" were found. Note that name checking is case sensitive. Test names are in the first line of a given test eg: "Square" would include test101.py: "SquareShelfConstrainedStressSSA2d"')
+
+	if type(ids_names) == int:
+		ids = [ids_names]
+		if len(ids) == 0:
+			# fail silently
+			return []
+			#raise RuntimeError('runme.py: GetIds.py: No tests with ids matching "'+ids_names+'" were found. Check that there is a test file named "test'+str(ids_names)+'.py"')
+
+	# many inputs of either ids or test names
+	if type(ids_names) == list and len(ids_names) > 0:
+		# is everything a string or int?
+		if np.array([type(i) == int for i in ids_names]).all():
+			ids = ids_names
+		elif np.array([type(i) == str for i in ids_names]).all():
+			ids = np.concatenate([IdFromString(i) for i in ids_names])
+			if len(ids) == 0:
+				raise RuntimeError('runme.py: GetIds.py: No tests with names matching "'+ids_names+'" were found. Note that name checking is case sensitive.')
+
+	# many inputs of both ids and test names
+	# ids_names[0] -> ids_names by id
+	# ids_names[1] -> ids_names by test name
+	if type(ids_names) == list and len(ids_names) == 2:
+		if type(ids_names[0]) == list and len(ids_names[0]) > 0 and type(ids_names[0][0]) == int:
+			ids = np.concatenate([ids,ids_names[0]])
+		if type(ids_names[1]) == list and len(ids_names[1]) > 0 and type(ids_names[1][0]) == str:
+			ids = np.concatenate([ids,np.concatenate([IdFromString(i) for i in ids_names[1]])])
+			if len(ids) == 0:
+				raise RuntimeError('runme.py: GetIds.py: No tests with names matching "'+ids_names+'" were found. Note that name checking is case sensitive.')
+
+	# no recognizable ids or id formats
+	if np.size(ids) == 0 and not np.all(np.equal(ids_names,None)):
+		raise RuntimeError('runme.py: GetIds.py: include and exclude options (-i/--id; -in/--include_name; -e/--exclude; -en/--exclude_name) options must follow GetIds usage format:\n'+GetIds.__doc__)
+
+	return np.array(ids).astype(int)
+
Index: /issm/trunk-jpl/test/NightlyRun/runme.py
===================================================================
--- /issm/trunk-jpl/test/NightlyRun/runme.py	(revision 23175)
+++ /issm/trunk-jpl/test/NightlyRun/runme.py	(revision 23176)
@@ -6,5 +6,5 @@
 from glob import glob
 from socket import gethostname
-from IdFromString import *
+from GetIds import *
 
 def runme(id=None,exclude=None,benchmark='nightly',procedure='check',output='none',rank=1,numprocs=1):
@@ -20,6 +20,10 @@
  
 	    Available options:
-	       'id'            followed by the list of ids requested
-	       'exclude'       ids or (parts of) test names to be excluded from the test
+	       'id'            followed by the list of ids or (parts of) test names requested
+				Note: runs all tests by default
+
+	       'exclude'       ids or (parts of) test names to be excluded (same format as id)
+				Note: exclude does nothing if 'id' is specified with different values
+
 	       'benchmark'     'all' (all of the tests)
                           'nightly' (nightly run/ daily run)
@@ -29,5 +33,5 @@
                           'mesh'   : validation of mesh tests
                           'adolc'  : validation of adolc tests
-                          'slr'   : validation of slr tests
+                          'slr'    : validation of slr tests
 
 	       'procedure'     'check' : run the test (default)
@@ -39,8 +43,9 @@
 	    Examples:
 	       runme()
-	       runme(exclude=101)
-	       runme(exclude='Dakota')
-	       runme(exclude=[[101,102],['Dakota','Slr']])
-	       runme(id=102,procedure='update')
+	       runme(101)
+	       runme('SquareShelf')
+	       runme(exclude=2001)
+	       runme(exclude='Dakota',benchmark='all')
+	       runme(id=[[101,102],['Dakota','Slr']])
 	"""
 
@@ -84,52 +89,17 @@
 	
 	if id:
-		if isinstance(id,list):
-			test_ids=id
-		else:
-			test_ids=[id]
-		test_ids=set(test_ids).intersection(set(list_ids))
+		test_ids = set(GetIds(id)).intersection(set(list_ids))
 	else:
-		test_ids=set(list_ids)
+		# if no tests are specifically provided, do them all
+		test_ids = set(list_ids)
 		
-		#print 'test_ids after list =',test_ids
+	#print 'test_ids after list =',test_ids
 	# }}}
 	#GET exclude {{{
-	exclude_ids = []
-	if exclude != None and np.size(exclude) > 0:
-		# 1 exclusion, either an id or a test name
-		if type(exclude) == str:
-			exclude_ids = IdFromString(exclude)
-		if type(exclude) == int:
-			exclude_ids = [exclude]
-
-		# many exclusions of either ids or test names
-		if type(exclude) == list and len(exclude) > 0:
-			# is everything a string or int?
-			if np.array([type(i) == int for i in exclude]).all():
-				exclude_ids = exclude
-			elif np.array([type(i) == str for i in exclude]).all():
-				exclude_ids = np.concatenate([IdFromString(i) for i in exclude])
-
-		# many exclusions of both ids and test names
-		# exclude[0] -> exclude by id
-		# exclude[1] -> exclude by test name
-		if type(exclude) == list and len(exclude) == 2:
-			if type(exclude[0]) == list and len(exclude[0]) > 0 and type(exclude[0][0]) == int:
-				exclude_ids = np.concatenate([exclude_ids,exclude[0]])
-			if type(exclude[1]) == list and len(exclude[1]) > 0 and type(exclude[1][0]) == str:
-				exclude_ids = np.concatenate([exclude_ids,np.concatenate([IdFromString(i) for i in exclude[1]])])
-
-		# no recognizable exclusion
-		if np.size(exclude_ids) == 0:
-			raise RuntimeError('''runme.py: exclude (-e/-exclude) and exclude-name (-en/-exclude_name) options must appear as one of the following:
-
-exclude=101					OR -e 101
-exclude=\'Dakota\'				OR -en 'Dakota'
-exclude=[101,102...]				OR -e 101 102 ...
-exclude=[\'Dakota\',\'Slr\'...]			OR -en 'Dakota' 'Slr' ...
-exclude=[[101,102...],[\'Dakota\',\'Slr\'...]]	OR -e 101 102 ... -en 'Dakota' 'Slr' ...
-''')
-		test_ids=test_ids.difference(exclude_ids)
+	exclude_ids = GetIds(exclude)
+
+	test_ids=test_ids.difference(exclude_ids)
 	#print 'test_ids after exclude =',sorted(test_ids)
+	#return
 	# }}}
 	#Process Ids according to benchmarks {{{
@@ -280,4 +250,5 @@
 	parser = argparse.ArgumentParser(description='RUNME - test deck for ISSM nightly runs')
 	parser.add_argument('-i','--id', nargs='*', type=int, help='followed by the list of ids requested', default=[])
+	parser.add_argument('-in','--include_name', nargs='*', type=str, help='followed by the list of test names requested', default=[])
 	parser.add_argument('-e','--exclude', nargs='+', type=int, help='ids to be excluded from the test', default=[])
 	parser.add_argument('-en','--exclude_name', nargs='+', type=str, help='test names to be excluded from the test', default=[])
@@ -289,5 +260,5 @@
 	args = parser.parse_args()
 
-	md = runme(args.id, [args.exclude,args.exclude_name], args.benchmark, args.procedure, args.output, args.rank, args.numprocs)
+	md = runme([args.id,args.include_name], [args.exclude,args.exclude_name], args.benchmark, args.procedure, args.output, args.rank, args.numprocs)
 
 	if args.output=='nightly':
