Skip to content

getmodelrates() refactored and awgtpman can learn model rate from files.

Erik von Reis requested to merge erik.vonreis/advligorts:awg_model_rates into master

awgtpman now by default will try to learn the model rate from the tp file for the model. Use '-r' option to override the file rate and use the rate specified on the command line.

awgtpman is using the getmodelrate() function copied from pubsub. getmodelrate() is used in three places, each with their own implementation: cds_pub_sub, local_dc, and mx_fe. I copied the pub_sub version into a new file, src/util/modelrate.c and created a header for it src/include/modelrate.h. I deleted the separate versions of the functions and changed all three programs to reference the version in util.

The pub_sub version was slightly different different than the others: if the GDS_TP_DIR environment variable is defined it would check there for the tp file instead of the default location. I preserved this change in the refactoring. This is a behavioural change to local_dc and mx_fe.

There were two bugs in getmodelrate() that are fixed here: getmodelrate would crash if IFO and SITE environment variables were not defined. It could also change the values of those variables. The move of getmodelrate may obscure those changes, so it might be good to review the move commit separately from the changes to getmodelrate (first and second commits).

I built cds_pub_sub and it passed the tests, but the behaviour of getmodelrate() does not seem to affect the tests. I have built local_dc and mx_fe but did not test them.

This is part of the fix for issue #44 (closed). It's a bigger change to how awgtpman sets up to enable slower model rates than 16kHz.

Edited by Erik von Reis

Merge request reports