Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | mathematics | |
Tool | randomnumbers |
The host argument specifies which machine the precompiled server process should be started on. The default value of unset starts it on the same machine as the one that glish is running on. Starting a server process on a remote machine allows you to use the memory and cpu on that machine. As the randomnumbers tool does not use much memory or processor time this is usually not worth it.
In order to run the server process on a remote machine you need to satisfy all the following conditions.
rsh host 'echo \$AIPSPATH'where host is replaced by the name of the remote machine. If the value of the AIPSPATH variable that is printed does not contain something like aips-root architecture site host and that all the values are correct for the remote machine you can be certain that starting the any AIPS++ server, on the remote host will not work
Each server process can only run one function at a time. Hence it is not possible, for example, to simultaneously calculate two different random numbers sequences using one server. To solve this you start two servers. The forcenewserver argument allows you to do this by overriding the default behaviour of having each randomnumbers tool share the same server.
For the randomnumbers tool, in 99.99% of all cases, the default values for the host and forcenewserver arguments will be fine.
host | in | The host on which the server process should be run | |
Allowed: | string | ||
Default: | unset | ||
forcenewserver | in | Always start a new server | |
Allowed: | Boolean | ||
Default: | F |
include 'randomnumbers.g' rand := randomnumbers(); rand.reseed(10); print rand.uniform(-1, 3, 4); print rand.discreteuniform(-1, 3, [4,2]); rand.done()This example creates a randomnumbers tool, and sets the seed to a new value. It then prints the values for random numbers from two different, but similar distributions. Finally the tool is shutdown to release all the memory it has consumed.