Commit 447389d1 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Second attempt at fixing the problem with swapmod and template environment.

parent a9ef76e0
......@@ -447,19 +447,6 @@ foreach my $name (keys(%parameters)) {
"for $instance!");
}
# We munge the environment variables.
$instance->InitializeEnvVariables(\%parameters) == 0
or fatal(-1, "Could not add new environment variables to instance");
print "Writing environment strings ...\n";
$instance->WriteEnvVariables() == 0
or fatal(-1, "Could not write environment strings for program agents");
print "Asking program agents to reload ... this will take a moment.\n";
SignalProgAgents("RELOAD") == 0
or $ignoreerrors
or CheckForDeadNodes();
if ($doswapmod) {
#
# Now do the swapmod, using the original NS file for now. The environ
......@@ -467,7 +454,7 @@ if ($doswapmod) {
#
my $archivedir = libArchive::TBUserFileArchiveDirectory($pid, $eid);
my $nsfile = "$archivedir/nsdata/nsfile.ns";
my @arguments = ($swapexp, "-q", "-e", "-x", "-s", "modify",
my @arguments = ($swapexp, "-q", "-x", "-s", "modify",
$pid, $eid, $nsfile);
print "Starting a swap modify ...\n";
......@@ -475,26 +462,31 @@ if ($doswapmod) {
fatal($? >> 8, "Swap modify failed!")
if ($?);
#
# XXX FIX! Do this again, cause the swapmod messed up the env variables.
#
$instance->Refresh();
$instance->Refresh();
}
# We munge the environment variables.
$instance->InitializeEnvVariables(\%parameters) == 0
or fatal(-1, "Could not add new environment variables to instance");
#
# We munge the environment variables *AFTER* the potential swapmod since
# it will have scrogged the user env.
#
$instance->InitializeEnvVariables(\%parameters) == 0
or fatal(-1, "Could not add new environment variables to instance");
$instance->WriteEnvVariables() == 0
or fatal(-1, "Could not write environment strings for program agents");
}
else {
#
# Restart the event stream from the beginning.
#
print "Asking the event system to replay events ...\n";
system("$eventcontrol replay $pid $eid") == 0
or fatal(-1, "Could not restart the event system!");
}
print "Writing environment strings ...\n";
$instance->WriteEnvVariables() == 0
or fatal(-1, "Could not write environment strings for program agents");
print "Asking program agents to reload ... this will take a moment.\n";
SignalProgAgents("RELOAD") == 0
or $ignoreerrors
or CheckForDeadNodes();
#
# Restart the event stream from the beginning.
#
print "Asking the event system to replay events ...\n";
system("$eventcontrol replay $pid $eid") == 0
or fatal(-1, "Could not restart the event system!");
print "Experiment run '$runid' has been started.\n";
done:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment