@@ -883,6 +883,61 @@ void APP_VERSION::init() {
883883#endif
884884}
885885
886+ // see if app version is disallowed by config
887+ //
888+ bool APP_VERSION::disallowed_by_config (PROJECT *p) {
889+ if (cc_config.dont_use_vbox && strstr (plan_class, " vbox" )) {
890+ msg_printf (p, MSG_INFO,
891+ " Skipping VirtualBox app version: disabled in cc_config.xml"
892+ );
893+ return true ;
894+ }
895+ if (cc_config.dont_use_wsl && strstr (plan_class, " wsl" )) {
896+ msg_printf (p, MSG_INFO,
897+ " skipping WSL app version: disabled in cc_config.xml"
898+ );
899+ return true ;
900+ }
901+ if (cc_config.dont_use_docker && strstr (plan_class, " docker" )) {
902+ msg_printf (p, MSG_INFO,
903+ " skipping Docker app: disabled in cc_config.xml"
904+ );
905+ return true ;
906+ }
907+ return false ;
908+ }
909+
910+ // fill in resource usage if not already present
911+ //
912+ void APP_VERSION::fill_in_resource_usage () {
913+ if (resource_usage.avg_ncpus == 0 ) {
914+ resource_usage.avg_ncpus = 1 ;
915+ }
916+ if (resource_usage.flops == 0 ) {
917+ resource_usage.flops = resource_usage.avg_ncpus * gstate.host_info .p_fpops ;
918+
919+ // for GPU apps, use conservative estimate:
920+ // assume GPU runs at 10X peak CPU speed
921+ //
922+ if (resource_usage.rsc_type ) {
923+ resource_usage.flops += resource_usage.coproc_usage * 10 * gstate.host_info .p_fpops ;
924+ }
925+ }
926+ }
927+
928+ // Parse an <app_version> element; called from
929+ // 1) parse scheduler reply: scheduler_op.cpp
930+ // 2) parse client state file: cs_statefile.cpp
931+ // 3) parse app_info.xml for anonymous platform: cs_statefile.cpp
932+ //
933+ // After this you need to:
934+ // - check if disallowed by config
935+ // do this right away; config.xml has already been parsed
936+ // - fill in resource usage if not specified
937+ // In cases 2 and 3 we don't have CPU FLOPS yet,
938+ // so we have to do this a bit later.
939+ // In case 1 we do it right away.
940+ //
886941int APP_VERSION::parse (XML_PARSER& xp) {
887942 FILE_REF file_ref;
888943 double dtemp;
0 commit comments