MAOS
Multithreaded Adaptive Optics Simulator
Loading...
Searching...
No Matches
maos.c File Reference

Macros

#define VAR_GET(STRUCT, FIELD)
#define VAR_GET_2(STRUCT, FIELD, NUM)
#define MAP_ALL(NAME)

Functions

void maos_final (int sig)
int maos_signal_handler (int sig)
int main (int argc, const char *argv[])

Detailed Description

Defines main() and a few utilities. *

Macro Definition Documentation

◆ VAR_GET

#define VAR_GET ( STRUCT,
FIELD )
Value:
{#STRUCT "." #FIELD, global->STRUCT?(void*)global->STRUCT->FIELD:NULL}

◆ VAR_GET_2

#define VAR_GET_2 ( STRUCT,
FIELD,
NUM )
Value:
{#STRUCT "[" #NUM "]." #FIELD, global->STRUCT?(void*)global->STRUCT[NUM].FIELD:NULL}

◆ MAP_ALL

#define MAP_ALL ( NAME)
Value:
{#NAME "_", NAME ## _map}

Function Documentation

◆ maos_final()

void maos_final ( int sig)

Rename the log files when simulation exits or when signal is caught.

Parameters
[in]sigSignal number caught, or 0 for normal exit.

◆ maos_signal_handler()

int maos_signal_handler ( int sig)

Handles signals.

Parameters
[in]sigSignal number caught.
Returns
0.

◆ main()

int main ( int argc,
const char * argv[] )

This is the standard entrance routine to the program. It first calls setup_parms() to setup the simulation parameters and check for possible errors. It then waits for starting signal from the scheduler if in batch mode. Finally it hands the control to maos() to start the actual simulation.

Call maos with overriding *.conf files or embed the overriding parameters in the command line to override the default parameters, e.g.

maos base.conf save.setup=1 'powfs.phystep=[0 100 100]'

Parameters given as key=value in the command line override those in .conf files given in the command line, which override the master .conf, regardless of the order. Within each of them, a later value overrides an earlier one. The configure file default.conf will be loaded as the master .conf unless a -c switch is used with another .conf file. For scao simulations, call maos with -c switch and the right base .conf file.

maos -c scao_ngs.conf override.conf

for scao NGS simulations

maos -c scao_lgs.conf override.conf

for scao LGS simulations. With -c switch, default.conf will not be read, instead scao_ngs.conf or scao_lgs.conf are read as the master config file. Do not specify any parameter that are not understood by the code, otherwise maos will complain and exit to prevent accidental mistakes.

Generally you link the maos executable into a folder that is in your PATH evironment or into the folder where you run simulations.

Other optional parameters:

-d          do detach from console and not exit when logged out
-n 4        launch 4 threads.
-f          To disable job scheduler and force proceed
sim.seeds=[2 4]  set seeds to [2 4]

In detached mode, drawing is automatically disabled.

Parameters
[in]argcNumber of command line arguments.
[in]argvCommand line arguments.
Returns
signal_caught: 0 for normal exit, otherwise the signal number caught.
Here is the call graph for this function: