tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
p4est: init at unstable-2021-06-22
Carsten Burstedde
4 years ago
2bd08c84
eb396b15
+91
3 changed files
expand all
collapse all
unified
split
pkgs
development
libraries
science
math
p4est
default.nix
p4est-metis.patch
top-level
all-packages.nix
+59
pkgs/development/libraries/science/math/p4est/default.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{ lib, stdenv, fetchFromGitHub
2
+
, autoreconfHook, pkg-config
3
+
, p4est-withMetis ? true, metis
4
+
, p4est-sc
5
+
}:
6
+
7
+
let
8
+
inherit (p4est-sc) debugEnable mpiSupport;
9
+
dbg = if debugEnable then "-dbg" else "";
10
+
withMetis = p4est-withMetis;
11
+
in
12
+
stdenv.mkDerivation {
13
+
pname = "p4est${dbg}";
14
+
version = "unstable-2021-06-22";
15
+
16
+
# fetch an untagged snapshot of the prev3-develop branch
17
+
src = fetchFromGitHub {
18
+
owner = "cburstedde";
19
+
repo = "p4est";
20
+
rev = "7423ac5f2b2b64490a7a92e5ddcbd251053c4dee";
21
+
sha256 = "0vffnf48rzw6d0as4c3x1f31b4kapmdzr1hfj5rz5ngah72gqrph";
22
+
};
23
+
24
+
nativeBuildInputs = [ autoreconfHook pkg-config ];
25
+
propagatedBuildInputs = [ p4est-sc ];
26
+
buildInputs = lib.optional withMetis metis;
27
+
inherit debugEnable mpiSupport withMetis;
28
+
29
+
patches = [ ./p4est-metis.patch ];
30
+
postPatch = ''
31
+
sed -i -e "s:\(^\s*ACLOCAL_AMFLAGS.*\)\s@P4EST_SC_AMFLAGS@\s*$:\1 -I ${p4est-sc}/share/aclocal:" Makefile.am
32
+
'';
33
+
preConfigure = ''
34
+
echo "2.8.0" > .tarball-version
35
+
${if mpiSupport then "unset CC" else ""}
36
+
'';
37
+
38
+
configureFlags = [ "--with-sc=${p4est-sc}" ]
39
+
++ lib.optional withMetis "--with-metis"
40
+
++ lib.optional debugEnable "--enable-debug"
41
+
++ lib.optional mpiSupport "--enable-mpi"
42
+
;
43
+
44
+
inherit (p4est-sc) makeFlags dontDisableStatic enableParallelBuilding doCheck;
45
+
46
+
meta = {
47
+
branch = "prev3-develop";
48
+
description = "Parallel AMR on Forests of Octrees";
49
+
longDescription = ''
50
+
The p4est software library provides algorithms for parallel AMR.
51
+
AMR refers to Adaptive Mesh Refinement, a technique in scientific
52
+
computing to cover the domain of a simulation with an adaptive mesh.
53
+
'';
54
+
homepage = "https://www.p4est.org/";
55
+
downloadPage = "https://github.com/cburstedde/p4est.git";
56
+
license = lib.licenses.gpl2Plus;
57
+
maintainers = [ lib.maintainers.cburstedde ];
58
+
};
59
+
}
+26
pkgs/development/libraries/science/math/p4est/p4est-metis.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
diff --git a/src/p4est_connectivity.c b/src/p4est_connectivity.c
2
+
index 95339136..c93528f2 100644
3
+
--- a/src/p4est_connectivity.c
4
+
+++ b/src/p4est_connectivity.c
5
+
@@ -3715,6 +3715,7 @@ p4est_connectivity_reorder_newid (sc_MPI_Comm comm, int k,
6
+
sc_array_t * newid)
7
+
{
8
+
const int n = (int) conn->num_trees;
9
+
+ int metis_n;
10
+
int *xadj;
11
+
int *adjncy;
12
+
int *part;
13
+
@@ -3862,10 +3863,12 @@ p4est_connectivity_reorder_newid (sc_MPI_Comm comm, int k,
14
+
15
+
P4EST_GLOBAL_INFO ("Entering metis\n");
16
+
/* now call metis */
17
+
+ metis_n = n;
18
+
P4EST_EXECUTE_ASSERT_INT
19
+
- (METIS_PartGraphRecursive (&n, &ncon, xadj, adjncy, NULL, NULL,
20
+
+ (METIS_PartGraphRecursive (&metis_n, &ncon, xadj, adjncy, NULL, NULL,
21
+
NULL, &k, NULL, NULL, NULL, &volume, part),
22
+
METIS_OK);
23
+
+ P4EST_ASSERT (metis_n == n);
24
+
P4EST_GLOBAL_INFO ("Done metis\n");
25
+
26
+
P4EST_GLOBAL_STATISTICSF ("metis volume %d\n", volume);
+6
pkgs/top-level/all-packages.nix
···
29871
29872
p4est-sc-dbg = callPackage ../development/libraries/science/math/p4est-sc { };
29873
0
0
0
0
0
0
29874
petsc = callPackage ../development/libraries/science/math/petsc { };
29875
29876
parmetis = callPackage ../development/libraries/science/math/parmetis { };
···
29871
29872
p4est-sc-dbg = callPackage ../development/libraries/science/math/p4est-sc { };
29873
29874
+
p4est = callPackage ../development/libraries/science/math/p4est { };
29875
+
29876
+
p4est-dbg = callPackage ../development/libraries/science/math/p4est {
29877
+
p4est-sc = p4est-sc-dbg;
29878
+
};
29879
+
29880
petsc = callPackage ../development/libraries/science/math/petsc { };
29881
29882
parmetis = callPackage ../development/libraries/science/math/parmetis { };