summaryrefslogtreecommitdiff
path: root/lib/sbin/CST
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-08-17 18:38:32 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-08-17 18:38:32 +0000
commitaf3aed7fb57098d152808d036b778b41b71783dd (patch)
tree3e5ba99f4bf9d62f3fc47c51d1040c1156ccbb02 /lib/sbin/CST
parentfec387a8e2d38c46397a0cf32b17d61e50e48e76 (diff)
Detect if two thorns providing the same implementation have inconsistent
restricted parameter sets. Patvh from Yaakoub. Fixes PR 1289. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3832 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/CST')
-rw-r--r--lib/sbin/CST47
1 files changed, 45 insertions, 2 deletions
diff --git a/lib/sbin/CST b/lib/sbin/CST
index 9966e54b..d9e2c401 100644
--- a/lib/sbin/CST
+++ b/lib/sbin/CST
@@ -6,7 +6,7 @@
# @desc
# Parses the the configuration files for thorns.
# @enddesc
-# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/sbin/CST,v 1.70 2004-05-17 11:20:51 tradke Exp $
+# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/sbin/CST,v 1.71 2004-08-17 18:38:32 goodale Exp $
#@@*/
# Global parameter to track the number of errors from the CST
@@ -114,11 +114,14 @@ print "Checking consistency...\n";
%parameter_database = &CheckImpParamConsistency(scalar(keys %interface_database), %interface_database, %parameter_database);
-&print_parameter_database(%parameter_database) if($debug_parameters);
+$err_msg = &CheckCrossConsistency(\%interface_database,\%parameter_database);
#$debug_interface = 1;
&print_interface_database(%interface_database) if($debug_interface);
+#$debug_parameters=1;
+&print_parameter_database(%parameter_database ) if($debug_parameters);
+
#$debug_schedule = 1;
&print_schedule_database(%schedule_database) if($debug_schedule);
@@ -602,3 +605,43 @@ sub TopoSort
return $data;
}
+
+
+#/*@@
+# @routine CheckCrossConsistency
+# @date
+# @author Yaakoub Y El Khamra
+# @desc
+# Check for consistency of restricted parameters of thorns providing
+# the same implementation
+# @enddesc
+#@@*/
+sub CheckCrossConsistency
+{
+ my($interfaceDB, $parameterDB) = @_;
+ my($implementation, $thorn, $flag, $restricted, $temp);
+
+ foreach $implementation (split(' ', $interfaceDB->{'IMPLEMENTATIONS'}))
+ {
+ $flag = 0;
+ foreach $thorn (split(' ', $interfaceDB->{"IMPLEMENTATION \U$implementation\E THORNS"}))
+ {
+ if ( $flag==0 )
+ {
+ $restricted = join(' ',sort(split(' ', $parameterDB->{"\U$thorn\E RESTRICTED variables"})));
+ $flag =1;
+ }
+
+ if ( $flag==1 )
+ {
+ $temp = join(' ',sort(split(' ', $parameterDB->{"\U$thorn\E RESTRICTED variables"})));
+ if ( $temp ne $restricted )
+ {
+ CST_error (0, "Thorns: " . $interfaceDB->{"IMPLEMENTATION \U$implementation\E THORNS"} . "provide the same implementation but have different restricted parameters" );
+ }
+ }
+ }
+ }
+ return "";
+}
+