# ISCreateGeneralNC

Creates a data structure for an index set containing a list of integers.

### Synopsis

    #include "petscis.h"
    PetscErrorCode  ISCreateGeneralNC(MPI_Comm comm,PetscInt n,const PetscInt idx[],IS *is)

Collective on MPI_Comm

### Input Parameters

| comm | - the MPI communicator
| n | - the length of the index set
| idx | - the list of integers

### Output Parameter

is -the new index set

Notes: This routine does not copy the indices, just keeps the pointer to the indices. The ISDestroy() will free the space so it must be obtained with PetscMalloc() and it must not be freed nor modified elsewhere. Use ISCreateGeneral() if you wish to copy the indices passed into the routine. Use ISCreateGeneralWithArray() to NOT copy the indices and NOT free the space when ISDestroy() is called.

When the communicator is not MPI_COMM_SELF, the operations on IS are NOT conceptually the same as MPI_Group operations. The IS are then distributed sets of indices and thus certain operations on them are collective.

### See Also

ISCreateGeneral(), ISCreateGeneralWithArray(), ISCreateStride(), ISCreateBlock(), ISAllGather()

Level:beginner
Location:src/vec/is/impls/general/general.c
Index of all IS routines
Table of Contents for all manual pages
Index of all manual pages