Skip to content

Commit

Permalink
Merge release/1.4.1 into jcsda_emc_spack_stack (#296)
Browse files Browse the repository at this point in the history
* add noarch variant to scotch to disable SPACK_TARGET_ARGS

* Update bufr package.py for v12.0.0

* remove debug line

* Add [email protected]

* Add MPI (MPI_Fint/mpi_comm_f2c) patch to scotch/parmetis

* add comment for parmetis mpi patch

* Fix style errors in eckit and scotch

* Trigger CI

---------

Co-authored-by: Alex Richert <[email protected]>
Co-authored-by: Alex Richert <[email protected]>
  • Loading branch information
3 people authored Jul 14, 2023
1 parent 204f826 commit 01d6aa5
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 5 deletions.
10 changes: 7 additions & 3 deletions var/spack/repos/builtin/packages/eckit/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ class Eckit(CMakePackage):

maintainers("skosukhin", "climbfuji")

version("1.23.1", sha256="cd3c4b7a3a2de0f4a59f00f7bab3178dd59c0e27900d48eaeb357975e8ce2f15")
version("1.23.0", sha256="3cac55ddf7036ecd32cb0974a1ec3a2d347de574ab3a2c0bb6c6f8982e5a7a09")
version("1.22.1", sha256="a3463d07e47e3bd3e5efa13fdc03d7d3a30ada919ccec3259c6c9c7da4cfdfd9")
version("1.20.2", sha256="9c11ddaaf346e40d11312b81ca7f1b510017f26618f4c0f5c5c59c37623fbac8")
version("1.19.0", sha256="a5fef36b4058f2f0aac8daf5bcc9740565f68da7357ddd242de3a5eed4765cc7")
version("1.16.3", sha256="d2aae7d8030e2ce39e5d04e36dd6aa739f3c8dfffe32c61c2a3127c36b573485")
version("1.16.0", sha256="9e09161ea6955df693d3c9ac70131985eaf7cf24a9fa4d6263661c6814ebbaf1")

variant("build_type", default="RelWithDebInfo",
description="CMake build type",
values=("Debug", "Release", "RelWithDebInfo"))
variant(
"build_type",
default="RelWithDebInfo",
description="CMake build type",
values=("Debug", "Release", "RelWithDebInfo"),
)

variant("shared", default=True, description="Build shared libraries")
variant("tools", default=True, description="Build the command line tools")
Expand Down
16 changes: 14 additions & 2 deletions var/spack/repos/builtin/packages/scotch/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ class Scotch(CMakePackage, MakefilePackage):

build_system(conditional("cmake", when="@7:"), "makefile", default="cmake")
variant("threads", default=True, description="use POSIX Pthreads within Scotch and PT-Scotch")
variant("mpi_thread", default=True, description="use multi-threaded algorithms in conjunction with MPI")
variant(
"mpi_thread",
default=True,
description="use multi-threaded algorithms in conjunction with MPI",
)
variant("mpi", default=True, description="Compile parallel libraries")
variant("compression", default=True, description="May use compressed files")
variant("esmumps", default=False, description="Compile esmumps (needed by mumps)")
Expand All @@ -47,6 +51,7 @@ class Scotch(CMakePackage, MakefilePackage):
"metis", default=False, description="Expose vendored METIS/ParMETIS libraries and wrappers"
)
variant("int64", default=False, description="Use int64_t for SCOTCH_Num typedef")
variant("noarch", default=False, description="Unset SPACK_TARGET_ARGS")
variant(
"link_error_lib",
default=False,
Expand All @@ -68,6 +73,9 @@ class Scotch(CMakePackage, MakefilePackage):
patch("libscotchmetis-return-6.0.5a.patch", when="@6.0.5a")
patch("libscotch-scotcherr-link-7.0.1.patch", when="@7.0.1 +link_error_lib")

# Avoid OpenMPI segfaults by using MPI_Comm_F2C for parmetis communicator
patch("parmetis-mpi.patch", when="@6.1.1:7.0.3 ^openmpi")

# Vendored dependency of METIS/ParMETIS conflicts with standard
# installations
conflicts("^metis", when="+metis")
Expand Down Expand Up @@ -118,7 +126,7 @@ def cmake_args(self):
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
self.define_from_variant("BUILD_PTSCOTCH", "mpi"),
self.define_from_variant("THREADS", "threads"),
self.define_from_variant("MPI_THREAD_MULTIPLE", "mpi_thread")
self.define_from_variant("MPI_THREAD_MULTIPLE", "mpi_thread"),
]

# TODO should we enable/disable THREADS?
Expand All @@ -128,6 +136,10 @@ def cmake_args(self):

return args

@when("+noarch")
def setup_build_environment(self, env):
env.unset("SPACK_TARGET_ARGS")


class MakefileBuilder(spack.build_systems.makefile.MakefileBuilder):
build_directory = "src"
Expand Down
127 changes: 127 additions & 0 deletions var/spack/repos/builtin/packages/scotch/parmetis-mpi.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
diff --git a/src/libscotchmetis/parmetis_dgraph_order_f.c b/src/libscotchmetis/parmetis_dgraph_order_f.c
index 44c2ede..549a834 100644
--- a/src/libscotchmetis/parmetis_dgraph_order_f.c
+++ b/src/libscotchmetis/parmetis_dgraph_order_f.c
@@ -46,7 +46,7 @@
/** # Version 6.0 : from : 13 sep 2012 **/
/** to : 18 may 2019 **/
/** # Version 7.0 : from : 21 jan 2023 **/
-/** to : 21 jan 2023 **/
+/** to : 30 jun 2023 **/
/** **/
/************************************************************/

