aboutsummaryrefslogtreecommitdiff
path: root/src/announce.cc
diff options
context:
space:
mode:
authorschnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f>2006-05-14 03:36:40 +0000
committerschnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f>2006-05-14 03:36:40 +0000
commit9263c5dab827c6ea9869ee57deb77220cbab7521 (patch)
tree1fe4b742462e124ba0a3788301a16180cfaaa2e5 /src/announce.cc
parent479459caed50c5b4e810fb89467fc67ec7d8eff9 (diff)
Start Formaline in WRAGH instead of STARTUP; this is less trouble.
Remove the logic that delayed outputting the tarballs. Add code to collect the host names of all nodes of a run. This code is not active yet. Find out in which arrangements the compiled thorns are. Call the perl script gethostname.pl only after it has been copied to the scratch directory. git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/Formaline/trunk@79 83718e91-0e4f-0410-abf4-91180603181f
Diffstat (limited to 'src/announce.cc')
-rw-r--r--src/announce.cc58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/announce.cc b/src/announce.cc
index fe3911e..457985c 100644
--- a/src/announce.cc
+++ b/src/announce.cc
@@ -42,12 +42,17 @@
# include <unistd.h>
#endif
+#ifdef CCTK_MPI
+# include <mpi.h>
+#endif
+
#include "http_Content.h"
#include "file.hh"
#include "multistorage.hh"
#include "portal.hh"
#include "rdf.hh"
+#include "thornlist.hh"
@@ -258,6 +263,37 @@ namespace Formaline
Util_GetHostName (run_host, sizeof run_host);
stores.store ("host", run_host);
}
+
+#if 0
+ {
+ char run_host [1000];
+ char (* run_hosts) [1000] = 0;
+ int const nprocs = CCTK_NumProcs (cctkGH);
+ int n;
+
+ Util_GetHostName (run_host, sizeof run_host);
+ stores.store ("host", run_host);
+
+ run_hosts = malloc (nprocs * sizeof * run_hosts);
+#ifdef CCTK_MPI
+ // Note: Only the root processor actually comes here
+ MPI_Gather (run_host, sizeof run_host, MPI_CHAR,
+ run_hosts, sizeof * run_hosts, MPI_CHAR,
+ 0, MPI_COMM_WORLD);
+#else
+ assert (nprocs == 1);
+ strcpy (run_hosts[0], run_host);
+#endif
+ for (n = 0; n < nprocs; ++ n) {
+ ostringstream namebuf;
+ namebuf << "hosts[" << n << "]";
+ string const namestr = namebuf.str();
+ strcpy (run_host, run_hosts[n]);
+ stores.store (namestr.c_str(), run_host);
+ }
+ free (run_hosts);
+ }
+#endif
{
unsigned long http_port;
@@ -515,6 +551,28 @@ namespace Formaline
}
}
}
+
+ {
+ int const numthorns = ThornList::NumThorns ();
+ char const * const * const thornnames = ThornList::ThornNames ();
+ for (int thorn = 0; thorn < numthorns; ++ thorn)
+ {
+ string const combination = thornnames [thorn];
+ size_t const sep = combination.find ('/');
+ assert (sep != string::npos);
+ string const arrangement = combination.substr (0, sep);
+ string const thornname = combination.substr (sep + 1);
+
+ ostringstream keybuf;
+ keybuf << "thorns_arrangement/" << thornname;
+ string const keystr = keybuf.str();
+ char const * const key = keystr.c_str();
+
+ char const * const value = arrangement.c_str();
+
+ stores.store (key, value);
+ }
+ }