# CreateDescriptorDM

Allocates memory for the descriptor data structure and preliminarily initializes it.

## Syntax

Fortran:

Status = DftiCreateDescriptorDM(comm, handle, v1, v2, dim, size)

Status = DftiCreateDescriptorDM(comm, handle, v1, v2, dim, sizes)

C/C++:

status = DftiCreateDescriptorDM(comm, &handle, v1, v2, dim, size );

status = DftiCreateDescriptorDM(comm, &handle, v1, v2, dim, sizes );

## Input Parameters

comm
  MPI communicator, e.g. MPI_COMM_WORLD.
v1
  Precision of the transform.
v2
  Type of the forward domain. Must be `DFTI_COMPLEX` for the current version.
dim
  Dimension of the transform.
size
  Length of the transform in a one-dimensional case.
sizes
  Lengths of the transform in a multi-dimensional case.

## Output Parameters

handle
  Pointer to the descriptor handle of transform. If the function completes successfully, the pointer to the created handle is stored in the variable.

## Description

This function allocates memory in a particular MPI process for the descriptor data structure and instantiates it with default configuration settings with respect to the precision, domain, dimension, and length of the desired transform. The domain is understood to be the domain of the forward transform. The result is a pointer to the created descriptor. This function is slightly different from the "initialization" function DftiCommitDescriptorDM in a more traditional software packages or libraries used for computing the FFT. This function does not perform any significant computation work, such as twiddle factors computation, because the default configuration settings can still be changed using the function DftiSetValueDM.

The value of the parameter v1 is specified through named constants DFTI_SINGLE and `DFTI_DOUBLE`. It corresponds to precision of input data, output data, and computation. A setting of `DFTI_SINGLE` indicates single-precision floating-point data type and a setting of `DFTI_DOUBLE` indicates double-precision floating-point data type.

The parameter dim is a simple positive integer indicating the dimension of the transform.

In C/C++, for one-dimensional transforms, length is a single integer value of the parameter size having type long; for multi-dimensional transforms, length is supplied with the parameter sizes, which is an array of integers having type long. In Fortran, length is an integer or an array of integers.

## Return Values

The function returns `DFTI_NO_ERROR` when completes successfully. In this case, the pointer to the created descriptor handle is stored in handle. If the function fails, it returns a value of another error class constant (for the list of constants, refer to Error Codes).

## Interface and Prototype

! Fortran Interface

INTERFACE DftiCreateDescriptorDM

INTEGER(4) FUNCTION DftiCreateDescriptorDMn(C,H,P1,P2,D,L)

TYPE(DFTI_DESCRIPTOR_DM), POINTER :: H

INTEGER(4) C,P1,P2,D,L(*)

END FUNCTION

INTEGER(4) FUNCTION DftiCreateDescriptorDM1(C,H,P1,P2,D,L)

TYPE(DFTI_DESCRIPTOR_DM), POINTER :: H

INTEGER(4) C,P1,P2,D,L

END FUNCTION

END INTERFACE

/* C/C++ prototype */

long DftiCreateDescriptorDM(MPI_Comm,DFTI_DESCRIPTOR_DM_HANDLE*,

enum DFTI_CONFIG_VALUE,enum DFTI_CONFIG_VALUE,long,...);

Parent topic: Descriptor Manipulation Functions