Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: Remove consolidation at all levels #186

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ plugin_config.cu
*.sublime-project
*.sublime-workspace
core/src/version.cu
ci/docker/
ci/docker/
Release
RelWithTraces
Debug
install
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ void registerParameters()
AMG_Config::registerParameter<int>("exception_handling", "a flag that forces internal exception processing instead of returning error codes(1:internal, 0:external)", 0, bool_flag_values);
//Register System Parameters (memory pools)
AMG_Config::registerParameter<size_t>("device_mem_pool_size", "size of the device memory pool in bytes", 256 * 1024 * 1024);
AMG_Config::registerParameter<size_t>("device_consolidation_pool_size", "size of the device memory pool for root partition in bytes", 256 * 1024 * 1024);
AMG_Config::registerParameter<size_t>("device_mem_pool_max_alloc_size", "maximum size of a single allocation in the device memory pool in bytes", 20 * 1024 * 1024);
AMG_Config::registerParameter<size_t>("device_alloc_scaling_factor", "over allocation for large buffers (in %% -- a value of X will lead to 100+X%% allocations)", 10);
AMG_Config::registerParameter<size_t>("device_alloc_scaling_threshold", "buffers smaller than that threshold will NOT be scaled", 16 * 1024);
Expand Down
1 change: 0 additions & 1 deletion examples/amgx_spmv_example/amgx_spmv_internal.cu
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ void registerParameters()
AMG_Config::registerParameter<int>("exception_handling", "a flag that forces internal exception processing instead of returning error codes(1:internal, 0:external)", 0, bool_flag_values);
//Register System Parameters (memory pools)
AMG_Config::registerParameter<size_t>("device_mem_pool_size", "size of the device memory pool in bytes", 256 * 1024 * 1024);
AMG_Config::registerParameter<size_t>("device_consolidation_pool_size", "size of the device memory pool for root partition in bytes", 256 * 1024 * 1024);
AMG_Config::registerParameter<size_t>("device_mem_pool_max_alloc_size", "maximum size of a single allocation in the device memory pool in bytes", 20 * 1024 * 1024);
AMG_Config::registerParameter<size_t>("device_alloc_scaling_factor", "over allocation for large buffers (in %% -- a value of X will lead to 100+X%% allocations)", 10);
AMG_Config::registerParameter<size_t>("device_alloc_scaling_threshold", "buffers smaller than that threshold will NOT be scaled", 16 * 1024);
Expand Down
3 changes: 0 additions & 3 deletions include/aggregation/aggregation_amg_level.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ class Aggregation_AMG_Level_Base : public AMG_Level<T_Config>
void restrictResidual(VVector &r, VVector &rr);
void prolongateAndApplyCorrection( VVector &c, VVector &bc, VVector &x, VVector &tmp);
void computeRestrictionOperator();
void consolidateVector(VVector &x);
void unconsolidateVector(VVector &x);


protected:

Expand Down
6 changes: 0 additions & 6 deletions include/amg.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ class AMG
void setD2Workspace(void *workspace) { d2_workspace = workspace; }
void *getCsrWorkspace() { return csr_workspace; }
void setCsrWorkspace(void *workspace) { csr_workspace = workspace; }
inline void setConsolidationLowerThreshold(IndexType consolidation_lower_threshold) { m_consolidation_lower_threshold = consolidation_lower_threshold;}
inline void setConsolidationUpperThreshold(IndexType consolidation_upper_threshold) { m_consolidation_upper_threshold = consolidation_upper_threshold;}

private:

AMG_Level<TConfig_d> *fine_d;
Expand All @@ -183,9 +180,6 @@ class AMG
int max_levels;
double coarsen_threshold;

IndexType m_amg_consolidation_flag;
IndexType m_consolidation_lower_threshold;
IndexType m_consolidation_upper_threshold;
int m_sum_stopping_criteria;
int m_structure_reuse_levels;
int m_amg_host_levels_rows;
Expand Down
11 changes: 0 additions & 11 deletions include/amg_level.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ class AMG_Level
virtual IndexType getNumCoarseVertices() = 0;

virtual void prepareNextLevelMatrix(const Matrix<TConfig> &A, Matrix<TConfig> &Ac) = 0;
virtual void consolidateVector(VVector &r) = 0;
virtual void unconsolidateVector(VVector &r) = 0;

virtual void transfer_level(AMG_Level<TConfig1> *ref_lvl) = 0;

void transfer_from(AMG_Level<TConfig1> *ref_lvl); // copy from other memoryspace
Expand Down Expand Up @@ -179,8 +176,6 @@ class AMG_Level
inline void setNextLevel( AMG_Level<TConfig_d> *level ) { next_d = level; }
inline void resetNextLevel( device_memory ) { next_d = 0L; }
inline void deleteNextLevel( device_memory ) { delete next_d; next_d = 0L; }
inline bool isConsolidationLevel() { return m_is_consolidation_level; }
inline void setIsConsolidationLevel(bool is_consolidation_level) { m_is_consolidation_level = is_consolidation_level; }
inline bool isReuseLevel() { return m_is_reuse_level; }
inline void setReuseLevel(bool is_reuse_level) { m_is_reuse_level = is_reuse_level; }

