MAOS
Multithreaded Adaptive Optics Simulator
|
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) |
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 (const char *host, 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.
void parse_host | ( | const char * | line | ) |
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
const char* lookup_hostaddr | ( | const char * | hostname | ) |
Translate hostname to address based on ~/.aos/hosts
const char* lookup_hostname | ( | const char * | hostaddr | ) |
Translate address to hostname based on ~/.aos/hosts
pthread_t scheduler_listen | ( | thread_fun | fun | ) |
Started by maos to listen to the sock which connects to the scheduler for commands. It requires a new connection to the scheduler to avoid data racing (?).
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
void scheduler_report | ( | status_t * | status | ) |
called by sim.c to report job status. Do not try to reconnect.
int scheduler_launch_exe | ( | const char * | host, |
int | argc, | ||
const char * | argv[] | ||
) |
Ask scheduler (maybe in another machine) to launch executable.
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.
int print_backtrace_symbol | ( | void *const * | buffer, |
int | size | ||
) |
Convert backtrace address to source line. Do not call routines that may call malloc as the mutex in malloc may already be locked. return 0 if success otherwise -1