# Segmentation problem with HMETIS_ParteRecursive

Hi,
We are using the hMetis’s Library Interface. And more exactly the HMETIS_PartRecursive routine. We want to make a bisection of our hypergraph. The information we pass the routine is:
Nvtxs = 10
Nhedges = 9
Vwgts = null
Eptr = [0,2,4,6,8,10,12,14,16,18]
Eind = [0,1,2,0,3,2,4,3,1,5,6,7,7,8,9,6,5,9]
Hewgts = [7,8,9,10,1,9,10,8,7]
Nparts = 2
Ubfactor = 25
Options[0] = 0
Part = [0,0,0,0,0,0,0,0,0,0]
int [] pedgecut = new int[1];

HMETIS_PartRecursive(10, 9 ,null,Eptr,Eind,Hewgts, Nparts ,Ubfactor, Options, Part, pedgecut);

Taking into account the weigths of the hyperedges and the value of Nparts, we expect to have as the answer of the Hmetis call is: Part = [1,1,1,1,1,0,0,0,0,0]
Or the two subclusters:
{4,3,2,0,1} and {5,9,6,7,8}.
The edge-cut between the two new subclusters should be minimum. In our example: the value of the edge-cut should be 1.

But the answer we received after the call execution is this one:
Part = [1,1,1,1,0,0,0,0,0,0]
Or the two subclusters: {3,2,0,1} and {4,5,9,6,7,8}

So, what are we doing wrong?

Txalupa

### RE: Segmentation problem with HMETIS_ParteRecursive

Hi,

I wanted to say:
We were using SetIntArrayRegion function and now we are using ReleaseIntArrayElements.

Thanks.

### RE: Segmentation problem with HMETIS_ParteRecursive

Hi, we've solved the problem.
It was just the function we were using to copy back the returned values from the HMETIS_PartRecursive call from the C file into the Java file (we are using JNI).

We were using SetIntArrayRegion function and now we are using SetIntArrayRegion.

Thanks.

### RE: Hey txalupa, coulde you

Hey txalupa,

coulde you specify how you used JNI? I am trying to use the hMETIS library from within Java code and have a lot of trouble to do so. I would appreciate some hints.

Cheers, erik