Sample Header Ad - 728x90

Ubuntu Supervisor command expansion in bash

2 votes
0 answers
339 views
I need to run a command via supervisor (bash on Ubuntu 18.04) that launches a parallel process with a number of cores equals to a fraction of the machine cores. From the command line I can successfully run mpiexec -np $(($(nproc)/2)) pvserver --mesa --force-offscreen-rendering This works as expected. I then try to add the same command (with absolute paths) in the supervisor config file cmd=mpiexec -np $(($(nproc)/2)) pvserver --mesa --force-offscreen-rendering but I receive the error [mpiexec@ip-172-31-16-210] HYD_pmcd_pmi_alloc_pg_scratch (pm/pmiserv/pmiserv_utils.c:527): assert (pg->pg_process_count * sizeof(struct HYD_pmcd_pmi_ecount)) failed [mpiexec@ip-172-31-16-210] HYD_pmci_launch_procs (pm/pmiserv/pmiserv_pmci.c:108): error allocating pg scratch space [mpiexec@ip-172-31-16-210] main (ui/mpich/mpiexec.c:340): process manager returned error launching processes It seems that mpiexec is receiving the wrong argument. It goes without saying that everything works if I hardcode the np argument. I have also tried with xargs, but its syntax is not very clear to me. This is what I tried echo $(($(nproc)/2)) | xargs mpiexec -np {} pvserver --mesa --force-offscreen-rendering but I cannot get this to work even from the command line. Any suggestion?
Asked by Rojj (213 rep)
Oct 27, 2019, 09:12 AM