elemental / Elemental

Distributed-memory, arbitrary-precision, dense and sparse-direct linear algebra, conic optimization, and lattice reduction
Other
505 stars 110 forks source link

ComputeVertexSeparator #239

Closed davydden closed 7 years ago

davydden commented 7 years ago

I was trying to figure out how to patch the 4.0.3 parmetis to make it work with Elemental. Yes, elemental knows how to download from its own fork https://github.com/scibuilder/parmetis but I am interested in making this work properly and consistently within a SPACK package manager https://github.com/LLNL/spack where elemental can be used together with dozens of other packages to build something and it is really better not to have packages which build their dependencies internally.

I tried copying ComputeVertexSeparator.c but that's not enough:

/spack/var/spack/stage/parmetis-4.0.3-kcdycqlvze46qqsyzduid4obmd7newxb/parmetis-4.0.3/libparmetis/ComputeVertexSeparator.c:73:1: error: unknown type name 'METIS_EXPORT'
METIS_EXPORT void ParMETIS_ComputeVertexSeparator
^
/spack/var/spack/stage/parmetis-4.0.3-kcdycqlvze46qqsyzduid4obmd7newxb/parmetis-4.0.3/libparmetis/ComputeVertexSeparator.c:73:14: error: expected identifier or '('
METIS_EXPORT void ParMETIS_ComputeVertexSeparator
             ^

I would appreciate if developers could provide a patch w.r.t. 4.0.3 to add the required functionality.

poulson commented 7 years ago

I would recommend configuring Elemental to disable ParMetis and use Metis instead via EL_DISABLE_PARMETIS.

davydden commented 7 years ago

Could you please elaborate why?

EDIT: what you suggest is already possible, see https://github.com/LLNL/spack/blob/develop/var/spack/repos/builtin/packages/elemental/package.py I just want to remove the internal build of parmetis.

poulson commented 7 years ago

If EL_DISABLE_PARMETIS=ON is passed into CMake, then ParMETIS should not be built and the custom ParMETIS extension should no longer be a problem. I submitted the extension upstream quite some time ago, but it seems it was never merged (METIS_ComputeVertexSeparator exists to support nested dissection in ParMETIS, but there is no official ParMETIS_ComputeVertexSeparator for others to build their own nested dissection on top of ParMETIS, hence my addition). Further, ParMETIS is often significantly slower than METIS (assuming your graph fits in memory), so it's an acceptable compromise to simply not include it and rely on METIS.

In hindsight, it would have been better to entirely drop the ParMETIS dependency and build my own graph partitioner.

davydden commented 7 years ago

ParMETIS should not be built and the custom ParMETIS extension should no longer be a problem

it's not the extension which is an inconvenience, but rather the fact that there is no small patch being provided which can be applied to 4.0.3 to build parmetis outside of elemental using available package managers like Spack.

To elaborate: if I use Elemental with Petsc and a dozens of other packages like trilinos, superlu_dist, etc to build a user library, i want all of them to use one and only one variant/build of parmetis. To that end, each package should build only itself without any dependencies.

I submitted the extension upstream quite some time ago, but it seems it was never merged

that's a pity

it would have been better to entirely drop the ParMETIS dependency and build my own graph partitioner.

maybe remove parmetis from the next release altogether?..

jedbrown commented 7 years ago

Denis Davydov notifications@github.com writes:

I submitted the extension upstream quite some time ago, but it seems it was never merged

that's a pity

To first order, all patches are ignored because ParMETIS (and METIS) are abandonware. Also, while the METIS license is now fine, the ParMETIS license is absurdly far from an OSI conforming license.

The ParMETIS package is copyrighted by the Regents of the University of Minnesota. It can be freely used for educational and research purposes by non-profit institutions and US government agencies only. Other organizations are allowed to use ParMETIS only for evaluation purposes, and any further uses will require prior approval. The software may not be sold or redistributed without prior approval. One may make copies of the software for their use provided that the copies, are not sold or distributed, are used under the same terms and conditions.

These factors combine to make ParMETIS a serious liability. The community is in desperate need of a robust parallel partitioner with a healthy community.

poulson commented 7 years ago

Unless others are willing to step up, Elemental as it stands is also about to become abandonware. I am personally ready to move on from the current codebase.

jedbrown commented 7 years ago

At least the Elemental license does not forbid people from doing so...

jeffhammond commented 7 years ago

Software is one of the few artistic efforts where artists are criticized for saying they are done. Abandonware is an unfortunate pejorative term.

jedbrown commented 7 years ago

And if the author chooses a license that prevents the community from picking it up, the author deserves that criticism.

davydden commented 7 years ago

i am closing the issue as it appears to be a wont-fix