Expand Down Expand Up @@ -225,15 +220,9 @@ class AMG_Level
int level_id;
IndexType m_next_level_size;
bool init; //marks if the x vector needs to be initialized
bool m_is_consolidation_level;
bool m_is_reuse_level;
std::string m_amg_level_name;


bool m_is_root_partition;
IndexType m_destination_part;
INDEX_TYPE m_num_parts_to_consolidate;

};

template< typename TConfig, AMGX_MemorySpace MemSpace, class CycleDispatcher >
Expand Down
2 changes: 0 additions & 2 deletions include/classical/classical_amg_level.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ class Classical_AMG_Level_Base : public AMG_Level<T_Config>
virtual void computeAOperator_1x1() = 0;
virtual void computeAOperator_1x1_distributed() = 0;
void prepareNextLevelMatrix(const Matrix<TConfig> &A, Matrix<TConfig> &Ac) {};
void consolidateVector(VVector &x);
void unconsolidateVector(VVector &x);
void prolongateAndApplyCorrectionRescale(VVector &ec, VVector &bf, VVector &xf, VVector &ef, VVector &Aef)
{ FatalError( "prolongateAndApplyCorrectionRescale is not available with classical AMG. Try setting scale_corection to 0", AMGX_ERR_BAD_PARAMETERS); };

Expand Down
2 changes: 0 additions & 2 deletions include/distributed/comms_mpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ class CommsMPI : public DistributedComms<T_Config>

CommsMPI() : DistributedComms<T_Config>() {};

virtual DistributedComms<T_Config> *CloneSubComm(HIVector &coarse_part_to_fine_part, bool is_root_partition) = 0;

virtual ~CommsMPI()
{
}
Expand Down
5 changes: 0 additions & 5 deletions include/distributed/comms_mpi_gpudirect.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ class CommsMPIDirect : public CommsMPIHostBufferStream<T_Config>
return new CommsMPIDirect<TConfig>(*this);
}

DistributedComms<T_Config> *CloneSubComm(HIVector &coarse_part_to_fine_part, bool is_root_partition)
{
return NULL;
}

public:
void exchange_matrix_halo(Matrix_Array &halo_rows, DistributedManager_Array &halo_btl, const Matrix<TConfig> &m);

Expand Down
47 changes: 0 additions & 47 deletions include/distributed/comms_mpi_hostbuffer_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,6 @@ class CommsMPIHostBufferStream : public CommsMPI<T_Config>
};
#endif

void createSubComm( HIVector &coarse_part_to_fine_part, bool is_root_partition )
{
#ifdef AMGX_WITH_MPI
MPI_Group new_group, orig_group;
MPI_Comm new_comm;
MPI_Comm_group(mpi_comm, &orig_group);
MPI_Group_incl(orig_group, coarse_part_to_fine_part.size(), coarse_part_to_fine_part.raw(), &new_group);
MPI_Comm_create(mpi_comm, new_group, &new_comm);

if (is_root_partition)
{
MPI_Comm_dup(new_comm, &mpi_comm);
MPI_Comm_set_errhandler(mpi_comm, glbMPIErrorHandler);
}

#endif
}

#ifdef AMGX_WITH_MPI
MPI_Comm get_mpi_comm()
{
Expand All @@ -157,35 +139,6 @@ class CommsMPIHostBufferStream : public CommsMPI<T_Config>
}
#endif

DistributedComms<TConfig> *CloneSubComm(HIVector &coarse_part_to_fine_part, bool is_root_partition)
{
#ifdef AMGX_WITH_MPI
int my_id = this->get_global_id();
MPI_Group new_group, orig_group;
MPI_Comm new_comm;
MPI_Comm_group(mpi_comm, &orig_group); // get orig group

if (is_root_partition)
{
MPI_Group_incl(orig_group, coarse_part_to_fine_part.size(), coarse_part_to_fine_part.raw(), &new_group); // reorder group
MPI_Comm_create(mpi_comm, new_group, &new_comm); // create comm for new group
MPI_Group_free(&new_group);
//MPI_Comm_set_errhandler(new_comm, glbMPIErrorHandler); // set handler for new group
return new CommsMPIHostBufferStream<TConfig>(this, &new_comm); //wrap new comm and return it - wrapper will handle resource release
}
else
{
MPI_Group_incl(orig_group, 0, coarse_part_to_fine_part.raw(), &new_group); // reorder group - NULL group - do not need to delete this
MPI_Comm_create(mpi_comm, new_group, &new_comm); // create comm for new group - empty comm, do not need to delete this
MPI_Group_free(&new_group); // but do it anyways just for the funzies
return NULL;
}

#else
return NULL;
#endif
}

void printString(const std::string &str);

CommsMPIHostBufferStream<TConfig> *Clone() const
Expand Down
3 changes: 0 additions & 3 deletions include/distributed/distributed_comms.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ class DistributedComms
virtual void set_neighbors(int num_neighbors) = 0;

virtual DistributedComms<TConfig> *Clone() const = 0;
virtual DistributedComms<TConfig> *CloneSubComm(HIVector &coarse_part_to_fine_part, bool is_root_partition) = 0;

virtual void createSubComm( HIVector &coarse_part_to_fine_part, bool is_root_partition ) = 0;

#ifdef AMGX_WITH_MPI
virtual MPI_Comm get_mpi_comm() = 0;
Expand Down
Loading