crimap documentation (version 2.4)
6. Technical notes
- Memory management
- Memory is allocated dynamically by the program,
as needed; however, since repeated requests of memory from the
operating system (via the C stdio library function malloc) are
quite time-consuming, we have adopted a strategy in which two large
initial blocks of memory are first allocated. One of these is
reserved for the objects comprising the orders database and is
apportioned out as needed by the function our_orders_alloc, while the
other is used for all other memory requirements and is apportioned by
our_alloc.
- If the amounts initially allocated are insufficient,
additional memory is requested from the operating system (via the
library function malloc). (When this happens, a statement to that
effect is printed). The default initial request of 3Mb (for our_alloc)
will suffice for nearly all runs. If the program requests more memory
than the operating system can provide, the program terminates with the
message "ERROR: ALLOCATION FAILED IN MORECORE". If this happens, try
setting the amount of memory specified in the
.par file (using the
parameter nb_our_alloc) to the maximum amount the operating system
will allow you (and see if your system manager can increase that
amount by adjusting operating system parameters). If that fails, you
may need to reduce the number of loci being analyzed (often, deletion
of a single locus having a large number of switches may suffice), or
to split a large pedigree into subpedigrees. I would be interested to
learn of cases where that is necessary, since it may be possible to
improve the switch algebra algorithm to avoid it.
- Underflow
- When mapping large numbers of loci, the individual family
likelihoods involve products of many factors numerically less
than 1, and so can become quite small. If possible, at compilation
time you should select an option for representation of
floating point numbers which allows them to be as small as possible.
With VAX C, this is done by using the /g_float option with
the compile command cc, and then linking with the vaxcrtlg
library.
- 16 bit integers
- C compilers usually represent integer variables
with either 16 or 32 bits. The source code provided to you
assumes that you have a "32 bit" compiler. If, when you first
try to run the program, it terminates prematurely, displaying the
message "Your compiler uses a different size for integers; see
documentation for changes that will have to be made in the source
code", then you have a 16 bit compiler. To get the program to
run correctly you must then make the following two changes in the
source code and recompile:
- in the file "defs.h", replace the line
typedef int INT;
by
typedef long INT;
- Consult the manual for your compiler and determine the name
of a library memory allocation function which takes long
integers, instead of integers, as arguments (the function malloc
takes integer arguments). The name of this function will be
something like "mlalloc" (Lightspeed C) or "_halloc" (Microsoft
C, ver 4.0 or later). Whatever it is, substitute it for "malloc"
throughout the source files our_allo.c and our_orde.c. If your
compiler does not have such a function, you will be unable to run
CRI-MAP.
up: table of contents
previous section: 5. program options
next section: 7. changes incorporated in
versions 2.2 - 2.4