00001 // -*- C++ -*- 00002 // ACL:license 00003 // ---------------------------------------------------------------------- 00004 // This software and ancillary information (herein called "SOFTWARE") 00005 // called PAWS (Parallel Application WorkSpace) is made available under 00006 // display this SOFTWARE without charge, provided that this Notice and 00007 // any statement of authorship are reproduced on all copies. Neither the 00008 // Government nor the University makes any warranty, express or implied, 00009 // or assumes any liability or responsibility for the use of this 00010 // SOFTWARE. 00011 // 00012 // If SOFTWARE is modified to produce derivative works, such modified 00013 // SOFTWARE should be clearly marked, so as not to confuse it with the 00014 // version available from LANL. 00015 // 00016 // For more information about PAWS, send e-mail to paws@acl.lanl.gov, 00017 // or visit the PAWS web page at http://www.acl.lanl.gov/paws/. 00018 // ---------------------------------------------------------------------- 00019 // ACL:license 00020 00021 #ifndef IpplPawsFieldData_h 00022 #define IpplPawsFieldData_h 00023 00024 #include "IpplPaws/DLDescriptor.h" 00025 #include "Field/Field.h" 00026 #include "Paws/PawsGeneralData.h" 00027 00028 // 00029 // Class which handles the background classes needed to have PAWS 00030 // work on a Ippl Field 00031 // 00032 template <class T, unsigned Dim, 00033 class M=UniformCartesian<Dim,double>, 00034 class C=typename M::DefaultCentering> 00035 class PawsFieldData : public PawsGeneralData< DLRepresentation<NDIndex<Dim>,Dim>, 00036 DLDescriptor<NDIndex<Dim>,Dim,Field<T,Dim,M,C>,T> > 00037 { 00038 public: 00039 00040 // Useful typedefs 00041 typedef Field<T,Dim,M,C> Field_t; 00042 typedef DLRepresentation<NDIndex<Dim>,Dim> Repr; 00043 typedef DLDescriptor<NDIndex<Dim>,Dim,Field<T,Dim,M,C>,T> Desc; 00044 typedef PawsData<Repr,Desc> PawsData_t; 00045 00046 // Create a completely empty PawsFieldData to be filled by initialize 00047 PawsFieldData() : PawsGeneralData<Repr,Desc>() {} 00048 00049 // Create an unfilled PawsFieldData which will be filled dynamically 00050 // when the size is known using update() 00051 // 00052 PawsFieldData(const char* name, int io_mode, int sync_mode, 00053 int order_mode, 00054 PawsApplication& app); 00055 00056 // Create a PawsFieldData given a sized user Field<T,Dim,M,C> that is 00057 // distributed by IPPL 00058 // 00059 PawsFieldData(const char* name, Field_t*, 00060 int io_mode, int sync_mode, int order_mode, 00061 PawsApplication &app); 00062 00063 // Initialize methods to set up PawsFieldData 00064 // 00065 void initialize(const char* name, int io_mode, int sync_mode, 00066 int order_mode, PawsApplication& app); 00067 void initialize(const char* name, Field_t* ptr, 00068 int io_mode, int sync_mode, int order_mode, 00069 PawsApplication& app); 00070 00071 // Update this PawsFieldData with a new distribution 00072 // PawsFieldRepresentation is updated 00073 // update() makes a new schedule 00074 // resize() does not, since it waits for a return update() 00075 // 00076 void update(Field_t* ptr); 00077 void resize(Field_t* ptr); 00078 00079 int dataType() { return PawsTypeCode<T>::myType(); } 00080 T sum() { if (data_app != PAWS_NULL) 00081 return data_desc->sum(); 00082 else 00083 return 0; 00084 } 00085 }; 00086 00087 template <class T, unsigned Dim, class M, class C> 00088 T sum(PawsFieldData<T,Dim,M,C>& data); 00089 00090 00091 #include "IpplPaws/PawsFieldData.cpp" 00092 00093 #endif 00094 00095 // ACL:rcsinfo 00096 // ---------------------------------------------------------------------- 00097 // $RCSfile: PawsFieldData.h,v $ $Author: adelmann $ 00098 // $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:32 $ 00099 // ---------------------------------------------------------------------- 00100 // ACL:rcsinfo 00101 00102 /*************************************************************************** 00103 * $RCSfile: addheaderfooter,v $ $Author: adelmann $ 00104 * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:17 $ 00105 * IPPL_VERSION_ID: $Id: addheaderfooter,v 1.1.1.1 2003/01/23 07:40:17 adelmann Exp $ 00106 ***************************************************************************/ 00107