I want to do a simultaneous fit using 4 sets of parameters (in text files). I would like to have one job corresponding to each .txt file. I am referring to How to submit parallel jobs using TChain and it suggests that I use PROOF. but I am not sure how I can use it in my case or how I should modify the code to get it done. I intend to use my laptop to submit these jobs.
Currently, I have a version that loops over the .txt files. all I want to do is to run the jobs simultaneously and not one after the other.
Please see this folder: loop_txt.tar.gz (2.9 MB). The macro that I am using is: asymmetry_all_params.C. The runtime output is output.log. One can also see the output plots saved as .pdf files in the folder.
My suggestion would be to write a program that runs on one .txt file and then a bash script that runs it on all .txt files at the same time. The body of the script would be something like:
for fname in *.txt; do
./myprogram fname & # & makes it run in the background
done
Thank you very much for your response. I made the changes and I am now able to submit the jobs in parallel and I am also getting the desired results. But, there is still a minor issue that I am still not able to resolve. I am describing it below:
The fitting code gives 4 plots corresponding to one .txt file. For eg: if the name of the .txt file is kpi.txt, the names of the output plots will be like: d0pi_d01kpi.txt.pdf, kk_d0bar1kpi.txt.pdf . However, I am also getting 8 extra plots with names like d0pi_d01..pdf, d0pi_d01...pdf and so on. I am not able to understand why and from where these extras are coming and how to prevent them
The shell script is submit.sh. The directory txt_files has all the required text files.
In case you want to run it, you just need to change the paths in the following lines of asymmetry_all_params_batch.C:
I discovered that I was looping over the files in the code because of which I was getting plots in multiples of 4 for more than one file. I did not realise this earlier because the number of saved plots was always correct because they were being over-written. I am trying to fix this now.
The following is the patch of code that is supposed to read the files. fname is now an argument.
The message that I get at the very beginning is the following: [#0] ERROR:InputArguments -- RooArgSet::readFromFile(parameters) error opening file and then the code proceeds with old parameters.
Hi @sanjeeda ,
if I understand correctly the problem is now that params->readFromFile(fname) cannot open the file. That is most probably due to fname being wrong, you can try to print it out to see why.
Thank you for your response.
I am not sure what is meant by filename being wrong. But, I did try to print the file name but it seems like it is not able to pick the file names and I fail to understand why.
Earlier, when I was looping over the file names, there was no problem I did fullfname.Data() as shown below: