Commit 089df520 authored by bonnell's avatar bonnell
Browse files

Add Brad's changes to simulation examples so that they can be run from the test suite.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23339 18c085ea-50e0-402c-830e-de6fd14e8384
parent 59c82132
......@@ -3,6 +3,8 @@
#include <string.h>
#include <stdlib.h>
static char *__sim2_filename__ = NULL;
/*****************************************************************************
* Method: SimulationExample
*
......@@ -64,9 +66,21 @@ SimulationArguments(int argc, char **argv)
++i;
}
#endif
else if(strcmp(argv[i], "-sim2") == 0 &&
(i+1) < argc)
{
__sim2_filename__ = argv[i+1];
++i;
}
}
}
char *
SimulationFilename(void)
{
return __sim2_filename__;
}
/*****************************************************************************
* Method: sim_sleep
*
......
......@@ -1034,7 +1034,7 @@ int main(int argc, char **argv)
#endif
"Demonstrate ghost cells on different mesh types",
"/path/to/where/sim/was/started",
NULL, NULL, NULL);
NULL, NULL, SimulationFilename());
}
/* Read input problem setup, geometry, data.*/
......
......@@ -247,6 +247,7 @@ struct simulation_data
int savingFiles;
int saveCounter;
bool autoupdate;
bool echo;
patch_t patch;
int *patch_list; /* Patch list for this rank. */
......@@ -267,6 +268,7 @@ simulation_data_ctor(simulation_data *sim)
sim->savingFiles = 0;
sim->saveCounter = 0;
sim->autoupdate = false;
sim->echo = false;
patch_ctor(&sim->patch);
sim->patch_list = NULL;
......@@ -649,6 +651,12 @@ ProcessConsoleCommand(simulation_data *sim)
printf(" rank0 Use rank0 patch to processor mapping\n");
printf(" verbose on/off Print processor mapping\n");
}
if(sim->echo && sim->par_rank == 0)
{
fprintf(stderr, "Command %s completed.\n", cmd);
fflush(stderr);
}
}
/******************************************************************************
......@@ -911,6 +919,12 @@ int main(int argc, char **argv)
SimulationArguments(argc, argv);
VisItSetupEnvironment();
for(int i = 1; i < argc; ++i)
{
if(strcmp(argv[i], "-echo") == 0)
sim.echo = true;
}
#ifdef PARALLEL
/* Install callback functions for global communication. */
VisItSetBroadcastIntFunction2(visit_broadcast_int_callback, (void*)&sim);
......@@ -943,7 +957,7 @@ int main(int argc, char **argv)
#endif
"Demonstrates creating the Mandelbrot set on an AMR mesh",
"/path/to/where/sim/was/started",
NULL, "mandelbrot.ui", NULL);
NULL, "mandelbrot.ui", SimulationFilename());
}
/* Read input problem setup, geometry, data. */
......
......@@ -268,7 +268,7 @@ int main(int argc, char **argv)
VisItInitializeSocketAndDumpSimFile("material",
"Demonstrates material data access function",
"/path/to/where/sim/was/started",
NULL, NULL, NULL);
NULL, NULL, SimulationFilename());
/* Read input problem setup, geometry, data. */
read_input_deck();
......
......@@ -266,7 +266,7 @@ int main(int argc, char **argv)
VisItInitializeSocketAndDumpSimFile("materialvar",
"Demonstrates variables restricted to certain materials",
"/path/to/where/sim/was/started",
NULL, NULL, NULL);
NULL, NULL, SimulationFilename());
/* Read input problem setup, geometry, data. */
read_input_deck();
......
......@@ -256,7 +256,7 @@ int main(int argc, char **argv)
VisItInitializeSocketAndDumpSimFile("mesh",
"Demonstrates returning meshes",
"/path/to/where/sim/was/started",
NULL, NULL, NULL);
NULL, NULL, SimulationFilename());
/* Read input problem setup, geometry, data. */
read_input_deck();
......
......@@ -439,7 +439,7 @@ int main(int argc, char **argv)
"Demonstrates multiple blocks (collections of domains) and "
"reduced/enhanced connectivity via domain boundaries.",
"/path/to/where/sim/was/started",
NULL, NULL, NULL);
NULL, NULL, SimulationFilename());
}
/* Read input problem setup, geometry, data.*/
......
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