@@ -76,11 +76,14 @@ const SCOTCH_Num * const numflag, \
const SCOTCH_Num * const options, \
SCOTCH_Num * const order, \
SCOTCH_Num * const sizes, \
-MPI_Comm * const commptr, \
+const MPI_Fint * const commptr, \
int * const revaptr), \
(vtxdist, xadj, adjncy, numflag, options, order, sizes, commptr, revaptr))
{
- *revaptr = SCOTCH_ParMETIS_V3_NodeND (vtxdist, xadj, adjncy, numflag, options, order, sizes, commptr);
+ MPI_Comm commdat;
+
+ commdat = MPI_Comm_f2c (*commptr);
+ *revaptr = SCOTCH_ParMETIS_V3_NodeND (vtxdist, xadj, adjncy, numflag, options, order, sizes, &commdat);
}

/*******************/
@@ -101,10 +104,13 @@ const SCOTCH_Num * const numflag, \
const SCOTCH_Num * const options, \
SCOTCH_Num * const order, \
SCOTCH_Num * const sizes, \
-MPI_Comm * const commptr), \
+const MPI_Fint * const commptr), \
(vtxdist, xadj, adjncy, numflag, options, order, sizes, commptr))
{
- METISNAMEU (ParMETIS_V3_NodeND) (vtxdist, xadj, adjncy, numflag, options, order, sizes, commptr);
+ MPI_Comm commdat;
+
+ commdat = MPI_Comm_f2c (*commptr);
+ METISNAMEU (ParMETIS_V3_NodeND) (vtxdist, xadj, adjncy, numflag, options, order, sizes, &commdat);
}

#endif /* SCOTCH_METIS_PREFIX */
diff --git a/src/libscotchmetis/parmetis_dgraph_part_f.c b/src/libscotchmetis/parmetis_dgraph_part_f.c
index 2b76818..3bf66af 100644
--- a/src/libscotchmetis/parmetis_dgraph_part_f.c
+++ b/src/libscotchmetis/parmetis_dgraph_part_f.c
@@ -44,7 +44,7 @@
/** # Version 6.0 : from : 13 sep 2012 **/
/** to : 18 may 2019 **/
/** # Version 7.0 : from : 21 jan 2023 **/
-/** to : 21 jan 2023 **/
+/** to : 30 jun 2023 **/
/** **/
/************************************************************/

@@ -81,12 +81,15 @@ const float * const ubvec, \
const SCOTCH_Num * const options, \
SCOTCH_Num * const edgecut, \
SCOTCH_Num * const part, \
-MPI_Comm * const commptr, \
+const MPI_Fint * const commptr, \
int * const revaptr), \
(vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag, ncon, nparts, tpwgts, ubvec, options, edgecut, part, commptr, revaptr))
{
+ MPI_Comm commdat;
+
+ commdat = MPI_Comm_f2c (*commptr);
*revaptr = SCOTCH_ParMETIS_V3_PartKway (vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag,
- ncon, nparts, tpwgts, ubvec, options, edgecut, part, commptr);
+ ncon, nparts, tpwgts, ubvec, options, edgecut, part, &commdat);
}

/*
@@ -111,12 +114,15 @@ const float * const ubvec, \
const SCOTCH_Num * const options, \
SCOTCH_Num * const edgecut, \
SCOTCH_Num * const part, \
-MPI_Comm * const commptr, \
+const MPI_Fint * const commptr, \
int * const revaptr), \
(vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag, ndims, xyz, ncon, nparts, tpwgts, ubvec, options, edgecut, part, commptr, revaptr))
{
+ MPI_Comm commdat;
+
+ commdat = MPI_Comm_f2c (*commptr);
*revaptr = SCOTCH_ParMETIS_V3_PartGeomKway (vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag,
- ndims, xyz, ncon, nparts, tpwgts, ubvec, options, edgecut, part, commptr);
+ ndims, xyz, ncon, nparts, tpwgts, ubvec, options, edgecut, part, &commdat);
}

/*******************/
@@ -144,10 +150,13 @@ const float * const ubvec, \
const SCOTCH_Num * const options, \
SCOTCH_Num * const edgecut, \
SCOTCH_Num * const part, \
-MPI_Comm * const commptr), \
+const MPI_Fint * const commptr), \
(vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag, ncon, nparts, tpwgts, ubvec, options, edgecut, part, commptr))
{
- METISNAMEU (ParMETIS_V3_PartKway) (vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag, ncon, nparts, tpwgts, ubvec, options, edgecut, part, commptr);
+ MPI_Comm commdat;
+
+ commdat = MPI_Comm_f2c (*commptr);
+ METISNAMEU (ParMETIS_V3_PartKway) (vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag, ncon, nparts, tpwgts, ubvec, options, edgecut, part, &commdat);
}

/*
@@ -172,10 +181,13 @@ const float * const ubvec,
const SCOTCH_Num * const options, \
SCOTCH_Num * const edgecut, \
SCOTCH_Num * const part, \
-MPI_Comm * const commptr), \
+const MPI_Fint * const commptr), \
(vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag, ndims, xyz, ncon, nparts, tpwgts, ubvec, options, edgecut, part, commptr))
{
- METISNAMEU (ParMETIS_V3_PartGeomKway) (vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag, ndims, xyz, ncon, nparts, tpwgts, ubvec, options, edgecut, part, commptr);
+ MPI_Comm commdat;
+
+ commdat = MPI_Comm_f2c (*commptr);
+ METISNAMEU (ParMETIS_V3_PartGeomKway) (vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag, ndims, xyz, ncon, nparts, tpwgts, ubvec, options, edgecut, part, &commdat);
}

#endif /* SCOTCH_METIS_PREFIX */

0 comments on commit 01d6aa5

Please sign in to comment.