<< Main program of MMC >> More...
#include <stdlib.h>
#include <time.h>
#include "simpmesh.h"
#include "tettracing.h"
#include "mcx_utils.h"
Functions | |
int | main (int argc, char **argv) |
<< Main program of MMC >>
int main | ( | int | argc, | |
char ** | argv | |||
) |
In this unit, we first launch a master thread and initialize the necessary data structures. This include the command line options (cfg), tetrahedral mesh (mesh) and the ray-tracer precomputed data (tracer).
parse command line options to initialize the configurations
The master thread then spawn multiple work-threads depending on your OpenMP settings. By default, the total thread number (master + work) is your total CPU core number. For example, if you have a dual-core CPU, the total thread number is 2; if you have two quad-core CPUs, the total thread number is 8. If you want to set the total thread number manually, you need to set the OMP_NUM_THREADS environment variable. For example, OMP_NUM_THREADS=3
sets the total thread number to 3.