Implementation of the runtime call to the remote process.
Performs the encoding of python arguments into lists of values, sends a message over an MPI channel and waits for a result message, decodes this message and returns.
Abstract base class for all interfaces to legacy codes.
When a subclass is instantiated, a number of subprocesses will be started. These subprocesses are called workers as they implement the interface and do the actual work of the instantiated object.
Called everytime just before a parameter is retrieved in using:: instance.parameter.name
Called everytime just before a parameter is updated in using:: instance.parameter.name = newvalue
Returns the root name of the directory for the application data files
Returns the root name of the directory to use by the application to store it’s output / temporary files in.
Gets the message polling interval for MPI header messages, in microseconds
int32 internal__get_message_polling_interval(int32 * polling_interval);
FUNCTION internal__get_message_polling_interval(polling_interval)
INTEGER :: polling_interval
INTEGER :: internal__get_message_polling_interval
END FUNCTION
Parameters: | polling_interval (int32, OUT) – |
---|---|
Returns: |
int32 internal__set_message_polling_interval(int32 polling_interval);
FUNCTION internal__set_message_polling_interval(polling_interval)
INTEGER :: polling_interval
INTEGER :: internal__set_message_polling_interval
END FUNCTION
Parameters: | polling_interval (int32, IN) – |
---|---|
Returns: |
Redirect the output of the code to null, standard streams or file
Specification of a legacy function. Describes the name, result type and parameters of a legacy function.
The legacy functions are implemented by legacy codes. The implementation of legacy functions is in C/C++ or Fortran. To interact with these functions a specification of the legacy function is needed. This specification is used to determine how to encode and decode the parameters and results of the function. Objects of this class describe the specification of one function.
>>> specification = LegacyFunctionSpecification()
>>> specification.name = "test"
>>> specification.addParameter("one", dtype="int32", direction = specification.IN)
>>> specification.addParameter("two", dtype="float64", direction = specification.OUT)
>>> specification.result_type = "int32"
>>> print specification
function: int test(int one)
output: double two, int __result
Used to specify that a parameter is used as an input parameter, passed by value
Used to specify that a parameter is used as an input and an outpur parameter, passed by reference
Used to specify that a parameter is used as the length parameter for the other parameters
Used to specify that a parameter is used as an output parameter, passed by reference
Extend the specification with a new parameter.
The sequence of calls to addParameter is important. The first call will be interpreted as the first argument, the second call as the second argument etc.
Parameters: |
|
---|
Base class for codes having a python implementation
Parameters: | implementation_factory – Class of the python implementation |
---|
Decorator for legacy functions.
The decorated function cannot have any arguments. This means the decorated function must not have a self argument.
The decorated function must return a LegacyFunctionSpecification.
>>> class LegacyExample(object):
... @legacy_function
... def evolve():
... specification = LegacyFunctionSpecification()
... return specification
...
>>> x = LegacyExample()
>>> x.evolve.specification
<amuse.rfi.core.LegacyFunctionSpecification object at 0x...>
>>> LegacyExample.evolve
<amuse.rfi.core.legacy_function object at 0x...>
>>> x.evolve
<amuse.rfi.core.CodeFunction object at 0x...>
Parameters: | specification_function – The function to be decorated |
---|
Stop the workers of all instantiated interfaces.
All instantiated interfaces will become unstable after this call!