-------------------------------------------------- lines 9-117 of file: at_cascade/fit_one_process.py -------------------------------------------------- {xrst_begin fit_one_process} {xrst_spell cpus dtype inuse numpy } Fit Using One Process ##################### Keep fitting jobs for as long as there are jobs ready to be fit. Prototype ********* {xrst_literal # BEGIN_DEF # END_DEF } job_table ********* This is a :ref:`create_job_table@job_table` containing all the jobs necessary to fit the :ref:`glossary@fit_goal_set` . this_job_id *********** if skip_this_job is false, the fit for this ref:`create_job_table@job_table@job_id` is ready to be fit and will be fit first. Otherwise, *this_job_id* is ignored. all_node_database ***************** :ref:`fit_one_job@all_node_database` node_table ********** :ref:`fit_one_job@node_table` fit_integrand ************* :ref:`fit_one_job@fit_integrand` skip_this_job ************* see :ref:`fit_one_process@this_job_id` above. 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. job_status_name *************** is the name corresponding to each possible job status integer values. If *i* is an integer job status value, *job_status_name* [ *i* ] is the corresponding name. .. csv-table:: :header-rows: 1 Name, Meaning 'skip' , This is a prior only job and completed by the parent fit 'wait', job is waiting for it's parent job to finish 'ready', job is ready to run 'run', job is running 'done', job finished running 'error', job had an exception 'abort', job is a descendant of a job that had an exception shared_job_status_name ********************** This is the name of the shared job status memory. The corresponding multiprocessing shared memory is a numpy array with ``dtype`` equal to ``int`` and with length equal to the length of *job_table* . The value *shared_job_status* [ *job_table_index* ] is the integer status code for the corresponding job; see *job_status_name* above. number_cpu_inuse **************** This is the name of the number of cpus in use memory. The corresponding multiprocessing shared memory is a numpy array with ``dtype`` equal to ``int`` and with length equal to one. The value *number_cpu_inuse* [0] is the number of cpus (processes) currently fitting this cascade. shared_lock *********** is a shared memory lock, used by all the fit processes, that must be acquired to read or write shared memory; i.e., *shared_job_status* or *shared_number_cpu_in_use* . shared_event ************ is multiprocessing event, used by all the fit processes, that is used to signal that the shared memory has changed. {xrst_end fit_one_process}