#include <mpi.h>
#include "step1_funcs.hpp"
#include "mtrand.hpp"
#include "random.hpp"
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <vector>
#include <map>
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <iomanip>
#include "step2_funcs.hpp"
#include "timing.hpp"
#include <gmp.h>
#include "bertini.h"
Go to the source code of this file.
|
void | computeNumDenom (char **numer, char **denom, char *s) |
|
void | getTermination_OpenMC (std::ifstream &mc_in_stream, std::ofstream &mc_out_stream, int &terminationint, std::vector< int > &KVector, runinfo ¶motopy_info, ProgSettings ¶motopy_settings) |
|
int | GetStart (boost::filesystem::path dir, std::string &start, std::string startfilename) |
|
int | GetLastNumSent (boost::filesystem::path base_dir, std::vector< int > &lastnumsent, int numprocs) |
|
void | ReadDotOut (std::vector< std::string > &Numoutvector, std::vector< std::string > &arroutvector, std::vector< std::string > °outvector, std::vector< std::string > &namesoutvector, std::vector< std::string > &configvector, std::vector< std::string > &funcinputvector, std::vector< std::string > &preproc_datavector) |
|
void | WriteDotOut (std::vector< std::string > &arroutvector, std::vector< std::string > °outvector, std::vector< std::string > &namesoutvector, std::vector< std::string > &configvector, std::vector< std::string > &funcinputvector, std::vector< std::string > &preproc_datavector) |
|
void | WriteNumDotOut (std::vector< std::string > Numoutvector, std::vector< std::pair< double, double > > AllParams, int numparam, bool standardstep2) |
|
int | GetMcNumLines (boost::filesystem::path base_dir, int numparam) |
|
#define __STEP2READANDWRITE_H__ |
void computeNumDenom |
( |
char ** |
numer, |
|
|
char ** |
denom, |
|
|
char * |
s |
|
) |
| |
the computeNumdenom function is in the bertini library, but not the headers, hence its inclusion here. it takes in a character array, and pointers which return the numerator and denominator of the number. We pass the input by casting via (char *)
- Parameters
-
s | the number to be converted to rational form |
- Returns
- numer the numerator
-
denom the denomenator
int GetLastNumSent |
( |
boost::filesystem::path |
base_dir, |
|
|
std::vector< int > & |
lastnumsent, |
|
|
int |
numprocs |
|
) |
| |
Deprecated. Gets the highest index set on a previous attempt at the run.
- Parameters
-
base_dir | Directory in which to look for the lastnumsent0,1 files |
lastnumsent | Mutable vector in which to place the lastnumsent info read in by this function |
numprocs | Number of processors in this attempt. |
int GetMcNumLines |
( |
boost::filesystem::path |
base_dir, |
|
|
int |
numparam |
|
) |
| |
Gets the number of lines in the mc file. essentially reads the top line of the file.
- Parameters
-
base_dir | The directory in which to look for the mcfile. |
numparam | Number of parameters in the problem. Deprecated? |
- Returns
- terminationint - The number of parameter points in the file. Note that this could acceptably be smaller than the actual number, but not larger.
Definition at line 167 of file step2readandwrite.cpp.
Referenced by master_process::GetTerminationInt(), and failinfo::PerformAnalysis().
int GetStart |
( |
boost::filesystem::path |
dir, |
|
|
std::string & |
start, |
|
|
std::string |
startfilename |
|
) |
| |
void getTermination_OpenMC |
( |
std::ifstream & |
mc_in_stream, |
|
|
std::ofstream & |
mc_out_stream, |
|
|
int & |
terminationint, |
|
|
std::vector< int > & |
KVector, |
|
|
runinfo & |
paramotopy_info, |
|
|
ProgSettings & |
paramotopy_settings |
|
) |
| |
gets the number of points in the parameter set, and opens the mc_out_stream file (if applicable). for both the user-defined style and the computer-generated.
- Parameters
-
mc_in_stream | MUTABLE the stream for reading parameter points in the case of user-defined parameter points. |
mc_out_stream | MUTABLE the stream for WRITING parameter points in case of computer-generated points. |
terminationint | MUTABLE the number of points in the solve |
KVector | vector of indices, for conversion from an integer to an index vector. |
paramotopy_info | the parsed input file. |
paramotopy_settings | the bertini and paramotopy settings for the current run. |
void ReadDotOut |
( |
std::vector< std::string > & |
Numoutvector, |
|
|
std::vector< std::string > & |
arroutvector, |
|
|
std::vector< std::string > & |
degoutvector, |
|
|
std::vector< std::string > & |
namesoutvector, |
|
|
std::vector< std::string > & |
configvector, |
|
|
std::vector< std::string > & |
funcinputvector, |
|
|
std::vector< std::string > & |
preproc_datavector |
|
) |
| |
Reads in all .out files, into mutable vectors of strings. Assumes the process is working in the directory containing the files.
- Parameters
-
Numoutvector | Stores the num.out file. |
arroutvector | Stores the arr.out file. |
degoutvector | Stores the deg.out file. |
namesoutvector | Stores the names.out file. |
configvector | Stores the config file. |
funcinputvector | Stores the func_input file. |
preproc_datavector | Store the preproc_data file. |
void WriteDotOut |
( |
std::vector< std::string > & |
arroutvector, |
|
|
std::vector< std::string > & |
degoutvector, |
|
|
std::vector< std::string > & |
namesoutvector, |
|
|
std::vector< std::string > & |
configvector, |
|
|
std::vector< std::string > & |
funcinputvector, |
|
|
std::vector< std::string > & |
preproc_datavector |
|
) |
| |
Writes to disk the .out files, but not num.out. This function needs only be called once, and the process must be in the correct directory.
- Parameters
-
arroutvector | Stores the arr.out file. |
degoutvector | Stores the deg.out file. |
namesoutvector | Stores the names.out file. |
configvector | Stores the config file. |
funcinputvector | Stores the func_input file. |
preproc_datavector | Stores the preproc_data file. |
void WriteNumDotOut |
( |
std::vector< std::string > |
Numoutvector, |
|
|
std::vector< std::pair< double, double > > |
AllParams, |
|
|
int |
numparam, |
|
|
bool |
standardstep2 |
|
) |
| |
Writes the num.out file for the bertini solve. We overwrite the appropriate places of the original file with the current parameter values.
- Parameters
-
Numoutvector | Stores the num.out file, as read in by ReadDotOut. |
AllParams | The current parameter values. |
numparam | The numbers of parameters in the problem. |
standardstep2 | Flag to indicate if a parameter continuation run is done * or if a default bertini run is done on multiple parameter points |