fit_parallel

View page source

Fit With Specified Maximum Number of Processes

Prototype

# at_cascade.fit_parallel
def fit_parallel(
    job_table         ,
    start_job_id      ,
    all_node_database ,
    node_table        ,
    fit_integrand     ,
    skip_start_job    ,
    max_number_cpu    ,
    fit_type_list     ,
    shared_unique     ,
) :
    #
    assert type(job_table)         == list
    assert type(start_job_id)      == int
    assert type(all_node_database) == str
    assert type(node_table)        == list
    assert type(fit_integrand)     == set
    assert type(skip_start_job)    == bool
    assert type(max_number_cpu)    == int
    assert type(fit_type_list)     == list
    assert type(shared_unique)     == str

job_table

This is a job_table containing all the jobs necessary to fit the fit_goal_set .

start_job_id

This is the job_id for the starting job. The fit_parallel routine will not return until this job, and all it descendants in the job table, have been run, or an error occurs that prevents a job from completing..

all_node_database

all_node_database

node_table

node_table

fit_integrand

fit_integrand

skip_start_job

If this is true (false) the job corresponding to start_job_id will be skipped (will not be skipped). If this argument is true, the start job must have already been run. This is useful when using continue_cascade .

max_number_cpu

This is the maximum number of cpus (processes) to use. This must be greater than zero. If it is one, the jobs are run sequentially; i.e., not in parallel.

fit_type_list

This is a list with one or two elements and its possible elements are both and fixed. For each job, the first type of fit is attempted. If it fails, and there is a second type of fit, it is attempted. If it also fails, the corresponding job fails.

shared_unique

All of these jobs us the following two python multiprocessing shared memory names:

shared_memory_prefix _ job_name shared_unique _number_cpu_in_use
shared_memory_prefix _ job_name shared_unique _job_status
  1. job_name is job_table [ start_job_id ] [ "job_name" ]

  2. shared_memory_prefix is specified in the option all table.

  3. shared_unique is text that makes this shared memory name unique among all the currently running calls to fit_parallel. It is suggested that you use the empty string for this value unless you are running more than one call with the same prefix and job name.

trace.out

If the max_number_cpu is one, standard output is not redirected. Otherwise, standard output for each job is written to a file called trace.out in the same directory as the database for the job.