diff --git a/runtime/boundary_weights.hpp b/runtime/boundary_weights.hpp index 7c7a7d86f8508b0ab10a2a66bd7929b03e1efb0a..a679b59457802469b7d0657c1e5429ea03d8f8a9 100644 --- a/runtime/boundary_weights.hpp +++ b/runtime/boundary_weights.hpp @@ -28,7 +28,7 @@ int cuda_compute_boundary_weights( namespace pairs { void compute_boundary_weights( - PairsSimulation *ps, + PairsRuntime *ps, real_t xmin, real_t xmax, real_t ymin, real_t ymax, real_t zmin, real_t zmax, walberla::uint_t *comp_weight, walberla::uint_t *comm_weight) { diff --git a/runtime/copper_fcc_lattice.hpp b/runtime/copper_fcc_lattice.hpp index 48fec71f6cdc50a99dd09568d91a8390e38f551c..254dd5d4a988e1d4f9e6f94c7369796895cb2040 100644 --- a/runtime/copper_fcc_lattice.hpp +++ b/runtime/copper_fcc_lattice.hpp @@ -61,7 +61,7 @@ void random_reset(int *seed, int ibase, double *coord) { //save = 0; } -double copper_fcc_lattice(PairsSimulation *ps, int nx, int ny, int nz, double xprd, double yprd, double zprd, double rho, int ntypes) { +double copper_fcc_lattice(PairsRuntime *ps, int nx, int ny, int nz, double xprd, double yprd, double zprd, double rho, int ntypes) { auto shape = ps->getAsIntegerProperty(ps->getPropertyByName("shape")); auto types = ps->getAsIntegerProperty(ps->getPropertyByName("type")); auto flags = ps->getAsIntegerProperty(ps->getPropertyByName("flags")); diff --git a/runtime/dem_sc_grid.hpp b/runtime/dem_sc_grid.hpp index 8c85ce6b77d84ddd9e8e52327e3323fefb29378a..8d4848e7c9914501ed2da734b99a696f87edbf02 100644 --- a/runtime/dem_sc_grid.hpp +++ b/runtime/dem_sc_grid.hpp @@ -59,7 +59,7 @@ bool point_within_aabb(double point[], double aabb[]) { point[2] >= aabb[2] && point[2] < aabb[5]; } -int dem_sc_grid(PairsSimulation *ps, double xmax, double ymax, double zmax, double spacing, double diameter, double min_diameter, double max_diameter, double initial_velocity, double particle_density, int ntypes) { +int dem_sc_grid(PairsRuntime *ps, double xmax, double ymax, double zmax, double spacing, double diameter, double min_diameter, double max_diameter, double initial_velocity, double particle_density, int ntypes) { auto uid = ps->getAsIntegerProperty(ps->getPropertyByName("uid")); auto shape = ps->getAsIntegerProperty(ps->getPropertyByName("shape")); auto types = ps->getAsIntegerProperty(ps->getPropertyByName("type")); diff --git a/runtime/domain/ParticleDataHandling.hpp b/runtime/domain/ParticleDataHandling.hpp index 7636fdf514926a37220fedc051e03a2145bffc81..f43c494593a06aebeac543f03fd195dd7817f0e7 100644 --- a/runtime/domain/ParticleDataHandling.hpp +++ b/runtime/domain/ParticleDataHandling.hpp @@ -3,7 +3,7 @@ namespace pairs { -class PairsSimulation; +class PairsRuntime; } @@ -30,10 +30,10 @@ inline bool operator==(const ParticleDeleter& lhs, const ParticleDeleter& rhs) { class ParticleDataHandling : public blockforest::BlockDataHandling<internal::ParticleDeleter> { private: - pairs::PairsSimulation *ps; + pairs::PairsRuntime *ps; public: - ParticleDataHandling(pairs::PairsSimulation *ps_) : ps(ps_) {} + ParticleDataHandling(pairs::PairsRuntime *ps_) : ps(ps_) {} ~ParticleDataHandling() override = default; internal::ParticleDeleter *initialize(IBlock *const block) override { diff --git a/runtime/domain/block_forest.hpp b/runtime/domain/block_forest.hpp index acfa0c5a463489d4f042dbb5dde5df88a9c42f18..25712c73a5651b76c6242b300990f3581f057b0a 100644 --- a/runtime/domain/block_forest.hpp +++ b/runtime/domain/block_forest.hpp @@ -18,11 +18,11 @@ namespace pairs { -class PairsSimulation; +class PairsRuntime; class BlockForest : public DomainPartitioner { private: - PairsSimulation *ps; + PairsRuntime *ps; std::shared_ptr<walberla::BlockForest> forest; std::shared_ptr<walberla::blockforest::InfoCollection> info; std::vector<int> ranks; @@ -35,7 +35,7 @@ private: public: BlockForest( - PairsSimulation *ps_, + PairsRuntime *ps_, real_t xmin, real_t xmax, real_t ymin, real_t ymax, real_t zmin, real_t zmax) : ps(ps_), DomainPartitioner(xmin, xmax, ymin, ymax, zmin, zmax) { diff --git a/runtime/pairs.cpp b/runtime/pairs.cpp index 9ec0c8240ecc98a621adc50b288abdd737fc7e12..7cad7d1fc0f58bbb0717d621596c9905a78808ba 100644 --- a/runtime/pairs.cpp +++ b/runtime/pairs.cpp @@ -12,7 +12,7 @@ namespace pairs { -void PairsSimulation::initDomain( +void PairsRuntime::initDomain( int *argc, char ***argv, real_t xmin, real_t xmax, real_t ymin, real_t ymax, real_t zmin, real_t zmax) { @@ -31,7 +31,7 @@ void PairsSimulation::initDomain( dom_part->initialize(argc, argv); } -void PairsSimulation::addArray(Array array) { +void PairsRuntime::addArray(Array array) { int id = array.getId(); auto a = std::find_if( arrays.begin(), @@ -42,7 +42,7 @@ void PairsSimulation::addArray(Array array) { arrays.push_back(array); } -Array &PairsSimulation::getArray(array_t id) { +Array &PairsRuntime::getArray(array_t id) { auto a = std::find_if( arrays.begin(), arrays.end(), @@ -52,7 +52,7 @@ Array &PairsSimulation::getArray(array_t id) { return *a; } -Array &PairsSimulation::getArrayByName(std::string name) { +Array &PairsRuntime::getArrayByName(std::string name) { auto a = std::find_if( arrays.begin(), arrays.end(), @@ -62,7 +62,7 @@ Array &PairsSimulation::getArrayByName(std::string name) { return *a; } -Array &PairsSimulation::getArrayByHostPointer(const void *h_ptr) { +Array &PairsRuntime::getArrayByHostPointer(const void *h_ptr) { auto a = std::find_if( arrays.begin(), arrays.end(), @@ -72,7 +72,7 @@ Array &PairsSimulation::getArrayByHostPointer(const void *h_ptr) { return *a; } -void PairsSimulation::addProperty(Property prop) { +void PairsRuntime::addProperty(Property prop) { int id = prop.getId(); auto p = std::find_if( properties.begin(), @@ -83,7 +83,7 @@ void PairsSimulation::addProperty(Property prop) { properties.push_back(prop); } -Property &PairsSimulation::getProperty(property_t id) { +Property &PairsRuntime::getProperty(property_t id) { auto p = std::find_if( properties.begin(), properties.end(), @@ -93,7 +93,7 @@ Property &PairsSimulation::getProperty(property_t id) { return *p; } -Property &PairsSimulation::getPropertyByName(std::string name) { +Property &PairsRuntime::getPropertyByName(std::string name) { auto p = std::find_if( properties.begin(), properties.end(), @@ -103,7 +103,7 @@ Property &PairsSimulation::getPropertyByName(std::string name) { return *p; } -void PairsSimulation::addContactProperty(ContactProperty contact_prop) { +void PairsRuntime::addContactProperty(ContactProperty contact_prop) { int id = contact_prop.getId(); auto cp = std::find_if( contact_properties.begin(), @@ -114,7 +114,7 @@ void PairsSimulation::addContactProperty(ContactProperty contact_prop) { contact_properties.push_back(contact_prop); } -ContactProperty &PairsSimulation::getContactProperty(property_t id) { +ContactProperty &PairsRuntime::getContactProperty(property_t id) { auto cp = std::find_if( contact_properties.begin(), contact_properties.end(), @@ -124,7 +124,7 @@ ContactProperty &PairsSimulation::getContactProperty(property_t id) { return *cp; } -ContactProperty &PairsSimulation::getContactPropertyByName(std::string name) { +ContactProperty &PairsRuntime::getContactPropertyByName(std::string name) { auto cp = std::find_if( contact_properties.begin(), contact_properties.end(), @@ -134,7 +134,7 @@ ContactProperty &PairsSimulation::getContactPropertyByName(std::string name) { return *cp; } -void PairsSimulation::addFeatureProperty(FeatureProperty feature_prop) { +void PairsRuntime::addFeatureProperty(FeatureProperty feature_prop) { int id = feature_prop.getId(); auto fp = std::find_if( feature_properties.begin(), @@ -145,7 +145,7 @@ void PairsSimulation::addFeatureProperty(FeatureProperty feature_prop) { feature_properties.push_back(feature_prop); } -FeatureProperty &PairsSimulation::getFeatureProperty(property_t id) { +FeatureProperty &PairsRuntime::getFeatureProperty(property_t id) { auto fp = std::find_if(feature_properties.begin(), feature_properties.end(), [id](FeatureProperty _fp) { return _fp.getId() == id; }); @@ -153,7 +153,7 @@ FeatureProperty &PairsSimulation::getFeatureProperty(property_t id) { return *fp; } -FeatureProperty &PairsSimulation::getFeaturePropertyByName(std::string name) { +FeatureProperty &PairsRuntime::getFeaturePropertyByName(std::string name) { auto fp = std::find_if(feature_properties.begin(), feature_properties.end(), [name](FeatureProperty _fp) { return _fp.getName() == name; }); @@ -161,7 +161,7 @@ FeatureProperty &PairsSimulation::getFeaturePropertyByName(std::string name) { return *fp; } -void PairsSimulation::copyArraySliceToDevice( +void PairsRuntime::copyArraySliceToDevice( Array &array, action_t action, size_t offset, size_t size) { int array_id = array.getId(); @@ -186,7 +186,7 @@ void PairsSimulation::copyArraySliceToDevice( array_flags->setDeviceFlag(array_id); } -void PairsSimulation::copyArrayToDevice(Array &array, action_t action, size_t size) { +void PairsRuntime::copyArrayToDevice(Array &array, action_t action, size_t size) { int array_id = array.getId(); if(action == Ignore || action == WriteAfterRead || action == ReadOnly) { @@ -208,7 +208,7 @@ void PairsSimulation::copyArrayToDevice(Array &array, action_t action, size_t si array_flags->setDeviceFlag(array_id); } -void PairsSimulation::copyArraySliceToHost(Array &array, action_t action, size_t offset, size_t size) { +void PairsRuntime::copyArraySliceToHost(Array &array, action_t action, size_t offset, size_t size) { int array_id = array.getId(); if(action == Ignore || action == WriteAfterRead || action == ReadOnly) { @@ -231,7 +231,7 @@ void PairsSimulation::copyArraySliceToHost(Array &array, action_t action, size_t array_flags->setHostFlag(array_id); } -void PairsSimulation::copyArrayToHost(Array &array, action_t action, size_t size) { +void PairsRuntime::copyArrayToHost(Array &array, action_t action, size_t size) { int array_id = array.getId(); if(action == Ignore || action == WriteAfterRead || action == ReadOnly) { @@ -253,7 +253,7 @@ void PairsSimulation::copyArrayToHost(Array &array, action_t action, size_t size array_flags->setHostFlag(array_id); } -void PairsSimulation::copyPropertyToDevice(Property &prop, action_t action, size_t size) { +void PairsRuntime::copyPropertyToDevice(Property &prop, action_t action, size_t size) { int prop_id = prop.getId(); if(action == Ignore || action == WriteAfterRead || action == ReadOnly) { @@ -270,7 +270,7 @@ void PairsSimulation::copyPropertyToDevice(Property &prop, action_t action, size prop_flags->setDeviceFlag(prop_id); } -void PairsSimulation::copyPropertyToHost(Property &prop, action_t action, size_t size) { +void PairsRuntime::copyPropertyToHost(Property &prop, action_t action, size_t size) { int prop_id = prop.getId(); if(action == Ignore || action == WriteAfterRead || action == ReadOnly) { @@ -287,7 +287,7 @@ void PairsSimulation::copyPropertyToHost(Property &prop, action_t action, size_t prop_flags->setHostFlag(prop_id); } -void PairsSimulation::copyContactPropertyToDevice( +void PairsRuntime::copyContactPropertyToDevice( ContactProperty &contact_prop, action_t action, size_t size) { int prop_id = contact_prop.getId(); @@ -305,7 +305,7 @@ void PairsSimulation::copyContactPropertyToDevice( } } -void PairsSimulation::copyContactPropertyToHost( +void PairsRuntime::copyContactPropertyToHost( ContactProperty &contact_prop, action_t action, size_t size) { int prop_id = contact_prop.getId(); @@ -323,13 +323,13 @@ void PairsSimulation::copyContactPropertyToHost( } } -void PairsSimulation::copyFeaturePropertyToDevice(FeatureProperty &feature_prop) { +void PairsRuntime::copyFeaturePropertyToDevice(FeatureProperty &feature_prop) { const size_t n = feature_prop.getArraySize(); PAIRS_DEBUG("Copying feature property %s to device (n=%d)\n", feature_prop.getName().c_str(), n); pairs::copy_static_symbol_to_device(feature_prop.getHostPointer(), feature_prop.getDevicePointer(), n); } -void PairsSimulation::communicateSizes(int dim, const int *send_sizes, int *recv_sizes) { +void PairsRuntime::communicateSizes(int dim, const int *send_sizes, int *recv_sizes) { auto nsend_id = getArrayByHostPointer(send_sizes).getId(); auto nrecv_id = getArrayByHostPointer(recv_sizes).getId(); @@ -344,7 +344,7 @@ void PairsSimulation::communicateSizes(int dim, const int *send_sizes, int *recv this->getTimers()->stop(Communication); } -void PairsSimulation::communicateData( +void PairsRuntime::communicateData( int dim, int elem_size, const real_t *send_buf, const int *send_offsets, const int *nsend, real_t *recv_buf, const int *recv_offsets, const int *nrecv) { @@ -398,7 +398,7 @@ void PairsSimulation::communicateData( #endif } -void PairsSimulation::communicateAllData( +void PairsRuntime::communicateAllData( int ndims, int elem_size, const real_t *send_buf, const int *send_offsets, const int *nsend, real_t *recv_buf, const int *recv_offsets, const int *nrecv) { @@ -452,7 +452,7 @@ void PairsSimulation::communicateAllData( #endif } -void PairsSimulation::communicateContactHistoryData( +void PairsRuntime::communicateContactHistoryData( int dim, int nelems_per_contact, const real_t *send_buf, const int *contact_soffsets, const int *nsend_contact, real_t *recv_buf, int *contact_roffsets, int *nrecv_contact) { @@ -518,7 +518,7 @@ void PairsSimulation::communicateContactHistoryData( #endif } -void PairsSimulation::copyRuntimeArray(const std::string& name, void *dest, const int size) { +void PairsRuntime::copyRuntimeArray(const std::string& name, void *dest, const int size) { this->getDomainPartitioner()->copyRuntimeArray(name, dest, size); } diff --git a/runtime/pairs.hpp b/runtime/pairs.hpp index 04f8f69ccd390499c64ebbd8c6efe1bfc1b57190..bb8375f79de2b95fbb20fc0bcdee1af090f41d18 100644 --- a/runtime/pairs.hpp +++ b/runtime/pairs.hpp @@ -26,7 +26,7 @@ namespace pairs { -class PairsSimulation { +class PairsRuntime { private: DomainPartitioner *dom_part; DomainPartitioners dom_part_type; @@ -40,7 +40,7 @@ private: int *nlocal, *nghost; public: - PairsSimulation( + PairsRuntime( int nprops_, int ncontactprops_, int narrays_, @@ -53,7 +53,7 @@ public: timers = new Timers<double>(1e-6); } - ~PairsSimulation() { + ~PairsRuntime() { dom_part->finalize(); delete prop_flags; delete contact_prop_flags; @@ -340,7 +340,7 @@ public: }; template<typename T_ptr> -void PairsSimulation::addArray(array_t id, std::string name, T_ptr **h_ptr, std::nullptr_t, size_t size) { +void PairsRuntime::addArray(array_t id, std::string name, T_ptr **h_ptr, std::nullptr_t, size_t size) { PAIRS_ASSERT(size > 0); *h_ptr = (T_ptr *) pairs::host_alloc(size); @@ -349,7 +349,7 @@ void PairsSimulation::addArray(array_t id, std::string name, T_ptr **h_ptr, std: } template<typename T_ptr> -void PairsSimulation::addArray(array_t id, std::string name, T_ptr **h_ptr, T_ptr **d_ptr, size_t size) { +void PairsRuntime::addArray(array_t id, std::string name, T_ptr **h_ptr, T_ptr **d_ptr, size_t size) { PAIRS_ASSERT(size > 0); *h_ptr = (T_ptr *) pairs::host_alloc(size); @@ -359,17 +359,17 @@ void PairsSimulation::addArray(array_t id, std::string name, T_ptr **h_ptr, T_pt } template<typename T_ptr> -void PairsSimulation::addStaticArray(array_t id, std::string name, T_ptr *h_ptr, std::nullptr_t, size_t size) { +void PairsRuntime::addStaticArray(array_t id, std::string name, T_ptr *h_ptr, std::nullptr_t, size_t size) { addArray(Array(id, name, h_ptr, nullptr, size, true)); } template<typename T_ptr> -void PairsSimulation::addStaticArray(array_t id, std::string name, T_ptr *h_ptr, T_ptr *d_ptr, size_t size) { +void PairsRuntime::addStaticArray(array_t id, std::string name, T_ptr *h_ptr, T_ptr *d_ptr, size_t size) { addArray(Array(id, name, h_ptr, d_ptr, size, true)); } template<typename T_ptr> -void PairsSimulation::reallocArray(array_t id, T_ptr **h_ptr, std::nullptr_t, size_t size) { +void PairsRuntime::reallocArray(array_t id, T_ptr **h_ptr, std::nullptr_t, size_t size) { // This should be a pointer (and not a reference) in order to be modified auto a = std::find_if(arrays.begin(), arrays.end(), [id](Array a) { return a.getId() == id; }); PAIRS_ASSERT(a != std::end(arrays)); @@ -384,7 +384,7 @@ void PairsSimulation::reallocArray(array_t id, T_ptr **h_ptr, std::nullptr_t, si } template<typename T_ptr> -void PairsSimulation::reallocArray(array_t id, T_ptr **h_ptr, T_ptr **d_ptr, size_t size) { +void PairsRuntime::reallocArray(array_t id, T_ptr **h_ptr, T_ptr **d_ptr, size_t size) { // This should be a pointer (and not a reference) in order to be modified auto a = std::find_if(arrays.begin(), arrays.end(), [id](Array a) { return a.getId() == id; }); PAIRS_ASSERT(a != std::end(arrays)); @@ -406,7 +406,7 @@ void PairsSimulation::reallocArray(array_t id, T_ptr **h_ptr, T_ptr **d_ptr, siz } template<typename T_ptr> -void PairsSimulation::addProperty( +void PairsRuntime::addProperty( property_t id, std::string name, T_ptr **h_ptr, std::nullptr_t, PropertyType type, layout_t layout, int vol, size_t sx, size_t sy) { @@ -419,7 +419,7 @@ void PairsSimulation::addProperty( } template<typename T_ptr> -void PairsSimulation::addProperty( +void PairsRuntime::addProperty( property_t id, std::string name, T_ptr **h_ptr, T_ptr **d_ptr, PropertyType type, layout_t layout, int vol, size_t sx, size_t sy) { @@ -433,7 +433,7 @@ void PairsSimulation::addProperty( } template<typename T_ptr> -void PairsSimulation::reallocProperty(property_t id, T_ptr **h_ptr, std::nullptr_t, size_t sx, size_t sy) { +void PairsRuntime::reallocProperty(property_t id, T_ptr **h_ptr, std::nullptr_t, size_t sx, size_t sy) { // This should be a pointer (and not a reference) in order to be modified auto p = std::find_if(properties.begin(), properties.end(), @@ -452,7 +452,7 @@ void PairsSimulation::reallocProperty(property_t id, T_ptr **h_ptr, std::nullptr } template<typename T_ptr> -void PairsSimulation::reallocProperty(property_t id, T_ptr **h_ptr, T_ptr **d_ptr, size_t sx, size_t sy) { +void PairsRuntime::reallocProperty(property_t id, T_ptr **h_ptr, T_ptr **d_ptr, size_t sx, size_t sy) { // This should be a pointer (and not a reference) in order to be modified auto p = std::find_if(properties.begin(), properties.end(), @@ -478,7 +478,7 @@ void PairsSimulation::reallocProperty(property_t id, T_ptr **h_ptr, T_ptr **d_pt } template<typename T_ptr> -void PairsSimulation::addContactProperty( +void PairsRuntime::addContactProperty( property_t id, std::string name, T_ptr **h_ptr, std::nullptr_t, PropertyType type, layout_t layout, size_t sx, size_t sy) { size_t size = sx * sy * sizeof(T_ptr); @@ -490,7 +490,7 @@ void PairsSimulation::addContactProperty( } template<typename T_ptr> -void PairsSimulation::addContactProperty( +void PairsRuntime::addContactProperty( property_t id, std::string name, T_ptr **h_ptr, T_ptr **d_ptr, PropertyType type, layout_t layout, size_t sx, size_t sy) { size_t size = sx * sy * sizeof(T_ptr); @@ -503,7 +503,7 @@ void PairsSimulation::addContactProperty( } template<typename T_ptr> -void PairsSimulation::reallocContactProperty(property_t id, T_ptr **h_ptr, std::nullptr_t, size_t sx, size_t sy) { +void PairsRuntime::reallocContactProperty(property_t id, T_ptr **h_ptr, std::nullptr_t, size_t sx, size_t sy) { // This should be a pointer (and not a reference) in order to be modified auto cp = std::find_if(contact_properties.begin(), contact_properties.end(), @@ -522,7 +522,7 @@ void PairsSimulation::reallocContactProperty(property_t id, T_ptr **h_ptr, std:: } template<typename T_ptr> -void PairsSimulation::reallocContactProperty(property_t id, T_ptr **h_ptr, T_ptr **d_ptr, size_t sx, size_t sy) { +void PairsRuntime::reallocContactProperty(property_t id, T_ptr **h_ptr, T_ptr **d_ptr, size_t sx, size_t sy) { // This should be a pointer (and not a reference) in order to be modified auto cp = std::find_if(contact_properties.begin(), contact_properties.end(), @@ -548,14 +548,14 @@ void PairsSimulation::reallocContactProperty(property_t id, T_ptr **h_ptr, T_ptr } template<typename T_ptr> -void PairsSimulation::addFeatureProperty(property_t id, std::string name, T_ptr *h_ptr, std::nullptr_t, PropertyType type, int nkinds, int array_size) { +void PairsRuntime::addFeatureProperty(property_t id, std::string name, T_ptr *h_ptr, std::nullptr_t, PropertyType type, int nkinds, int array_size) { PAIRS_ASSERT(nkinds > 0 && array_size > 0); PAIRS_ASSERT(h_ptr != nullptr); addFeatureProperty(FeatureProperty(id, name, h_ptr, nullptr, type, nkinds, array_size)); } template<typename T_ptr> -void PairsSimulation::addFeatureProperty(property_t id, std::string name, T_ptr *h_ptr, T_ptr *d_ptr, PropertyType type, int nkinds, int array_size) { +void PairsRuntime::addFeatureProperty(property_t id, std::string name, T_ptr *h_ptr, T_ptr *d_ptr, PropertyType type, int nkinds, int array_size) { PAIRS_ASSERT(nkinds > 0 && array_size > 0); PAIRS_ASSERT(h_ptr != nullptr && d_ptr != nullptr); addFeatureProperty(FeatureProperty(id, name, h_ptr, d_ptr, type, nkinds, array_size)); diff --git a/runtime/read_from_file.hpp b/runtime/read_from_file.hpp index 0173b46778809d13019cfbb42da2a579d2a8c212..cae3362b0fce5997c516fbd1be9220953ca4d16b 100644 --- a/runtime/read_from_file.hpp +++ b/runtime/read_from_file.hpp @@ -10,7 +10,7 @@ namespace pairs { -void read_grid_data(PairsSimulation *ps, const char *filename, real_t *grid_buffer) { +void read_grid_data(PairsRuntime *ps, const char *filename, real_t *grid_buffer) { std::ifstream in_file(filename, std::ifstream::in); std::string line; @@ -30,7 +30,7 @@ void read_grid_data(PairsSimulation *ps, const char *filename, real_t *grid_buff } } -size_t read_particle_data(PairsSimulation *ps, const char *filename, const property_t properties[], size_t nprops, int shape_id, int start) { +size_t read_particle_data(PairsRuntime *ps, const char *filename, const property_t properties[], size_t nprops, int shape_id, int start) { std::ifstream in_file(filename, std::ifstream::in); std::string line; auto shape_ptr = ps->getAsIntegerProperty(ps->getPropertyByName("shape")); @@ -115,7 +115,7 @@ size_t read_particle_data(PairsSimulation *ps, const char *filename, const prope } /* -size_t read_feature_data(PairsSimulation *ps, const char *filename, const int feature_id, const property_t properties[], size_t nprops) { +size_t read_feature_data(PairsRuntime *ps, const char *filename, const int feature_id, const property_t properties[], size_t nprops) { std::ifstream in_file(filename, std::ifstream::in); std::string line; diff --git a/runtime/stats.hpp b/runtime/stats.hpp index 413ffab8425bc31d877e263d29fdfa4f9f343405..0bb9e9bb8c606f97a57bba0af51b0d82ee37277d 100644 --- a/runtime/stats.hpp +++ b/runtime/stats.hpp @@ -6,7 +6,7 @@ using namespace std; namespace pairs { -void print_stats(PairsSimulation *ps, int nlocal, int nghost) { +void print_stats(PairsRuntime *ps, int nlocal, int nghost) { int min_nlocal = nlocal; int max_nlocal = nlocal; int min_nghost = nghost; diff --git a/runtime/thermo.hpp b/runtime/thermo.hpp index b09693ab9ca47ea71c650205f68f30bbb44bcd2b..71385924b632f01acaf532c94aaf13dea3cff909 100644 --- a/runtime/thermo.hpp +++ b/runtime/thermo.hpp @@ -8,7 +8,7 @@ namespace pairs { -double compute_thermo(PairsSimulation *ps, int nlocal, double xprd, double yprd, double zprd, int print) { +double compute_thermo(PairsRuntime *ps, int nlocal, double xprd, double yprd, double zprd, int print) { auto masses = ps->getAsFloatProperty(ps->getPropertyByName("mass")); auto velocities = ps->getAsVectorProperty(ps->getPropertyByName("linear_velocity")); int natoms = nlocal; @@ -50,7 +50,7 @@ double compute_thermo(PairsSimulation *ps, int nlocal, double xprd, double yprd, return t; } -void adjust_thermo(PairsSimulation *ps, int nlocal, double xprd, double yprd, double zprd, double temp) { +void adjust_thermo(PairsRuntime *ps, int nlocal, double xprd, double yprd, double zprd, double temp) { auto velocities = ps->getAsVectorProperty(ps->getPropertyByName("linear_velocity")); double vxtot = 0.0; double vytot = 0.0; diff --git a/runtime/timing.hpp b/runtime/timing.hpp index 6c35e222e049fefd9aac991cf7e9e400ef3cc1ce..77a799dbf20266570d4e48245eb203e7dca51db7 100644 --- a/runtime/timing.hpp +++ b/runtime/timing.hpp @@ -6,19 +6,19 @@ using namespace std; namespace pairs { -void register_timer(PairsSimulation *ps, int id, std::string name) { +void register_timer(PairsRuntime *ps, int id, std::string name) { ps->getTimers()->add(id, name); } -void start_timer(PairsSimulation *ps, int id) { +void start_timer(PairsRuntime *ps, int id) { ps->getTimers()->start(id); } -void stop_timer(PairsSimulation *ps, int id) { +void stop_timer(PairsRuntime *ps, int id) { ps->getTimers()->stop(id); } -void print_timers(PairsSimulation *ps) { +void print_timers(PairsRuntime *ps) { ps->printTimers(); } diff --git a/runtime/vtk.hpp b/runtime/vtk.hpp index f122565694634594e0733017df8624a280681fc0..181c2181f3a34a2f71b72545bef22019d65a5a1b 100644 --- a/runtime/vtk.hpp +++ b/runtime/vtk.hpp @@ -8,7 +8,7 @@ namespace pairs { -void vtk_write_data(PairsSimulation *ps, const char *filename, int start, int end, int timestep, int frequency) { +void vtk_write_data(PairsRuntime *ps, const char *filename, int start, int end, int timestep, int frequency) { std::string output_filename(filename); auto masses = ps->getAsFloatProperty(ps->getPropertyByName("mass")); auto positions = ps->getAsVectorProperty(ps->getPropertyByName("position")); diff --git a/src/pairs/code_gen/cgen.py b/src/pairs/code_gen/cgen.py index 226af7f6c99d81837c2dc5656be23766f8623cfe..411f5010a4e4f9ff13f9d03615167b19c446a20d 100644 --- a/src/pairs/code_gen/cgen.py +++ b/src/pairs/code_gen/cgen.py @@ -166,7 +166,7 @@ class CGen: part = DomainPartitioners.c_keyword(module.sim.partitioner()) self.print("int main(int argc, char **argv) {") - self.print(f" PairsSimulation *pairs = new PairsSimulation({nprops}, {ncontactprops}, {narrays}, {part});") + self.print(f" PairsRuntime *pairs = new PairsRuntime({nprops}, {ncontactprops}, {narrays}, {part});") if module.sim._enable_profiler: self.print(" LIKWID_MARKER_INIT;") @@ -183,7 +183,7 @@ class CGen: self.print("}") else: - module_params = "PairsSimulation *pairs" + module_params = "PairsRuntime *pairs" for var in module.read_only_variables(): type_kw = Types.c_keyword(self.sim, var.type()) decl = f"{type_kw} {var.name()}"