<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
I tried to use ISColoringValue, but when I include<br>
<br>
IScoloringValue colors <br>
<br>
<br>
into my code, I get an error message from the compiler(gfortran):<br>
<br>
<br>
ISColoringValue colors<br>
1<br>
error: unclassifiable statement at (1)<br>
<br>
I'm including these header files, am I missing one?<br>
<br>
<br>
#include <finclude/petscsys.h><br>
#include <finclude/petscvec.h><br>
#include <finclude/petscdmda.h><br>
#include <finclude/petscis.h><br>
#include <finclude/petscmat.h><br>
#include <finclude/petscksp.h><br>
#include <finclude/petscpc.h><br>
#include <finclude/petscsnes.h><br>
#include <finclude/petscvec.h90><br>
#include <finclude/petscdmda.h90><br>
<br>
<br>
<br>
Thank you for your fast responses!<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">Am 15.05.2014 19:16, schrieb Peter
Brune:<br>
</div>
<blockquote
cite="mid:CAKKtykwL42Zk3GjyKODttyh9FffowVtLFJ0-S_pXQAQAeB_Omw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>You should be using an array of type ISColoringValue.
ISColoringValue is by default a short, not an int, so you're
getting nonsense entries. We should either maintain or remove
ex5s if it does something like this.<br>
</div>
<div><br>
</div>
<div>- Peter</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Thu, May 15, 2014 at 11:56 AM, Jonas
Mairhofer <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:mairhofer@itt.uni-stuttgart.de"
target="_blank">mairhofer@itt.uni-stuttgart.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
If 'colors' can be a dynamically allocated array then I dont
know where<br>
the mistake is in this code:<br>
<br>
<br>
<br>
<br>
<br>
ISColoring iscoloring<br>
Integer, allocatable :: colors(:)<br>
PetscInt maxc<br>
<br>
...<br>
<br>
<br>
!calculate max. number of colors<br>
maxc = 2*irc+1 !irc is the number of ghost nodes
needed to<br>
calculate the function I want to solve<br>
<br>
allocate(colors(user%xm)) !where user%xm is the number
of locally<br>
owned nodes of a global array<br>
<br>
!Set colors<br>
DO i=1,user%xm<br>
colors(i) = mod(i,maxc)<br>
END DO<br>
<br>
call<br>
ISColoringCreate(PETSC_COMM_WORLD,maxc,user%xm,colors,iscoloring,ierr)<br>
<br>
...<br>
<br>
deallocate(colors)<br>
call ISColoringDestroy(iscoloring,ierr)<br>
<br>
<br>
<br>
<br>
On execution I get the following error message (running the
DO Loop from<br>
0 to user%xm-1 does not change anything):<br>
<br>
<br>
[0]PETSC ERROR: --------------------- Error Message<br>
------------------------------------<br>
[0]PETSC ERROR: Arguments are incompatible!<br>
[0]PETSC ERROR: Number of colors passed in 291 is less then
the actual<br>
number of colors in array 61665!<br>
[0]PETSC ERROR:<br>
------------------------------------------------------------------------<br>
[0]PETSC ERROR: Petsc Release Version 3.4.4, Mar, 13, 2014<br>
[0]PETSC ERROR: See docs/changes/index.html for recent
updates.<br>
[0]PETSC ERROR: See docs/faq.html for hints about trouble
shooting.<br>
[0]PETSC ERROR: See docs/index.html for manual pages.<br>
[0]PETSC ERROR:<br>
------------------------------------------------------------------------<br>
[0]PETSC ERROR: ./DFT on a arch-linux2-c-debug named<br>
<a moz-do-not-send="true"
href="http://aries.itt.uni-stuttgart.de" target="_blank">aries.itt.uni-stuttgart.de</a>
by mhofer Thu May 15 18:01:41 2014<br>
[0]PETSC ERROR: Libraries linked from<br>
/usr/ITT/mhofer/Documents/Diss/NumericalMethods/Libraries/Petsc/petsc-3.4.4/arch-linux2-c-debug/lib<br>
[0]PETSC ERROR: Configure run at Wed Mar 19 11:00:35 2014<br>
[0]PETSC ERROR: Configure options --with-cc=gcc
--with-fc=gfortran<br>
--download-f-blas-lapack --download-mpich<br>
[0]PETSC ERROR:<br>
------------------------------------------------------------------------<br>
[0]PETSC ERROR: ISColoringCreate() line 276 in<br>
/usr/ITT/mhofer/Documents/Diss/NumericalMethods/Libraries/Petsc/petsc-3.4.4/src/vec/is/is/utils/iscoloring.c<br>
<br>
<br>
<br>
<br>
<br>
But when I print out colors, it only has entries from 0 to
218, so no<br>
entry is larger then 291 as stated in the error message.<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Am 15.05.2014 16:45, schrieb Jed Brown:
<div class="HOEnZb">
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Jonas Mairhofer <<a moz-do-not-send="true"
href="mailto:mairhofer@itt.uni-stuttgart.de"
target="_blank">mairhofer@itt.uni-stuttgart.de</a>>
writes:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi, I'm trying to set the coloring of a matrix using
ISColoringCreate.<br>
Therefore I need an array 'colors' which in C can be
creates as (from<br>
example ex5s.c)<br>
<br>
int *colors<br>
PetscMalloc(...,&colors)<br>
</blockquote>
There is no PetscMalloc in Fortran, due to language
"deficiencies".<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
colors(i) = ....<br>
<br>
ISColoringCreate(...)<br>
<br>
How do I have to define the array colors in Fortran?<br>
<br>
I tried:<br>
<br>
Integer, allocatable :: colors(:) and
allocate() instead of<br>
PetscMalloc<br>
<br>
and<br>
<br>
Integer, pointer :: colors<br>
<br>
but neither worked.<br>
</blockquote>
The ISColoringCreate Fortran binding copies from the
array you pass into<br>
one allocated using PetscMalloc. You should pass a
normal Fortran array<br>
(statically or dynamically allocated).<br>
</blockquote>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>