MPAS-Dev / MPAS-Tools

MPAS Tools Repository
Other
37 stars 63 forks source link

Log commands run with `check_call()` by default #452

Closed xylar closed 2 years ago

xylar commented 2 years ago

Calls to check_call() with logging will write the command-line arguments to the logger by default. This can suppressed by passing the argument log_command=False.

xylar commented 2 years ago

Testing

I tested this on my Linux laptop by running the nightly test suite from compass. As expected, I am seeing the commands that are being run in log files:

$ grep "Running:" case_outputs/*
case_outputs/ocean_baroclinic_channel_10km_decomp_test.log:Running: gpmetis graph.info 4
case_outputs/ocean_baroclinic_channel_10km_decomp_test.log:Running: mpirun -n 4 ./ocean_model -n namelist.ocean -s streams.ocean
case_outputs/ocean_baroclinic_channel_10km_decomp_test.log:Running: gpmetis graph.info 8
case_outputs/ocean_baroclinic_channel_10km_decomp_test.log:Running: mpirun -n 8 ./ocean_model -n namelist.ocean -s streams.ocean
case_outputs/ocean_baroclinic_channel_10km_default.log:Running: gpmetis graph.info 4
case_outputs/ocean_baroclinic_channel_10km_default.log:Running: mpirun -n 4 ./ocean_model -n namelist.ocean -s streams.ocean
case_outputs/ocean_baroclinic_channel_10km_restart_test.log:Running: gpmetis graph.info 4
case_outputs/ocean_baroclinic_channel_10km_restart_test.log:Running: mpirun -n 4 ./ocean_model -n namelist.ocean -s streams.ocean
case_outputs/ocean_baroclinic_channel_10km_restart_test.log:Running: gpmetis graph.info 4
case_outputs/ocean_baroclinic_channel_10km_restart_test.log:Running: mpirun -n 4 ./ocean_model -n namelist.ocean -s streams.ocean
case_outputs/ocean_baroclinic_channel_10km_threads_test.log:Running: gpmetis graph.info 4
case_outputs/ocean_baroclinic_channel_10km_threads_test.log:Running: mpirun -n 4 ./ocean_model -n namelist.ocean -s streams.ocean
case_outputs/ocean_baroclinic_channel_10km_threads_test.log:Running: gpmetis graph.info 4
case_outputs/ocean_baroclinic_channel_10km_threads_test.log:Running: mpirun -n 4 ./ocean_model -n namelist.ocean -s streams.ocean
case_outputs/ocean_global_ocean_QU240_mesh.log:Running: jigsaw mesh.jig
case_outputs/ocean_global_ocean_QU240_mesh.log:Running: compute_mpas_region_masks -m base_mesh.nc -g land_coverage.geojson -o land_mask.nc -t cell --process_count 1 --format NETCDF3_64BIT --engine scipy
case_outputs/ocean_global_ocean_QU240_mesh.log:Running: compute_mpas_transect_masks -m base_mesh.nc -g critical_blockages.geojson -o critical_blockages.nc -t cell -s 10e3 --process_count 1 --format NETCDF3_64BIT --engine scipy
case_outputs/ocean_global_ocean_QU240_mesh.log:Running: compute_mpas_transect_masks -m base_mesh.nc -g critical_passages.geojson -o critical_passages.nc -t cell edge -s 10e3 --process_count 1 --format NETCDF3_64BIT --engine scipy
case_outputs/ocean_global_ocean_QU240_mesh.log:Running: compute_mpas_transect_masks -m culled_mesh.nc -g critical_passages.geojson -o critical_passages_mask_final.nc -t cell -s 10e3 --process_count 1 --format NETCDF3_64BIT --engine scipy
case_outputs/ocean_global_ocean_QU240_PHC_init.log:Running: gpmetis graph.info 4
case_outputs/ocean_global_ocean_QU240_PHC_init.log:Running: mpirun -n 4 ./ocean_model -n namelist.ocean -s streams.ocean
case_outputs/ocean_global_ocean_QU240_PHC_performance_test.log:Running: gpmetis graph.info 4
case_outputs/ocean_global_ocean_QU240_PHC_performance_test.log:Running: mpirun -n 4 ./ocean_model -n namelist.ocean -s streams.ocean
...