Project

General

Profile

Convert XML

NOTE: This is supported only for LArSoft based experiment code.
The converter handles the most common LArBatch/project.py XML tags.
It is not guaranteed that all XML are properly converted.

It is required that the user set up the exact code configured in the XML, this because the conversion procedure needs to extract some info from FHiCL files used in the workflow stages.

To convert a LArBatch/project.py XML to POMS configuration file, the command is:

Project.py --convert_xml <UserAnalysis>.xml

where <UserAnalysis>.xml is the XML to convert.
This will produce two POMS configuration files with extension .cfg and .ini

An output example of the XML conversion is:

$ Project.py --convert_xml UserAnalysis.xml 
2020-01-14 16:03:22,271 -  INFO - template cfg file name is /cvmfs/fermilab.opensciencegrid.org/products/common/db/../prd/project_py/v1_4_0/NULL/template/generic/template_launch.cfg
2020-01-14 16:03:22,272 -  INFO - template ini file name is /cvmfs/fermilab.opensciencegrid.org/products/common/db/../prd/project_py/v1_4_0/NULL/template/generic/template_campaign.ini
2020-01-14 16:03:22,276 -  INFO - In your environment you have *LArSoft: v08_05_00_10*

2020-01-14 16:03:22,276 -  INFO - In your environment you have *uBooNE code: v08_00_00_30*

2020-01-14 16:03:22,886 -  INFO - for stage myanalysis enabling ArtRoot output for FHiCL myanalysis.fcl
2020-01-14 16:03:22,887 -  INFO - for stage myanalysis enabling HistRoot output for FHiCL myanalysis.fcl
2020-01-14 16:03:22,887 -  INFO - 
2020-01-14 16:03:22,940 -  INFO - cfg file created in: /uboone/app/users/vito/poms_cfg/vito_UserAnalysis.cfg
2020-01-14 16:03:22,968 -  INFO - ini file created in: /uboone/app/users/vito/poms_cfg/vito_UserAnalysis.ini

POMS configuration files are wrote to: /<exp>/app/users/${USER}/poms_cfg/

configuration file names are in the format: ${USERS}_<UserAnalysis>.{cfg.ini}

By design the XML converter doesn't override POMS configuration files.
If POMS configuration files with the same name already exist, the XML converter will abort the conversion.

$ Project.py --convert_xml UserAnalysis.xml 
2020-01-14 16:14:52,403 -  INFO - INFO - template cfg file name is /cvmfs/fermilab.opensciencegrid.org/products/common/db/../prd/project_py/v1_4_0/NULL/template/generic/template_launch.cfg
2020-01-14 16:14:52,403 -  INFO - INFO - template ini file name is /cvmfs/fermilab.opensciencegrid.org/products/common/db/../prd/project_py/v1_4_0/NULL/template/generic/template_campaign.ini
2020-01-14 16:14:52,407 -  INFO - In your environment you have *LArSoft: v08_05_00_10*

2020-01-14 16:14:52,407 -  INFO - In your environment you have *uBooNE code: v08_00_00_30*

2020-01-14 16:14:53,046 -  INFO - for stage myanalysis enabling ArtRoot output for FHiCL myanalysis.fcl
2020-01-14 16:14:53,047 -  INFO - for stage myanalysis enabling HistRoot output for FHiCL myanalysis.fcl
2020-01-14 16:14:53,047 -  INFO - 
2020-01-14 16:14:53,123 -  ERROR - The cfg file vito_UserAnalysis.cfg already exists in /uboone/app/users/vito/poms_cfg 
2020-01-14 16:14:53,123 -  ERROR - Please, use different cfg file name or remove the old one
2020-01-14 16:14:53,123 -  ERROR - XML -> cfg conversion ABORTED!!!

In this case existing POMS configuration files can be manually removed.
Alternatively the option -c allows to use a different filename for the POMS configuration file:
$ Project.py --convert_xml UserAnalysis.xml -c UserAnalysis_v2
2020-01-14 16:17:39,160 -  INFO - template cfg file name is /cvmfs/fermilab.opensciencegrid.org/products/common/db/../prd/project_py/v1_4_0/NULL/template/generic/template_launch.cfg
2020-01-14 16:17:39,160 -  INFO - template ini file name is /cvmfs/fermilab.opensciencegrid.org/products/common/db/../prd/project_py/v1_4_0/NULL/template/generic/template_campaign.ini
2020-01-14 16:17:39,164 -  INFO - In your environment you have *LArSoft: v08_05_00_10*

2020-01-14 16:17:39,165 -  INFO - In your environment you have *uBooNE code: v08_00_00_30*

2020-01-14 16:17:39,803 -  INFO - for stage myanalysis enabling ArtRoot output for FHiCL myanalysis.fcl
2020-01-14 16:17:39,804 -  INFO - for stage myanalysis enabling HistRoot output for FHiCL myanalysis.fcl
2020-01-14 16:17:39,804 -  INFO - 
2020-01-14 16:17:39,853 -  INFO - cfg file created in: /uboone/app/users/vito/poms_cfg/vito_UserAnalysis_v2.cfg
2020-01-14 16:17:39,879 -  INFO - ini file created in: /uboone/app/users/vito/poms_cfg/vito_UserAnalysis_v2.ini