![]() |
MAOS
Multithreaded Adaptive Optics Simulator
|
Data Structures | |
| struct | status_t |
Macros | |
| #define | scheduler_version 53 |
Functions | |
| void | parse_host (const char *line) |
| void | free_hosts () |
| void | init_hosts () |
| const char * | lookup_hostaddr (const char *hostname) |
| const char * | lookup_hostname (const char *hostaddr) |
| int | scheduler_connect (const char *hostname) |
| int | scheduler_connect_self (int block) |
| pthread_t | scheduler_listen (thread_fun fun) |
| void | scheduler_report_path (const char *path) |
| void | scheduler_start (int nthread, int ngpu, int waiting) |
| void | scheduler_finish (int status) |
| void | scheduler_report (status_t *status) |
| int | scheduler_launch_exe (char *hostarr, int argc, const char *argv[]) |
| int | scheduler_socket (int dir, int *sfd, int id) |
| int | call_addr2line (char *ans, int nans, const char *cmd) |
| int | print_backtrace_symbol (void *const *buffer, int size) |
| void | print_backtrace () |
Contains routines that will be used to talk to the scheduler.
| struct status_t |
Status about each process. Timing, wavefront error, etc.
Collaboration diagram for status_t:| Data Fields | ||
|---|---|---|
| double | wfs | |
| double | recon | |
| double | other | |
| double | eval | |
| double | tot | |
| double | scale | |
| double | mean | |
| long | rest | |
| long | laps | |
| int | iseed | |
| int | nseed | |
| int | nthread | |
| int | isim | |
| int | simstart | |
| int | simend | |
| char | done | |
| char | warning | |
| char | unused1 | |
| char | unused2 | |
| double | clerrlo | |
| double | clerrhi | |
| int | info | |
| time_t | timstart | |
| time_t | timlast | |
Parse and add host info to hosts[] and hostaddr[]. hosts contains the shortcut name, without dot and hostaddr contains the FQDN and optionally the port
| line | contains hostname[=hostaddr:port] |
| void free_hosts | ( | ) |
free hosts[] and hostsaddr[]
| void init_hosts | ( | ) |
Initialize hosts and associate an id number
Translate hostname to address based on ~/.aos/hosts
Translate address to hostname based on ~/.aos/hosts
| int scheduler_connect_self | ( | int | block | ) |
To open a port and connect to scheduler in the local host
| pthread_t scheduler_listen | ( | thread_fun | fun | ) |
Started by maos to listen to the sock which connects to the scheduler for commands. It reuses existing connection.
| void scheduler_start | ( | int | nthread, |
| int | ngpu, | ||
| int | waiting | ||
| ) |
Called by maos to report a job start to scheduler and wait for signal before proceeding if waiting is set.
| void scheduler_finish | ( | int | status | ) |
Called by maos to notify scheduler the completion of a job
called by sim.c to report job status. Do not try to reconnect.
| int scheduler_launch_exe | ( | char * | hostarr, |
| int | argc, | ||
| const char * | argv[] | ||
| ) |
Ask scheduler (maybe in another machine) to launch executable. Host may be null or contain coma separated hosts returns <0 for error. >=0 success
| int scheduler_socket | ( | int | dir, |
| int * | sfd, | ||
| int | id | ||
| ) |
send a drawing sock to the scheduler for caching (dir=1) or request a sock for drawing (dir=-1). id should be between 1 and 9999.
| int call_addr2line | ( | char * | ans, |
| int | nans, | ||
| const char * | cmdstr | ||
| ) |
Execute addr2line as specified in buf, combine the answer, and return the string.