MolSSI / QCFractal

A distributed compute and database platform for quantum chemistry.
https://molssi.github.io/QCFractal/
BSD 3-Clause "New" or "Revised" License
143 stars 47 forks source link

Different log file for each manager process #767

Closed peastman closed 9 months ago

peastman commented 9 months ago

In the documentation on setting up a compute manager, it says to specify the log file with

logfile: qcfractal-manager.log

I'm going to be having a whole lot of managers all running at once on different nodes of a cluster. I want each one to write to a different log file. Since some of the other fields seem to support environment variables, I was hoping I could just write

logfile: "qcfractal-manager-${SLURM_JOBID}.log"

but that doesn't work. Is there an easy way to make each job use a different log file?

dotsdl commented 9 months ago

To get a log file per job, what I've done on various HPC clusters is to use envsubst to create a config file specific for that job, with environment variables like you have here substituted in. That config file is then used by the compute manager started by the job.

Something like:

envsubst < config.yml > configs/config.${SLURM_JOBID}.yaml

qcfractal-compute-manager --config configs/config.${SLURM_JOBID}.yaml
bennybp commented 9 months ago

The way outlined above is probably the best you could do now. You could also automatically create directories and copy a config, and have a relative path to a logfile there.

I did fix this for the future in #768 , so thanks for the suggestion :)

peastman commented 9 months ago

That works. Thanks!