ESYS13
Revision_
|
00001 00002 /******************************************************* 00003 * 00004 * Copyright (c) 2003-2012 by University of Queensland 00005 * Earth Systems Science Computational Center (ESSCC) 00006 * http://www.uq.edu.au/esscc 00007 * 00008 * Primary Business: Queensland, Australia 00009 * Licensed under the Open Software License version 3.0 00010 * http://www.opensource.org/licenses/osl-3.0.php 00011 * 00012 *******************************************************/ 00013 00014 00015 /**************************************************************/ 00016 00017 /* Paso: distribution */ 00018 00019 /**************************************************************/ 00020 00021 /* Author: Lutz Gross, l.gross@uq.edu.au */ 00022 00023 /**************************************************************/ 00024 00025 #ifndef INC_PASO_DISTRIBUTION 00026 #define INC_PASO_DISTRIBUTION 00027 00028 #include "Common.h" 00029 #include "esysUtils/Esys_MPI.h" 00030 00031 /**************************************************** 00032 describes the distribution of a vector stored 00033 on the local process 00034 ****************************************************/ 00035 struct Paso_Distribution 00036 { 00037 index_t *first_component; /* process i has nodes with global indices first_component[i+1] to first_component[i]. */ 00038 dim_t reference_counter; 00039 Esys_MPIInfo *mpi_info; 00040 }; 00041 00042 typedef struct Paso_Distribution Paso_Distribution; 00043 00044 /*************************************** 00045 Function prototypes 00046 **************************************/ 00047 00048 00049 PASO_DLL_API 00050 Paso_Distribution* Paso_Distribution_alloc( Esys_MPIInfo *mpi_info, index_t* first_component, index_t m, index_t b); 00051 00052 PASO_DLL_API 00053 void Paso_Distribution_free( Paso_Distribution *in ); 00054 00055 PASO_DLL_API 00056 Paso_Distribution* Paso_Distribution_getReference( Paso_Distribution *in ); 00057 00058 PASO_DLL_API 00059 index_t Paso_Distribution_getFirstComponent(Paso_Distribution *in ); 00060 00061 PASO_DLL_API 00062 index_t Paso_Distribution_getLastComponent(Paso_Distribution *in ); 00063 00064 PASO_DLL_API 00065 dim_t Paso_Distribution_getGlobalNumComponents(Paso_Distribution *in ); 00066 00067 PASO_DLL_API 00068 dim_t Paso_Distribution_getMyNumComponents(Paso_Distribution *in ); 00069 00070 PASO_DLL_API 00071 dim_t Paso_Distribution_getMinGlobalComponents(Paso_Distribution *in ); 00072 00073 PASO_DLL_API 00074 dim_t Paso_Distribution_getMaxGlobalComponents(Paso_Distribution *in ); 00075 00076 PASO_DLL_API 00077 double* Paso_Distribution_createRandomVector(Paso_Distribution *in, const dim_t block ); 00078 00079 PASO_DLL_API 00080 dim_t Paso_Distribution_numPositives(const double* x, const Paso_Distribution *in, const dim_t block ); 00081 00082 #endif 00083