anuga-cuda OpenHMPP Code Structure

Python Class

class anuga_HMPP.HMPP_domain(coordinates=None, vertices=None, boundary=None, source=None, triangular=None, conserved_quantities=None, evolved_quantities=None, other_quantities=None, tagged_elements=None, geo_reference=None, use_inscribed_circle=False, mesh_fulename=None, use_cache=False, verbose=False, full_send_dict=None, ghost_recv_dict=None, starttime=0.0, processor=0, numproc=1, number_of_full_nodes=None, number_of_full_triangles=None, ghost_layer_width=2)

ANUGA in OpenHMPP implementation.

In this version, only the mesh information is generated by Python grogram, while the overall evolve procedure is moved to C (OpenHMPP) implementation. This is for the benefits of the performance, since passing host control back and force between Python and C throught Python/C API can be costly.

convert_boundary_elements()

Write down all mesh boundary information into file.

This is used to pass boundary information to C implementation.

evolve(yieldstep=0.0, finaltime=1.0, duration=0.0, skip_initial_step=False)

Evolve function

Here the overall evolution starts, but the procedures are done in the C implementation.

Python/C API

PyObject *hmpp_evolve(PyObject *self, PyObject *args)

This function sets up the communication between Python program and OpenHMPP program. Refer to hmpp_python_glue.c

OpenHMPP Implementation

struct domain

This type is used to link all the mesh information generated by Python ANUGA progrm so that this information is accessable for C functions. Note: this is a upgrated C struct type from original ANUGA sw_domain.h. Refer to sw_domain.h

struct domain* get_python_domain(struct domain *D, PyObject *domain)

Link up all mesh information stored in PyObject to the instance of struct domain. Note: this is a upgrated function from original ANUGA sw_domain.h. Refer to sw_domain_fun.h

double evolve(struct domain * D, double yieldstep, double finaltime, double duration, double epsilon, int skip_initial_step, int step)

The C implementation of the original Python evolve function. Refer to sw_domain_fun.h

void download_data(struct domain *D)

Download all the mesh information from the device memory. This is used in the advanced version with OpenHMPP Mirrored Data. Refer to evolve.c

void allocate_upload_data(struct domain *D)

Upload all the mesh information to the device memory. This is used in the advanced version with OpenHMPP Mirrored Data. Refer to evolve.c

USING_MIRROR_DATA

Denoting enabling the advanced version. Refer to hmpp_fun.h

USING_GLOBAL_DIRECTIVES

Denoting keeping all OpenHMPP directives with function declaration. The local directive is used for testing. Refer to hmpp_fun.h

Table Of Contents

Previous topic

anuga-cuda CUDA Code Structure

Next topic

anuga-cuda Utilities Code Structure

This Page