MAOS
Multithreaded Adaptive Optics Simulator
maos.c File Reference

Macros

#define VAR_GET(STRUCT, FIELD)   {#STRUCT "." #FIELD, global->STRUCT->FIELD}
 
#define VAR_GET_2(STRUCT, FIELD, NUM)   {#STRUCT "[" #NUM "]." #FIELD, global->STRUCT[NUM].FIELD}
 
#define MAP_ALL(NAME)   {#NAME "_", NAME ## _map}
 

Functions

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

Detailed Description

Defines main() and a few utilities. *

Function Documentation

◆ 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]'

Any duplicate parameters will override the pervious specified value. 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
-s 2 -s 4   set seeds to [2 4]
-n 4        launch 4 threads.
-f          To disable job scheduler and force proceed

In detached mode, drawing is automatically disabled.

+ Here is the call graph for this function: