summaryrefslogtreecommitdiff
path: root/lib/sbin/SystemInfo.pl
diff options
context:
space:
mode:
authorlanfer <lanfer@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-12-01 22:27:14 +0000
committerlanfer <lanfer@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-12-01 22:27:14 +0000
commitc6951ca1da318efb2a901eb672384a5f96b7a422 (patch)
tree10650e089e11e23f2f55ffde544da7817ed88668 /lib/sbin/SystemInfo.pl
parente3fddca3fa0f61ccaeebab1d2f265c15d7e6a4a7 (diff)
new gmake target: gmake <CONFIG>-sysinfo retruns some basic info on Cactus and the hardware
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1182 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/SystemInfo.pl')
-rw-r--r--lib/sbin/SystemInfo.pl111
1 files changed, 111 insertions, 0 deletions
diff --git a/lib/sbin/SystemInfo.pl b/lib/sbin/SystemInfo.pl
new file mode 100644
index 00000000..f56c981c
--- /dev/null
+++ b/lib/sbin/SystemInfo.pl
@@ -0,0 +1,111 @@
+
+# this scrips gathers some basic info on the system it runs on.
+# This is inteded to be included in bugreports etc.
+
+$config = $ARGV[0];
+$home = `pwd`;
+chop($home);
+
+$sep = "/";
+
+# Work out where the config directory is
+if($ENV{"CONFIGS_DIR"})
+{
+ $configs_dir = $ENV{"CONFIGS_DIR"};
+}
+else
+{
+ $configs_dir = "configs";
+}
+
+$current_directory = `pwd`;
+chop($current_directory);
+$current_directory =~ s,^//([^/]+)/,$1:/,;
+
+
+# Look to see if MPI is defined
+$extra = "$current_directory${sep}configs${sep}$config${sep}config-data${sep}cctk_extradefs.h";
+
+$mpi = 0;
+if (-e "$extra")
+{
+ open(EXTRA,"<$extra");
+ while(<EXTRA>)
+ {
+ if (/\#define MPI/)
+ {
+ $mpi = "MPI"
+ }
+ else
+ {
+ $mpi = "NO MPI";
+ }
+ }
+}
+
+
+#Get the version number of the makefile
+open (MF,"<Makefile");
+while (<MF>)
+ {
+ if (/CCTK_VERSION_MAJOR\s+=\s+(\S+)/)
+ {
+ $version.="$1.";
+ }
+ if (/CCTK_VERSION_MINOR\s*=\s*(\S+)/)
+ {
+ $version.="$1.";
+ }
+ if (/CCTK_VERSION_OTHER\s*=\s*(\S+)/)
+ {
+ $version.="$1";
+ }
+ }
+
+close(MF);
+
+#Get the CVS repository
+if (-e "CVS/Root")
+{
+ open(CVS,"CVS/Root");
+ $cvsrep = <CVS>;
+ chop($cvsrep);
+}
+else
+{
+ printf "NO CVS";
+}
+
+
+#get the uname output
+$uname = `uname -a`;
+chop($uname);
+
+#get hinv
+if ($uname=~m/IRIX/i)
+{
+ $hinv = `hinv`;
+}
+
+
+# Create sysinfo directory if needed
+if (! -d "sysinfo")
+{
+ mkdir("sysinfo", 0755) || die "Unable to create sysinfo directory";
+}
+
+printf "Generating info file: sysinfo${sep}$config.sysinfo ...\n\n";
+
+open (INFO,">sysinfo${sep}$config.sysinfo");
+
+print INFO "VERSION: $version\n";
+print INFO "UNAME : $uname \n";
+print INFO "MPI : $mpi \n";
+print INFO "CVSROOT: $cvsrep\n";
+if ($hinv=~m/.*/) {
+ print INFO "HINV : $hinv \n";
+}
+close (INFO);
+
+
+