78#include "chomp/system/config.h"
79#include "chomp/system/textfile.h"
80#include "chomp/system/timeused.h"
81#include "chomp/system/arg.h"
82#include "chomp/multiwork/mw.h"
99This is a Conley-Morse graphs computation program.\n\
100Ver. 0.09, July 15, 2014. Copyright (C) 2005-2014 by Pawel Pilarczyk.\n\
101This is free software. No warranty. Consult 'license.txt' for details.";
107This is the front-end program for the computation of Conley-Morse graphs\n\
108for a selected range of parameters for a given discrete dynamical system,\n\
109as configured in the file 'config.h' of the source code. Please, see the\n\
110documentation of the program and the source code for more information.\n\
111Command line arguments (either '-w', or '-c' and '-f' must be specified):\n\
112-w computer:port - run as a worker and connect to the given coordinator,\n\
113-c [port] - run as a coordinator and listen to workers at the given port;\n\
114\tif port=0 (default) then runs the computations locally only,\n\
115-f prefix - file name prefix for saving the final continuation data,\n\
116-i filename - intermediate results file (new results will be appended),\n\
117-g filename - file name to save the text code for Conley-Morse graphs,\n\
118-m prefix - file name prefix for text code of Conley-Morse graphs,\n\
119-s prefix - file name prefix for shared info on Morse decompositions,\n\
120-p prefix - file name prefix for PNG pictures of Morse decompositions,\n\
121-q prefix - file name prefix for Morse sets as lists of cubes,\n\
122-o prefix - file name prefix for post-processing Morse sets information,\n\
123-t filename - file name with optimization information (read & append),\n\
124-u prefix - file name prefix for ODE integration optimization information,\n\
125-z prefix - prefix for temporary files with Morse decompositions cache,\n\
126-n num - the number of parameter space patches for matching;\n\
127\tvalue <0 sets the distance between patch corners in each direciton,\n\
128--full - use the full range of the phase space to plot Morse sets,\n\
129--log filename - file name to save all the text output of the program to,\n\
130--quiet - suppress any output written to the terminal,\n\
131--debug - display a lot of additional information (for debugging etc.),\n\
132--help - make the program show this brief help information and exit.\n\
133For more information ask the author at http://www.pawelpilarczyk.com/.";
142int main (
int argc,
char *argv [])
144 using namespace chomp::homology;
147 char *workAddress = 0;
148 char *interFileName = 0;
149 char *mapOptFileName = 0;
150 char *mapOptPrefix = 0;
151 char *graphsFileName = 0;
152 char *graphsPrefix = 0;
153 char *finalPrefix = 0;
154 char *sharePrefix = 0;
155 char *phaseSpacePrefix = 0;
156 char *morseDecPrefix = 0;
157 char *cubesPrefix = 0;
158 char *procPrefix = 0;
161 bool fullPhaseSpace =
false;
163 const int maxComments = 16;
165 char *comments [maxComments];
169 arg (a,
"c", coordPort, 0);
170 arg (a,
"w", workAddress);
171 arg (a,
"i", interFileName);
172 arg (a,
"t", mapOptFileName);
173 arg (a,
"u", mapOptPrefix);
174 arg (a,
"g", graphsFileName);
175 arg (a,
"m", graphsPrefix);
176 arg (a,
"f", finalPrefix);
177 arg (a,
"s", sharePrefix);
178 arg (a,
"q", cubesPrefix);
179 arg (a,
"o", procPrefix);
180 arg (a,
"p", phaseSpacePrefix);
181 arg (a,
"z", morseDecPrefix);
182 arg (a,
"n", nPatches);
183 arg (a,
"-comment", comments, nComments, maxComments);
184 arg (a,
"-skip-indices", skipIndices, 1);
185 argswitch (a,
"-full", fullPhaseSpace,
true);
188 argstreamprepare (a);
189 int argresult = a. analyze (argc, argv);
194 if (finalPrefix && (coordPort < 0))
198 if (!finalPrefix && !workAddress)
203 sout <<
title <<
'\n';
208 sout <<
"Call with '--help' for help.\n";
223 program_time =
"Aborted after:";
231 w. Add (workAddress);
233 sout <<
"Running as a worker...\n";
234 int result = w. Work ();
235 if (result == chomp::multiwork::mwOk)
236 sout <<
"Work completed successfully.\n";
238 sout <<
"Could not work - probably "
239 "an error occurred.\n";
247 mapOptFileName, mapOptPrefix,
248 graphsFileName, graphsPrefix,
249 finalPrefix, sharePrefix,
250 phaseSpacePrefix, cubesPrefix,
251 morseDecPrefix, procPrefix,
252 fullPhaseSpace, skipIndices, nPatches);
254 sout <<
"Running as a coordinator...\n";
255 int result = c. Coordinate (coordPort ? 0 : &w);
256 if (result == chomp::multiwork::mwOk)
257 sout <<
"The task completed successfully.\n";
259 sout <<
"Could not coordinate - probably "
260 "an error occurred.\n";
264 program_time =
"Total time used:";
269 catch (
const char *msg)
271 sout <<
"ERROR: " << msg <<
'\n';
274 catch (
const std::exception &e)
276 sout <<
"ERROR: " << e. what () <<
'\n';
281 sout <<
"ABORT: An unknown error occurred.\n";
The coordinator class which prepares chunks of parameter space to be processed by workers,...
The worker class that processes single chunks of data which contain the definition of a selected rect...
int main(int argc, char *argv[])
The main procedure of the program.
const char * helpinfo
The help information about the program which is displayed if the program is launched without command-...
const char * title
The title of the program which is displayed every time the program is launcued.
Choice of configuration settings.
The coordinator class for the Conley-Morse graphs computation program.
Customizable data types for the Conley-Morse graphs computation program.
Data types for the dynamical systems data structures.
The worker class for the Conley-Morse graphs computation program.