Commit cddbf553 authored by LACHAT Cedric's avatar LACHAT Cedric

Some fixes due to project merges

parent 85a704f7
......@@ -129,7 +129,7 @@ elseif (INT_SIZE STREQUAL "long")
add_definitions (-DLONG)
endif ()
option(PAMPA_ADAPT "Adapt functions" ON)
option(PAMPA_ADAPT "Adapt functions" OFF)
if (PAMPA_ADAPT)
add_definitions (-DPAMPA_ADAPT)
endif ()
......
......@@ -100,7 +100,6 @@ dmeshOverlap2 (
Gnum hashnbr,
Gnum hashmsk);
static
int
dmeshOvlpProcVertResize (
DmeshOvlpProcVert * restrict * hashtabptr,
......
......@@ -59,6 +59,7 @@
#include <ptscotch.h>
#include "dmesh_dgraph.h"
#include "dgraph_graph.h"
#include "dmesh_overlap.h"
#include "dmesh_redist.h"
//! This routine computes another distributed mesh which corresponds to the
......@@ -79,6 +80,31 @@ dmeshRedist (
Gnum const dstovlpglbval,
Dmesh * const dstmeshptr) //!< XXX
{
return (dmeshRedistFull (srcmeshptr, srcpartloctax, srcpermgsttax, dstvertlocdlt, dstedgelocdlt, dstovlpglbval, dstmeshptr, NULL, ~0, ~0, ~0));
}
//! This routine computes another distributed mesh which corresponds to the
//! partition, with all arguments (especially for the overlap).
//XXX ne pas oublier de mettre un mot sur le fait que c'est cette fonction qui
//initialise le Dmesh destinataire en faisant une copie du communicateur
//!
//! \returns 0 : if the computation succeeded.
//! \returns !0 : on error.
int
dmeshRedistFull (
Dmesh * const srcmeshptr, //!< XXX
Gnum * const srcpartloctax, //!< XXX
Gnum * const srcpermgsttax, //!< XXX
Gnum const dstvertlocdlt, //!< XXX
Gnum const dstedgelocdlt, //!< XXX
Gnum const dstovlpglbval,
Dmesh * const dstmeshptr, //!< XXX
DmeshOvlpProcVert * const ovphashtab,
Gnum ovphashsiz, /* Size of hash table */
Gnum ovphashnbr,
Gnum ovphashmsk)
{
//errorPrint("is not yet implemented");
//return (1);
......@@ -101,6 +127,7 @@ dmeshRedist (
Gnum * dstenttloctx2;
Gnum dstpermlocnbr;
Gnum * dstpermloctax;
DmeshRedistVert * dstpermloctx2;
DmeshRedistVert * dstenttpermloctax;
Gnum srcpermlocnbr;
Gnum * srcpermloctax;
......@@ -254,10 +281,10 @@ dmeshRedist (
/* Exchanging entity numbers */
if (memAllocGroup ((void **) (void *)
&dstenttloctax, (size_t) (vrcvlocnbr * sizeof (Gnum)),
&dstenttloctx2, (size_t) (dstpermlocnbr * sizeof (Gnum)),
&dstpermloctax, (size_t) (dstpermlocnbr * sizeof (Gnum)),
&dstenttpermloctax, (size_t) (dstpermlocnbr * sizeof (DmeshRedistVert)),
&dstenttloctax, (size_t) (vrcvlocnbr * sizeof (Gnum)),
&dstenttloctx2, (size_t) (dstpermlocnbr * sizeof (Gnum)),
&dstpermloctax, (size_t) ((dstpermlocnbr * 2) * sizeof (Gnum)),
&dstenttpermloctax, (size_t) (dstpermlocnbr * sizeof (DmeshRedistVert)),
(void *) NULL) == NULL) {
errorPrint ("out of memory");
cheklocval = 1;
......@@ -456,6 +483,22 @@ dmeshRedist (
}
}
if (dstpermloctax != NULL) {
for (vertlocnum = baseval + vrcvlocnbr - 1, vertlocnnd = baseval - 1; vertlocnum > vertlocnnd; vertlocnum --) {
if (dstpermloctax[vertlocnum] != ~0) { // XXX ne pourrait-on pas faire sans le postulat sur dstpermloctax ?
dstpermloctax[vertlocnum] -= vertlocbas;
dstenttloctx2[dstpermloctax[vertlocnum]] = dstenttloctax[vertlocnum];
dstpermloctax[2 * vertlocnum] = dstpermloctax[vertlocnum];
dstpermloctax[2 * vertlocnum + 1] = vertlocnum;
}
}
intSort2asc1 (dstpermloctax + baseval, vrcvlocnbr);
dstpermloctx2 = (DmeshRedistVert *) (dstpermloctax + baseval) - baseval;
}
else
dstpermloctx2 = NULL;
for (enttlocnum = baseval, enttlocnnd = srcmeshptr->enttglbnbr + baseval; enttlocnum < enttlocnnd; enttlocnum ++) {
DmeshEntity * restrict enttlocptr;
Dvalues * valslocptr = srcmeshptr->valslocptr;
......@@ -515,7 +558,7 @@ dmeshRedist (
else
bvrtlocnum = enttlocptr->mvrtloctax[vertlocnum] - dstvertlocbas;
dstenttpermloctax[vertlocnum].vertnum = dstpermloctax[bvrtlocnum];
dstenttpermloctax[vertlocnum].vertnum = dstpermloctx2[bvrtlocnum].indxval;
dstenttpermloctax[vertlocnum].indxval = vertlocnum;
}
......@@ -578,7 +621,8 @@ dmeshRedist (
return (cheklocval);
}
if (dstpermloctax == NULL) {
CHECK_FERR (dmeshValueLink(dstmeshptr, (void **) &dstvaluloctmp, (valulocptr->flagval & ~PAMPA_VALUE_ALLOCATED), &dummy, &dummy2, valulocptr->typeval, enttlocnum, valulocptr->tagnum), srcmeshptr->proccomm);
if (dstpermloctx2 == NULL) {
dstvaluloctm2 = dstvaluloctmp;
}
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment