Project

General

Profile

Support #22849

Accessing the input file name from a SAM definition.

Added by Jason Stock 3 months ago. Updated 8 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
Start date:
07/01/2019
Due date:
% Done:

0%

Estimated time:
Duration:

Description

I am using SAM as the input for a job, and am trying to access the input filename within the job. Is there a BASH environment variable for file names from the SAM getNextFile loop? I have searched the documentation for fife, tried to look in fife_wrap, and turned on debug, but have been unable to find one. This is using fife_launch directly (without POMS). The ultimate goal is to parse the input file name for the run and subrun numbers in bash so I can easily include them in my output file names for each job.

Example cfg:
/dune/app/users/jstock/3x1x1_Ana/grid/launch_tarball.cfg
Example run command:
/dune/app/users/jstock/3x1x1_Ana/grid/launch_fife.sh

History

#1 Updated by Marc Mengel 3 months ago

For the recent versions,(i.e v3_2_9 and any later) you should be able to use ${fname} for the file name and ${furi} for the uri it was fetched from. (in
case there is useful info in the file path for example)

Escaping the $ sufficiently is hard; so I'm working on providing a built-in
%(fname)s in fife_launch which will expand to like 15 backslashes and ${fname}.
(which is to say, it's in there but not really tested yet).

See https://cdcvs.fnal.gov/redmine/projects/fife_utils/repository/revisions/master/annotate/libexec/fife_wrap#L423

#2 Updated by Jason Stock 3 months ago

Thanks! Exactly what I was looking for.

#3 Updated by Marc Mengel 3 months ago

It's one of several good ideas I stole from the NOvA fork of ifdh_art.sh...

#4 Updated by Marc Mengel 8 days ago

  • Status changed from New to Resolved

#5 Updated by Marc Mengel 8 days ago

  • Target version set to v3_3


Also available in: Atom PDF