cuik.c File Reference

Detailed Description


This is the CuikSuite application for position analysis.

If CuikSuite is compiled with MPI=1 (see CMakeList.txt in the main CuikSuite directory) cuik will be prepared to take advantage of multi-processors systems. To distribute the execution among several processors you should use the rmpicuik script (check the scripts directory).
Be aware that even if you compile with MPI=1, if you execute this application and not rmpicuik, the execution will use only one processor.

If a .state file exists for the problem at hand, cuik will resume the execution from this saved state. If you want to start from scratch, remove the .state file. State files are only present if the execution of cuik on a given problem was, for some reason, interrupted. If cuik terminates properly it takes care of removing the state file for the problem at hand.

This application take as inputs

  • A set of equations in a .cuik file. The equations can be hand-coded or can be generated from abstract problem descriptions (i.e.,world files using cuikequations)
  • A set of parameters in a .param file. Those parameters overide the ones in the default parameter file.

When USE_MPI is 0 and DEBUG is 1, the execution of cuik generates lines like

  • <0.0116886 1>[7]... -> <3.19456e-06 0.5>b[4]

Which means that cuik processed a box of volume 0.0116886 and size 1 that was generated after 7 bisections and after iterating three times (this is the meaning of the tree dots after the "[7]") the ReduceBox procedure (see our papers for more details) the result is a box of volume 3.19456e-06 and size 0.5 that is bisected along dimension 4.
Small enough boxes (i.e., smaller that SIGMA) are not bisected but considered solutions. In this case, the output line ends with and s or with and S, the later corresponding to the case where the box is verified to include a solution.

When USE_MPI is 1 and the execution is launched via the rmpicuik script the output is slightly different. We have lines like

  • b<4.29014e+12, 2, 8>-> 31

that mean that a box of volume 4.29014e+12 and size 2 generated after 8 bisections is send to processor number 31 for reduction. Then, we also have lines of the form

  • b[16](t=1)-><1.03916e+09 2>b[2]

which means that the main scheduler received a box back from processor 16 and that, after reduction, the box has volume 1.03916e+09 and size 2 and that it has been split along dimension 2. If, after the process of the box it result empty, the output line is of the form

  • b[16](t=1)-> e

and solution boxes are not bisected but marked with and s.

The output of cuik is a .sol file. If the position analysis problem at hand has isolted solutions, the output of cuik will be a set of non-overlaping boxes, in general, one for each solution. If the problem has a continuous set of solutions, the output boxes bound this continuous set. See the benchmarks for examples of both type of outputs.
The .sol file includes the compilation flags, the parameters used for the cuik execution, a copy of the .cuik input file, and a list of solutions where each solution is of the form

  • 281 (0.000929312):{ 6 st2:[-0.901387818866,-0.87332428828] ct2:[-0.487139289629,-0.433012701892] st3:[0.87332428828,0.901387818866] ct3:[0.433012701892 ,0.487139289629] st4:[-0.000523712590637,0.00052364116326] ct4:[-1,-0.999999862237] }

indicanting that this is solution number 281, that the error of the center of the box when replaced in the set of equations is 0.000929312, that the box has 6 variables and the range for each variable. Finally, the .sol file also includes a set of statistics on the execution (execution time, number of solution boxes, etc.).

Execute the application without parameters to get a short help on how to use cuik.

See Also
cuiksystem.h cuiksystem.c

Definition in file cuik.c.


int main (int argc, char **arg)
 Main body of the cuik application. More...

Function Documentation

int main ( int  argc,
char **  arg 

Main body of the cuik application.


  • cuik problem_name.cuik


  • problem_name contains the kinematic equations.

The .cuik extension is optional.

argcNumber of elements in the command line that starts the application (i.e., the cuik command itself and its arguments).
argStrings with the arguments.
EXIT_SUCCESS (0) if the execution worked out fine and EXIT_FAILURE if not.

Definition at line 172 of file cuik.c.

References CreateFileName(), CUIK_EXT, DeleteCuikSystem(), DeleteFileName(), DeleteParameters(), Error(), FALSE, GetFileFullName(), InitCuikSystemFromFile(), InitParametersFromFile(), MPI_SolveCuikSystem(), MPI_TreatBox(), PARAM_EXT, PrintCuikSystemWithSimplification(), PrintParameters(), randomReset(), SOL_EXT, SolveCuikSystem(), STATE_EXT, TRUE, and VerifyCuikSystem().