LAMA
|
00001 00033 #ifndef LAMA_STORAGE_METHODS_HPP_ 00034 #define LAMA_STORAGE_METHODS_HPP_ 00035 00036 // for dll_import 00037 #include <lama/config.hpp> 00038 00039 // others 00040 #include <lama/LAMATypes.hpp> 00041 #include <lama/LAMAArray.hpp> 00042 00043 namespace lama 00044 { 00045 00046 class LAMA_DLL_IMPORTEXPORT _StorageMethods 00047 { 00048 public: 00049 00050 static void buildHalo( class Halo& halo, 00051 LAMAArray<IndexType>& haloJA, 00052 IndexType& haloSize, 00053 const class Distribution& colDist ); 00054 00055 protected: 00056 00057 LAMA_LOG_DECL_STATIC_LOGGER( logger ); 00058 00059 }; 00060 00061 /* -------------------------------------------------------------------------- */ 00062 00071 template<typename T> 00072 class LAMA_DLL_IMPORTEXPORT StorageMethods : public _StorageMethods 00073 { 00074 public: 00075 00076 typedef T ValueType; 00077 00085 static void localizeCSR( LAMAArray<IndexType>& localIA, 00086 LAMAArray<IndexType>& localJA, 00087 LAMAArray<ValueType>& locaValues, 00088 const LAMAArray<IndexType>& globalIA, 00089 const LAMAArray<IndexType>& globalJA, 00090 const LAMAArray<ValueType>& globalValues, 00091 const class Distribution& rowDist ); 00092 00101 static void replicateCSR( LAMAArray<IndexType>& globalIA, 00102 LAMAArray<IndexType>& globalJA, 00103 LAMAArray<ValueType>& globalValues, 00104 const LAMAArray<IndexType>& localIA, 00105 const LAMAArray<IndexType>& localJA, 00106 const LAMAArray<ValueType>& localValues, 00107 const class Distribution& rowDist ); 00108 00117 static void redistributeCSR( LAMAArray<IndexType>& targetIA, 00118 LAMAArray<IndexType>& targetJA, 00119 LAMAArray<ValueType>& targetValues, 00120 const LAMAArray<IndexType>& sourceIA, 00121 const LAMAArray<IndexType>& sourceJA, 00122 const LAMAArray<ValueType>& sourceValues, 00123 const class Redistributor& redistributor ); 00124 00131 static void exchangeHaloCSR( LAMAArray<IndexType>& targetIA, 00132 LAMAArray<IndexType>& targetJA, 00133 LAMAArray<ValueType>& targetValues, 00134 const LAMAArray<IndexType>& sourceIA, 00135 const LAMAArray<IndexType>& sourceJA, 00136 const LAMAArray<ValueType>& sourceValues, 00137 const class Halo& halo, 00138 const class Communicator& comm ); 00139 00151 static void splitCSR( LAMAArray<IndexType>& localIA, 00152 LAMAArray<IndexType>& localJA, 00153 LAMAArray<ValueType>& locaValues, 00154 LAMAArray<IndexType>& haloIA, 00155 LAMAArray<IndexType>& haloJA, 00156 LAMAArray<ValueType>& haloValues, 00157 const LAMAArray<IndexType>& csrIA, 00158 const LAMAArray<IndexType>& csrJA, 00159 const LAMAArray<ValueType>& csrValues, 00160 const class Distribution& colDist, 00161 const class Distribution* rowDist ); 00162 00171 static void joinCSR( LAMAArray<IndexType>& csrIA, 00172 LAMAArray<IndexType>& csrJA, 00173 LAMAArray<ValueType>& csrValues, 00174 const LAMAArray<IndexType>& localIA, 00175 const LAMAArray<IndexType>& localJA, 00176 const LAMAArray<ValueType>& localValues, 00177 const LAMAArray<IndexType>& haloIA, 00178 const LAMAArray<IndexType>& haloJA, 00179 const LAMAArray<ValueType>& haloValues, 00180 const IndexType numKeepDiagonals ); 00181 }; 00182 00183 /* -------------------------------------------------------------------------- */ 00184 00185 } 00186 #endif // LAMA_CSRSTORAGE_HPP_