<div class="gmail_quote">On Sat, Sep 22, 2012 at 3:56 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>I was not sure that would work, but of course I tried it before pushing:</div></blockquote><div><br></div><div>Try a C compiler or clang++. It's working for you due to a g++ bug.</div><div><br></div><div>Don't bother fixing it. I'm going to inline this routine anyway because I want to be able to use it in MatSetValues where we don't want to have to save registers to do the search.</div>
<div><br></div><div>To make it more useful, should we return the location that the new item would go?</div><div><br></div><div>So if we search for 5 in [2,4,7,8], we return -3. The calling user code would look like</div><div>
<br></div><div>PetscFindInt(...,&loc);</div><div>if (loc < 0) insert_at = -(loc+1);</div><div><br></div><div>Or a different routine for that purpose?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br></div><div><div> Compiling C files ['/PETSc3/petsc/petsc-dev-pylith/src/sys/utils/sorti.c']</div><div> Pushing language Cxx</div>
<div>/PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/bin/mpicxx -c -I/PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/include -I/PETSc3/petsc/petsc-dev-pylith/include -I/PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/include -I/PETSc3/petsc/petsc-dev-pylith/include/sieve -I/PETSc3/petsc/exodusii-4.98/include -I/PETSc3/petsc/exodusii-4.98/cbind/include -I/PETSc3/petsc/exodusii-4.98/forbind/include -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g -PIC -MMD -D__INSDIR__= /PETSc3/petsc/petsc-dev-pylith/src/sys/utils/sorti.c</div>
<div>sh: /PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/bin/mpicxx -c -I/PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/include -I/PETSc3/petsc/petsc-dev-pylith/include -I/PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/include -I/PETSc3/petsc/petsc-dev-pylith/include/sieve -I/PETSc3/petsc/exodusii-4.98/include -I/PETSc3/petsc/exodusii-4.98/cbind/include -I/PETSc3/petsc/exodusii-4.98/forbind/include -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g -PIC -MMD -D__INSDIR__= /PETSc3/petsc/petsc-dev-pylith/src/sys/utils/sorti.c</div>
<div>Executing: /PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/bin/mpicxx -c -I/PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/include -I/PETSc3/petsc/petsc-dev-pylith/include -I/PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/include -I/PETSc3/petsc/petsc-dev-pylith/include/sieve -I/PETSc3/petsc/exodusii-4.98/include -I/PETSc3/petsc/exodusii-4.98/cbind/include -I/PETSc3/petsc/exodusii-4.98/forbind/include -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g -PIC -MMD -D__INSDIR__= /PETSc3/petsc/petsc-dev-pylith/src/sys/utils/sorti.c</div>
<div>sh: </div><div> Popping language Cxx</div><div> Moving sorti.o to /PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/lib/libpetsc-obj/sorti.o</div><div> Moving sorti.d to /PETSc3/petsc/petsc-dev-pylith/arch-sieve-fdatatypes-debug/lib/libpetsc-obj/sorti.d</div>
</div></blockquote></div><br>