#! /usr/bin/perl -s if(! $top) { $top = `pwd`; } if(! $config_dir) { $config_dir = "$top/config-data"; } # Set up the CCTK home directory if(! $cctk_home) { $cctk_home = $ENV{'CCTK_HOME'} || "$ENV{HOME}/CCTK"; $cachome =~ s:/$::g; } $activethorns = shift(@ARGV); if (! $activethorns) { printf "Usage: config_parser [-top=] [-config_dir=] [-cctk_home=] ActiveThornList"; exit; } #if (!-e "$cctk_home/lib/perl/thorn_utils.pl" ) { # print <) { s/thorn_//g; s/\#(.*)$//g; s/\n//g; # Different from chop... next if (m:^\s*$:); foreach $thorn (split(' ')) { $thorn =~ m:(.*)[/\\](.*):; $toolkit = $1; $thorn_name = $2; if( -r "$cctk_home/toolkits/$thorn/param.ccl" && -r "$cctk_home/toolkits/$thorn/interface.ccl" && -r "$cctk_home/toolkits/$thorn/schedule.ccl") { if( $thornlist{"$thorn_name"} ) { print "Ignoring duplicate thorn $thorn_name\n"; } else { $thornlist{"$thorn_name"} = "$cctk_home/toolkits/$thorn"; } } else { print "Ignoring $thorn - missing ccl file(s)\n"; next; } } } close ACTIVE; return %thornlist; } sub get_public_parameters { local(%parameter_database) = @_; local(%public_parameters); local($param); foreach $param (split(/ /,$parameter_database{"PUBLIC PARAMETERS"})) { if($param =~ m/(.*)::(.*)/) { $public_parameters{"$2"} = $1; } } return %public_parameters; } sub CreateMakeThornlist { local(%thorns) = @_; local($thorn); local($thornlist); $thornlist = "THORNS ="; foreach $thorn (keys %thorns) { next if ($thorn =~ m:Cactus:); $thorns{$thorn} =~ m:(.*)/(.*)/(.*):; $thornlist .= " $2/$3"; } return ("$thornlist", ""); }