#include "petscvec.h" int PetscMapRegisterDestroy()
PetscMapRegisterDynamic(char *name, char *path, char *func_name, int (*create_func)(PetscMap))
Not Collective
name | - The name of a new user-defined creation routine | |
path | - The path (either absolute or relative) of the library containing this routine | |
func_name | - The name of routine to create method context | |
create_func | - The creation routine itself |
If dynamic libraries are used, then the fourth input argument (routine_create) is ignored.
PetscMapRegisterDynamic("my_map","/home/username/my_lib/lib/libO/solaris/libmy.a", "MyPetscMapCreate", MyPetscMapCreate);
Then, your map type can be chosen with the procedural interface via
PetscMapCreate(MPI_Comm, PetscMap *); PetscMapSetType(PetscMap,"my_map_name");or at runtime via the option
-map_type my_map_name
Note: $PETSC_ARCH and $BOPT occuring in pathname will be replaced with appropriate values.
#undef __FUNCT__ #define __FUNCT__ "PetscMapRegister" int PetscMapRegister(const char sname[], const char path[], const char name[], int (*function)(PetscMap)) { char fullname[256]; int ierr;
PetscFunctionBegin; ierr = PetscStrcpy(fullname, path); CHKERRQ(ierr); ierr = PetscStrcat(fullname, ":"); CHKERRQ(ierr); ierr = PetscStrcat(fullname, name); CHKERRQ(ierr); ierr = PetscFListAdd(&PetscMapList, sname, fullname, (void (*)(void)) function); CHKERRQ(ierr); PetscFunctionReturn(0); }
/*@M PetscMapSerializeRegisterDynamic - Adds a serialization method to the map package.
PetscMapSerializeRegisterDynamic(char *name, char *path, char *func_name, int (*serialize_func)(MPI_Comm, PetscMap *, PetscViewer, PetscTruth))
Not Collective
name | - The name of a new user-defined serialization routine | |
path | - The path (either absolute or relative) of the library containing this routine | |
func_name | - The name of the serialization routine | |
serialize_func | - The serialization routine itself |
If dynamic libraries are used, then the fourth input argument (serialize_func) is ignored.
PetscMapSerializeRegisterDynamic("my_store", "/home/username/my_lib/lib/libO/solaris/libmy.a", "MyStoreFunc", MyStoreFunc);
Then, your serialization can be chosen with the procedural interface via
PetscMapSetSerializeType(map, "my_store")or at runtime via the option
-map_serialize_type my_store
Note: $PETSC_ARCH and $BOPT occuring in pathname will be replaced with appropriate values.
PetscFunctionBegin; ierr = PetscStrcpy(fullname, path); CHKERRQ(ierr); ierr = PetscStrcat(fullname, ":"); CHKERRQ(ierr); ierr = PetscStrcat(fullname, name); CHKERRQ(ierr); ierr = PetscFListAdd(&PetscMapSerializeList, sname, fullname, (void (*)(void)) function); CHKERRQ(ierr); PetscFunctionReturn(0); }
/*--------------------------------------------------------------------------------------------------------------------*/ #undef __FUNCT__ #define __FUNCT__ "PetscMapRegisterDestroy" /*@C PetscMapRegisterDestroy - Frees the list of PetscMap methods that were registered by PetscMapRegister().
Not collective
Level:advanced
Location:src/vec/interface/mapreg.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages