@@ -1195,6 +1195,8 @@ def seff_cli(argv=sys.argv[1:], csv_input=None):
1195
1195
help = "Aggregate data by user." )
1196
1196
parser .add_argument ('--order' ,
1197
1197
help = "SQL order by (arbitrary SQL expression using column names). NOT safe from SQL injection." )
1198
+ parser .add_argument ('--long' , '-l' , action = 'store_true' ,
1199
+ help = "Longer output format that includes job start/end times." )
1198
1200
parser .add_argument ('--csv-input' ,
1199
1201
help = "Don't parse sacct but import this CSV file. It's read with "
1200
1202
"Python's default csv reader (excel format). Beware badly "
@@ -1226,6 +1228,10 @@ def seff_cli(argv=sys.argv[1:], csv_input=None):
1226
1228
else :
1227
1229
order_by = ''
1228
1230
1231
+ long_output = ''
1232
+ if args .long :
1233
+ long_output = "strftime('%Y-%m-%d %H:%M', Start, 'unixepoch') AS Start, strftime('%Y-%m-%d %H:%M', End, 'unixepoch') AS End,"
1234
+
1229
1235
db = import_or_open_db (args , sacct_filter , csv_input = csv_input )
1230
1236
1231
1237
# If we run sacct, then args.user is set to None so we don't do double filtering here
@@ -1266,6 +1272,7 @@ def seff_cli(argv=sys.argv[1:], csv_input=None):
1266
1272
JobID,
1267
1273
User,
1268
1274
round(Elapsed/3600,2) AS hours,
1275
+ { long_output }
1269
1276
1270
1277
NCPUS,
1271
1278
printf("%3.0f%%",round(CPUeff, 2)*100) AS "CPUeff",
@@ -1289,7 +1296,8 @@ def seff_cli(argv=sys.argv[1:], csv_input=None):
1289
1296
print ("No data fetched with these sacct options." )
1290
1297
exit (2 )
1291
1298
print (tabulate (data , headers = headers , tablefmt = args .format ,
1292
- colalign = ('decimal' , 'left' , 'decimal' ,
1299
+ colalign = ('decimal' , 'center' , 'decimal' ,
1300
+ * (['center' , 'center' ] if long_output else []),
1293
1301
'decimal' , 'right' , # cpu
1294
1302
'decimal' , 'decimal' , 'right' , # mem
1295
1303
'decimal' , 'right' , # gpu
0 commit comments