How to call a METIS subroutine from my FORTRAN code.

Hello to all METIS/FORTRAN programmers..

Despite being exceedingly embarassing - i have finally succumbed to
asking this. All i seek is to call the subroutine METIS_NODEND from my
fortran code and the sad part is that despite reading the entire
section 5.8 of the users manual where even though it is mentioned that
these routines are callable from either c or fortran, there are no
examples to actually do so.

Furthermore, reading in other places, I am lead to believe that there
might be a requirement of a fortran version of the metis.h header file
that would need to be included in the FORTRAN code. However - it is not
present in the latest distributed package. :-(

If there is anyone out there who is using FORTRAN and has managed to
successfully call the METIS subroutines - I would really appreciate
some pointers and if possible some actual example files - that i can go
through and understand. 

Much thanks,

-A

0
wiredashu (16)
11/30/2005 11:00:06 PM
comp.lang.fortran 11347 articles. 37 followers. Post Follow

20 Replies
974 Views

Similar Articles

[PageSpeed] 11
AM,

 I know this is possible, since I received a code from the University of
Minnesota that does this.  I have this code in object format only, therefore I
don't have any examples to do this.  What Fortran and C compilers do you have
available??

Joe



On 30 Nov 2005 15:00:06 -0800, "AM" <wiredashu@gmail.com> wrote:

>Hello to all METIS/FORTRAN programmers..
>
>Despite being exceedingly embarassing - i have finally succumbed to
>asking this. All i seek is to call the subroutine METIS_NODEND from my
>fortran code and the sad part is that despite reading the entire
>section 5.8 of the users manual where even though it is mentioned that
>these routines are callable from either c or fortran, there are no
>examples to actually do so.
>
>Furthermore, reading in other places, I am lead to believe that there
>might be a requirement of a fortran version of the metis.h header file
>that would need to be included in the FORTRAN code. However - it is not
>present in the latest distributed package. :-(
>
>If there is anyone out there who is using FORTRAN and has managed to
>successfully call the METIS subroutines - I would really appreciate
>some pointers and if possible some actual example files - that i can go
>through and understand. 
>
>Much thanks,
>
>-A

0
12/1/2005 12:15:24 AM
Joe !

I am using the intel Fortran and C compilers on in a linux environment.
I did a grep to find which c files had the Metis_nodend and then - went
onto link frename.c to my fortran code. The code compiles and links
just fine - however when executing it -, just before the call to
Metis_nodend(..) it crashes.
Any hints ?

thank you taking the time to reply. Much appreciated ! 

-AM

0
wiredashu (16)
12/1/2005 11:55:09 AM
AM wrote:

> Hello to all METIS/FORTRAN programmers..
>
> Despite being exceedingly embarassing - i have finally succumbed to
> asking this. All i seek is to call the subroutine METIS_NODEND from my
> fortran code and the sad part is that despite reading the entire
> section 5.8 of the users manual where even though it is mentioned that
> these routines are callable from either c or fortran, there are no
> examples to actually do so.
>
> Furthermore, reading in other places, I am lead to believe that there
> might be a requirement of a fortran version of the metis.h header file
> that would need to be included in the FORTRAN code. However - it is not
> present in the latest distributed package. :-(
>
> If there is anyone out there who is using FORTRAN and has managed to
> successfully call the METIS subroutines - I would really appreciate
> some pointers and if possible some actual example files - that i can go
> through and understand. 
> 
> Much thanks,
> 
> -A

0
edunlop1 (5)
12/1/2005 3:46:26 PM
AM,

The following code works nicely with Intel Fortran 9.0 for Windows.
Hope this may help.

Edmund

------------------------------------------------------------------------------------

      subroutine MND(n, m, node, link, perm, iperm)
      implicit none
      integer,intent(in) :: n, m
      integer,intent(in),dimension(n+1) :: node
      integer,intent(in),dimension(2*m) :: link
      integer,intent(out),dimension(n) :: perm, iperm
      integer :: numflag
      integer,dimension(0:7) :: options
      external METIS_NodeND
!DEC$ ATTRIBUTES C,REFERENCE, ALIAS:"_METIS_NodeND" :: METIS_NodeND
!
! METIS_NodeND (N, NODE, LINK, NUMFLAG, OPTIONS, PERM, IPERM)
!
! Description
!
! This function computes fill reducing orderings of sparse matrices
! using the multilevel nested dissection algorithm. It provides the
! functionality of the onmetis program.
!
! Parameters
!
! N  The number of vertices in the graph.
!
! NODE, LINK
! The adjacency structure of the graph as described below.
!
! NUMFLAG  Used to indicate which numbering scheme is used for the
! adjacency structure of the graph. NUMFLAG can take the following two
! values:
! 0  C-style numbering is assumed that starts from 0
! 1  Fortran-style numbering is assumed that starts from 1
!
! OPTIONS  This is an array of 8 integers that is used to pass
! parameters for the various phases of the algorithm.
!
! If OPTIONS[0]=0 then default values are used. If OPTIONS[0]=1, then
! the remaining seven elements of options are interpreted as follows:
!
!   OPTIONS[1]  Determines the matching type. Possible values are:
!   1 Random Matching (RM)
!   2 Heavy-Edge Matching (HEM)
!   3 Sorted Heavy-Edge Matching (SHEM) (Default)
!   Experiments have shown that all three matching schemes perform
quite
!   well. In general SHEM is faster and RM is slower, but feel free to
!   experiment with the other matching schemes.
!
!   OPTIONS[2]  Determines the algorithm used during initial
!               partitioning. Possible values are:
!   1 Edge-based region growing (Default)
!   2 Node-based region growing
!
!   OPTIONS[3]  Determines the algorithm used for refinement. Possible
!               values are:
!   1 Two-sided node FM refinement
!   2 One-sided node FM refinement (Default)
!   One-sided FM refinement is faster than two-sided, but in some cases
!   two-sided refinement may produce better orderings. Feel free to
!   experiment with this option.
!
!   OPTIONS[4]  Used for debugging purposes. Always set it to 0
!               (Default).
!
!   OPTIONS[5]  Used to select whether or not to compress the graph and
!               to order connected components separately. The possible
!               values and their meaning are as follows:
!   0 Do not try to compress the graph and do not order each connected
!     component separately.
!   1 Try to compress the graph. (A compressed graph is actually formed
!     if the size of the graph can be reduced by at least 15%)
!     (Default).
!   2 Order each connected component of the graph separately. This
!     option is particularly useful when after a few levels of nested
!     dissection, the graph breaks up in many smaller disconnected
!     subgraphs. This is true for certain types of LP matrices.
!   3 Try to compress the graph and also order each connected component
!     separately.
!
!   OPTIONS[6]  Used to control whether or not the ordering algorithm
!               should remove any vertices with high degree (i.e.,
dense
!               columns). This is particularly helpful for certain
!               classes of LP matrices, in which there a few vertices
!               that are connected to many other vertices. By removing
!               these vertices prior to ordering, the quality and the
!               amount of time required to do the ordering improves.
The
!               possible values are as follows:
!   0  Do not remove any vertices (Default)
!   x  Where x > 0, instructs the algorithm to remove any vertices
whose
!      degree is greater than 0.1 * x * average degree). For example if
!      x = 40, and the average degree is 5, then the algorithm will
!      remove all vertices with degree greater than 20. The vertices
!      that are removed are ordered last (i.e., they are automatically
!      placed in the top-level separator). Good values are often in the
!      range of 60 to 200 (i.e., 6 to 20 times more than the average).
!
!   OPTIONS[7]  Used to determine how many separators to find at each
!               step of nested dissection. The larger the number of
!               separators found at each step, the higher the runtime
!               and better the quality is (in general). The default
!               value is 1, unless the graph has been compressed by
more
!               than a factor of 2, in which case it becomes 2.
!               Reasonable values are in the range of 1 to 5. For most
!               problems, a value of 5 increases the runtime by a
factor
!               of 3.
!
! PERM, IPERM
! These are vectors, each of size n. Upon successful completion, they
! store the fill-reducing permutation and inverse-permutation. Let A be
! the original matrix and A' be the permuted matrix. The arrays PERM
and
! IPERM are defined as follows. Row (column) i of A' is the PERM[i] row
! (column) of A, and row (column) i of A is the IPERM[i] row (column)
of
! A'. The numbering of this vector starts from either 0 or 1, depending
! on the value of numflag.
!
!
======================================================================
!
! The adjacency structure of the graph is stored using the compressed
! storage format (CSR). The CSR format is a widely used scheme for
! storing sparse graphs. In this format the adjacency structure of a
! graph with n vertices and m edges is represented using two arrays
NODE
! and LINK. The NODE array is of size n+1 whereas the LINK array is of
! size 2m (this is because for each edge between vertices v and u we
! actually store both (v,u) and (u,v)).
!
! The adjacency structure of the graph is stored as follows. Assuming
! that vertex numbering starts from 1 (Fortran style), then the
! adjacency list of vertex i is stored in array LINK starting at index
! NODE[i] and ending at (but not including) index NODE[i+1] (i.e.,
! LINK[NODE[i]] through and including LINK[NODE[i+1]-1]). That is, for
! each vertex i , its adjacency list is stored in consecutive locations
! in the array LINK, and the array NODE is used to point to where it
! begins and where it ends. Figure 1(b) illustrates the CSR format for
! the 15-vertex graph shown in Figure 1(a).
!
!
!    1-- 2-- 3-- 4-- 5
!    |   |   |   |   |
!    6-- 7-- 8-- 9--10
!    |   |   |   |   |
!   11--12--13--14--15
!
!   (a) A sample graph
!
!
!   N = 15;  M = 22
!
!   NODE(N+1)     1  3  6  9 12 14 17 21 25 29 32 34 37 40 43 45
!
!   LINK(2*M)     2  6  1  3  7  2  4  8  3  5  9  4 10  1  7 11  2  6
!                 8 12  3  7  9 13  4  8 10 14  5  9 15  6 12  7 11 13
!                 8 12 14  9 13 15 10 14
!
!   (b) CSR format
!
!   Figure 1: An example of the CSR format for storing sparse graphs.
!
!
      numflag = 1
      options(0) = 0
      call METIS_NodeND(n, node, link, numflag, options, perm, iperm)
      return
      end subroutine MND

0
edunlop1 (5)
12/1/2005 4:02:58 PM
One further thought (on the C side - I use Intel C/C++ for Windows):

I needed to modify metis.h as follows:

/*
 * Copyright 1997, Regents of the University of Minnesota
 *
 * metis.h
 *
 * This file includes all necessary header files
 *
 * Started 8/27/94
 * George
 *
 * $Id: metis.h,v 1.1 1998/11/27 17:59:21 karypis Exp $
 */


#define __VC__

#include <stdio.h>
#ifdef __STDC__
#include <stdlib.h>
#else
#include <malloc.h>
#endif
/*
 * #include <strings.h>
 */
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <stdarg.h>
#include <time.h>

#ifdef DMALLOC
#include <dmalloc.h>
#endif

#include <defs.h>
#include <struct.h>
#include <macros.h>
#include <rename.h>
#include <proto.h>

I then compiled all the .c files and used the linker to make a .lib
file ( .a in Linux parlance?).

I then compiled my Fortran source and included a search of the .lib
file on the final link.

By the way, sorry about the blank response initially - my first time to
try Google with this newsgroup and I was too fast at pressing buttons.

Hope this helps,

Edmund

0
edunlop1 (5)
12/1/2005 4:23:58 PM
Hi Edmund !

Thank you for your response(s). I do still have a few questions:

Going by your above examples - i noticed that the entire section in "!"
is commented out. What leaves is that there is just a direct call to
Metis_NodeNd from external subroutine MND. I was doign the same thing -
and it's not working. The basic problem is that how does FORTRAN and C
know where to call the function from. Ideally - if there was a fortran
version of the header file - metis.c -then all this would be been more
than evident.

I am still lost a bit. Also - from what i can see - the only change you
made to your metis.c header file is the addition of #define __VC__

apart from that what i have out here is the same - (except it's on a
Linux platform). If you wish - i can post a bit of my FORTRAN code ?

Regards,

-AM

0
wiredashu (16)
12/1/2005 6:36:23 PM
I've never heard of Metis, but...

AM <wiredashu@gmail.com> wrote:

> The basic problem is that how does FORTRAN and C
> know where to call the function from. Ideally - if there was a fortran
> version of the header file - metis.c -then all this would be been more
> than evident.

Significant confusions of terminology or something here.

A procedure is "called" (invoked) from wherever the call statement or
function reference appears in the source code. I think that perhaps you
are asking about where the procedure itself comes from rather than where
it is called from. The answer to that is generally that you have either
the source code or a library for the procedure somewhere, and you have
to tell the compiler to use that. You would use compiler command-line
switches (or the GUI equivalent) to tell the compiler that. That
information is not in the invoking source code (either in C or Fortran).

And a .c file would not be a "header" file. I think you mean metis.h.

> I was doign the same thing - and it's not working.

What does "it's not working" mean? That's not very descriptive. I'm sure
you get a bit more detailed error message than that.

> i noticed that the entire section in "!" is commented out.

Ah. I just noticed this. It might be your problem. A "comment" beginning
with, for example, "!DEC$", as one of these does, is not "really" a
comment. That's a commonly used convention for a compiler directive. In
this case, that compiler directive hapens to be critically important; if
you leave it out because you think it is just a comment and therefore
doesn't matter, things probably won't work. I'm placing my money on that
being your problem.

-- 
Richard Maine                     | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov            |       -- Mark Twain
0
nospam47 (9747)
12/1/2005 7:12:05 PM
To expand on Richard Maine's comments:

This line:
      external METIS_NodeND
is Fortran telling the compiler the routine is an external routine.

But this line:
!DEC$ ATTRIBUTES C,REFERENCE, ALIAS:"_METIS_NodeND" :: METIS_NodeND
is a Digital (DVF/CVF) directive, not part of the Fortran language, which tells the
compiler that the external symbol METIS_NodeND is expecting the C-language calling
and naming conventions, but the arguments are to be passed by reference (i.e.,
send addresses) and the published name to find it (in external .OBJ or .LIB) is
_METIS_NodeND which will be treated in a case-sensitive manner by the compiler since
it is in quotes.  Provided the linker preserves case during link operations, the 
symbol should be found and linked properly.  

If you are not using DVF/CVF or another compiler that supports DEV-style metacommands,
then you will need a different means of informing the compiler about the name aliasing
and calling conventions.

Isn't mixed language programming fun?
0
kgrhoads (401)
12/1/2005 7:38:07 PM
Hi there...the reason why i think it's a comment is because, there is
an entire subroutine description that is preceded by the "!". If it
were not so - then there would be more elementary problems..?

Also - yes..i meant metis.h. the package ships with the c header file,
however FORTRAN programmers seem to be tragically out of luck.

Finally when i mentioned it didnt work - well the code terminates..
Here is a replication of the same..
------------------------------------
Calling METIS...
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line
Source
vsim_metis_slu     00000000004D09F7  Unknown               Unknown
Unknown
vsim_metis_slu     00000000004C6612  Unknown               Unknown
Unknown
vsim_metis_slu     0000000000410826  Unknown               Unknown
Unknown
vsim_metis_slu     0000000000408C12  Unknown               Unknown
Unknown
vsim_metis_slu     0000000000405C76  Unknown               Unknown
Unknown
libc.so.6          0000002A95E301AE  Unknown               Unknown
Unknown
vsim_metis_slu     0000000000405BAA  Unknown               Unknown
Unknown
rank 0 in job 1  on <..>  caused collective abort of all ranks  exit
status of rank 0: return code 174
--------------------

Any hints ? 

-AM

0
wiredashu (16)
12/1/2005 7:47:09 PM
OHHHH ! ! ! ...ok..let me try something...and then will post this back.
If am successful - i swear i will post a small guide.

Be right back. :-)

-AM

0
wiredashu (16)
12/1/2005 8:08:36 PM
AM <wiredashu@gmail.com> wrote:

> Hi there...the reason why i think it's a comment is because, there is
> an entire subroutine description that is preceded by the "!". If it
> were not so - then there would be more elementary problems..?

No. Just because those are on following lines does not mean they are
part of thee directive. That one line is not a comment and *IS*
important. Really. The rest are actually comments.

Oh, but I see you said you are on Linux. Alas, that stuff is very
compiler-specific. As Kevin said, you'll probably need another way to
achieve the ends if you aren't using a compiler that supports the !$DEC
directives. Posting snippets from the C side might help.

Have I mentioned recently that I look forward to the C interop features
of f2003 so that this kind of thing can actually be done portably.  :-(

-- 
Richard Maine                     | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov            |       -- Mark Twain
0
nospam47 (9747)
12/1/2005 8:17:14 PM
You were right !

It was not a comment and yes..the compiler i am using does support the
!$DEC directives. However - am not having succes. I am not sure what
you were refering to "...snippets from C side". I can do so - just let
me know - if it's the C function that needs to be ultimately called
that you refer to ! :-(

<"have I mentioned recently that I look forward to the C interop
features
of f2003 so that this kind of thing can actually be done portably.  :-(
>

Me too ! ..

-AM

0
wiredashu (16)
12/1/2005 8:28:51 PM
>However - am not having succes.

When in doubt, post all error messages without editting.  Context is also useful.
0
kgrhoads (401)
12/1/2005 8:33:48 PM
Nope..no success as yet. My compiler DOES support the !DEC$ directives.
Still no luck ! The charm of being alive fading away ... :-(

-AM

0
wiredashu (16)
12/1/2005 8:34:16 PM
AM <wiredashu@gmail.com> wrote:

> It was not a comment and yes..the compiler i am using does support the
> !$DEC directives. However - am not having succes. I am not sure what
> you were refering to "...snippets from C side". I can do so - just let
> me know - if it's the C function that needs to be ultimately called
> that you refer to ! :-(

Yes, if it is reasonable enough sized to post. The "snippets" bit was to
suggest that you could probably get by with just the beginning part of
the C function if necessary. But if the whole thing is plausibly
postable, that would be better. It is presumably the METIS_NodeND
function that we are talking about.

-- 
Richard Maine                     | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov            |       -- Mark Twain
0
nospam47 (9747)
12/1/2005 8:42:33 PM
Hi Richard !
Now that i have completely lost all my dignity - may i make a
suggestion ? You mentioned you have never heard of METIS. Would it be
too much for you to actually download it and take a look ? It's a
library of Sparse matrix reordering algorithms among other things.
Available from:
http://www-users.cs.umn.edu/~karypis/metis/metis/files/metis-4.0.tar.gz

It has a users guide in there..which if you look at - will state (in
section 5.8) that there is complete support for fortran programs etc...
The function Metis_Nodend is listed in this guide.

However - this is where things get tricky. There is NO actual c file
with this name. this function is found in another c file called
"ometis.c".

Since All my problems are syntactical - so you dont even have to read
about their workings or innards. All i waiting for is to be able to
overcome this interfacing issue. 

-AM

0
wiredashu (16)
12/1/2005 9:02:19 PM
AM <wiredashu@gmail.com> wrote:

> Now that i have completely lost all my dignity

Not at all!

> http://www-users.cs.umn.edu/~karypis/metis/metis/files/metis-4.0.tar.gz

Ok. Done. Hmm. This ought to be simple. Looking at the function, I see
that all its arguments are integers (some are typedefed, but that turns
out to be integer) and passed by reference. I don't happen to be using a
compiler that supports the !$DEC stuff, so I was about to do a trivial
workaround, which should be simple for a C function like this, but...

Then I took a look at the manual on pg 43 where it mentions C and
Fortran support. It comments that they specifically did all the
arguments that way to make Fortran simple, and... I see... they already
did one of the workarounds I was planning on. Namely, they made trivial
wrapper functions with names METIS_NODEND, metis_nodend, metis_nodend_,
and metis_nodend__ (the last 2 there differ in the number of trailing
underscores). Indeed I see those functions in the file frename.c
(obviously for "Fortran renames"). That pretty much covers all the
common cases. This ought to just work, even without a compiler that
supports the !$DEC stuff. Ok.

I went over to one of my Linux boxes (RedHat 7.3), untarred the metis
library and typed make. Seemed to build. Then I did the simplest Fortran
test program I could come up with without actually having to think.  :-)
I took your posted code exactly as is, doing nothing other than fix a
few comment lines that wrapped in the posting. Then I threw the
following trivial main program in front of it, where I got the data
values from the comments in your code. I used slight editor trickery to
turn the values into valid array constructors without actually retyping
them (so as to lower the odds of typos).  Thus my main program is:

      program testmet
      implicit none
      integer, parameter :: n=15, m=22
      integer,dimension(n+1) :: node
      integer,dimension(2*m) :: link
      integer,dimension(n) :: perm, iperm
      node = (/1,3,6,9,12,14,17,21,25,29,32,34,37,40,43,45/)
      link = (/2,6,1,3,7,2,4,8,3,5,9,4,10,1,7,11,2,6, &
                8,12,3,7,9,13,4,8,10,14,5,9,15,6,12,7,11,13, &
                8,12,14,9,13,15,10,14/)

      call mnd(n, m, node, link, perm, iperm)
      write (*,*) 'perm = ', perm
      write (*,*) 'iperm = ', iperm
      end

Compiled and linked it using the NAG f90 compiler with

  f90 clf.f90 -Lmetis-4.0 -lmetis

Runs fine and gives the result

 perm =  15 5 9 4 14 10 12 2 6 1 11 7 13 8 3
 iperm =  10 8 15 4 2 9 12 14 3 6 11 7 13 5 1

which I didn't check, but sure beats a segmentation fault.

Just for kicks, did the same thing on my Mac with both the Nag and g95
compilers. That's odd. The Mac ones give different answers than the
Linux one (both Mac compilers giving the same answer). Well, I don't
think I'll try to track that one down. Doesn't look like a Fortran
interface problem anyway, as far as I can see. The stuff doesn't claim
to have been tested on OS X. Oh well.

This leaves me with two... make it three... questions about your
experience.

1. I assume that the compilation and linking did go without error?
Probably did or you wouldn't have an executable to run, but it seems
worth asking.

2. Are you sure that you have good data for the node and link arrays? I
note that the value of m doesn't get fed to the C code. Apparently it
just depends on the arrays being valid without having any handy way to
check. This seems like asking for problems where bad data causes array
bounds to be exceeded. Specifically, have you tried it with known valid
data such as the sample case in the comments (for example, using the
main program II posted above)?

3. How sure are you that the code even got to the Metis_ND invocation?
The error messages almost sound like it is still in some vsim_metis_slu
file (presumably of yours, as I don't see anything of that name in the
metis stuff. I see that your output says "Calling METIS", but I don't
see that message in either metis or in your MND subroutine. What are the
odds that you didn't yet actually get into MND sucessfully? Maybe add a
printout in it?

-- 
Richard Maine                     | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov            |       -- Mark Twain
0
nospam47 (9747)
12/1/2005 10:32:25 PM
Well that settles it...i am just lost. Ok. let me retrace my steps -
use your suggestions on the print out and then comeback.
BTW - Richard - thank you SO much for all this.. :-)

-Ash

0
wiredashu (16)
12/1/2005 10:52:30 PM
YESS ! ! !!

<ahem> so now that is done - let me highlight - what i was doing wrong
!

deallocate(isr_a,icol_a,rv_a)
call MND(i_totalnodes,size(icol_a),isr_a,icol_a,perm,iperm)
..
..

Somehow that line of deallocate was invisible to me ! AND IT WAS RIGHT
THERE ! :-( Ofcourse there were a few other errors (such as i had ...)

allocate(iperm(i_totalnodes+1),perm(i_totalnodes+1)) - which should
have been only i_totalnodes..but ...:-(

Anyway - THANK YOU SO MUCH everyone ! Now i am going to fixing the next
step with proper usage of this routine ! Apparently - there is yet
another restriction about the structure of the "link" vector that i
will need to make sure doesn't crop up.

-Ash

ps: and what is really tragic - i have been looking at this code for
the last 2 days..(this particular problem) !

0
wiredashu (16)
12/1/2005 11:35:22 PM
AM <wiredashu@gmail.com> wrote:

> YESS ! ! !!
....
> Somehow that line of deallocate was invisible to me ! AND IT WAS RIGHT
> THERE ! :-(

Been there. Done that. :-(

-- 
Richard Maine                     | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov            |       -- Mark Twain
0
nospam47 (9747)
12/1/2005 11:51:51 PM
Reply:
Similar Artilces:

char * call-by-reference problem
When I call ---->>> SetLog("WinMain", Msg("Loading %s ...", filename)); <<--- TCHAR *Msg(TCHAR *szFormat, ...) { TCHAR szBuffer[1024]=""; // Large buffer for long filenames or URLs const size_t NUMCHARS = sizeof(szBuffer) / sizeof(szBuffer[0]); const int LASTCHAR = NUMCHARS - 1; // Format the input string va_list pArgs; va_start(pArgs, szFormat); // Use a bounded buffer size to prevent buffer overruns. Limit count to // character size minus one to allow for a NULL terminating character. _vsntprintf(szBuffer...

Code and Creation 67940
This is a free and informational site I created for application development and application development source on the net. Enjoy, and it's free, nothing to register oir sign up for just an informational site. http://codeandcreation.com v^T=(vu?FwzzULVQYiF.Vr/$x ...

Re: call execute crashing #6
hi ... having done this before, it's neat to see other approaches ... this skips both CALL EXECUTE and PROC SQL, but does use PROC DATASETS (as recommended by Richard) ... another idea, * data set with ODD names; data odd; retain qq ww ee rr tt yy .; stop; run; * put the ODD names into a data set; title 'OLD NAMES AND LABELS'; proc contents data=odd out=oddc (keep=name); ods select variables; run; * use a data step to write RENAME and LABEL statements; filename r temp; filename l temp; data _null_; set oddc; file r; put 'rename ' name '= indu' _n_ ';'; ...

FAQ 8.20 How can I call my system's unique C functions from Perl? #4 1201810
This is an excerpt from the latest version perlfaq8.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 8.20: How can I call my system's unique C functions from Perl? In most cases, you write an external module to do it--see the answer to "Where can I learn about linking C with Perl? [h2xs, xsubpp]". How...

Recursive calls with Ellipses
I'm trying to write a wrapper functions for a function that uses the stdarg.h ellipses notation for variable arguments. In essense, if the original function is: void foo(int n, ...){ //body } I want to write a function like: void foo_wrapper (int n, ...){ //some stuff foo(n, ##SOMETHING##); //some other stuff } Where the ##SOMETHING## is exactly what satisfied the "...". How do I do this? I tried naively giving "foo" a va_list, but that lead to some fun segmentation errors. Any other thoughts? -- comp.lang.c.moderated - mo...

Huffman Code #2
Hi, I need a matlab program that generate the Huffman codewords of a set of symbols if their properties are known.. thanx On 8 Apr 04 14:56:45 -0400 (EDT), rosy wrote: >Hi, >I need a matlab program that generate the Huffman codewords of a set >of symbols if their properties are known.. >thanx Hi rosey you can find mfiles about huffman codding &de-codding in follow link http://www.cs.wright.edu/~fdgarber/740/default.html good luck Ahmad ...

Amazon api
i've used the Amazon PHP api for several months now to pull amazon data into my affiliate site - but recently i'm starting to get "call to undefined function" errors " Fatal error: Call to undefined function: asinsearchrequest() in" What's strange is that problem is intermittent - and there is no way to reproduce it exactly - it just appears to come and go. I'm using nusoap as well. Whilst googling around , i noticed another site has a similar issue: http://film.de/shophomecinema.php if the page appears normally, just refresh a few times to get the amaz...

OUT param in Function called from JDBC
Hi I am having a problem with a PLSQL function I want to call through JDBC. The function has two OUT params and also returns a ref cursor. FUNCTION FCN_GET_WP(p_policy_ref IN VARCHAR2, p_date IN DATE, p_success OUT NUMBER, p_error_desc OUT VARCHAR) RETURN WP_REF_CURSOR; I am calling it like this in the Java code: cs = connection.prepareCall("? = call FCN_GET_WP(?,?,?,?)"); // set the ref cursor to be the fi...

Beta Testers called
Hi, We are looking for beta testers to test our product, PrintTuner. PrintTuner is available for download from http://www.graphicshighway.com Do contact me for knowing more details of the product. As a gesture, a beta tester would receive a license in exchange for their efforts. Thanks Graphicshighway Team ...

Call for Papers: Special Track on Applied Cryptology and Network Security (STACNS), USA, July 2008 #2
Special Track on Applied Cryptology and Network Security (STACNS) July 14-17, 2008, Las Vegas, USA A number of Special Sessions on Applied Cryptology and Network Security will be organized within the 2008 International Conference on Security and Management (SAM'08), July 14-17, 2008, Monte Carlo Resort, Las Vegas, USA. This conference is an annual meeting on quality papers focusing on the latest developments in security. The goal of these sessions is to explore the research work of graduate students, and junior faculty/researchers. Topics of Interest Topics of interest include, but ar...

OT: Now that's what I *call* a "Fly-Mo"
http://www.jumpingpixels.com/747lawn.html -- K. http://slated.org - Slated, Rated & Blogged This message has not been photoshopped in any way. Fedora Core release 5 (Bordeaux) on sky, running kernel 2.6.16-1.2133_FC5 06:34:25 up 26 days, 6:51, 2 users, load average: 1.45, 1.35, 1.29 __/ [ [H]omer ] on Friday 14 July 2006 06:36 \__ > http://www.jumpingpixels.com/747lawn.html Sh*t. I can no longer argue that Vista will will ship when lawn mowers fly. It was on Friday 14 July 2006 11:09 am, that Roy Schestowitz apparently said: > __/ [ [H]omer ] on Friday 14 July 2006 06:36 ...

Make outgoing call
On a Cisco AS5300 how can I go about making an outgoing test call on a PRI? Do you mean a voice call? If so try "csim start <what ever number you want to dial>" Matt <spammers@are.bad.com> wrote in message news:<cbekev02ii8@enews3.newsguy.com>... > On a Cisco AS5300 how can I go about making an outgoing test call on a PRI? ...

Call for Papers Reminder (extended): The World Congress on Engineering WCE 2014
Call for Papers Reminder (extended): The World Congress on Engineering WCE 2014 From: International Association of Engineers (IAENG) Draft Paper Submission Deadline (extended): 14 March, 2014 Camera-Ready papers & Registration Deadline: 31 March, 2014 WCE 2014: London, U.K., 2-4 July, 2014 http://www.iaeng.org/WCE2014 The WCE 2014 is organized by International Association of Engineers (IAENG), a non-profit international association for the engineers and the computer scientists. The congress has the focus on the frontier topics in the theoretical and applied engineering and...

driving_site and local function call
oracle 10G R2: I've got this query accessing a lot of remote data via database link. Therefore hint DRIVING_SITE is used to make the query happen on the remote server. Now I've done a change, I call a local package function, which makes the hint being ignored. The query looks something like this select /*+DRIVING_SITE(table1) */ <col1>, ... , local_package.myfunc() from table1@remotedb inner join table2@remotedb on <join condition> ... When I comment the function call everything works as excpected, but when the function call is uncommented the ...

mex - matlab calls fortran which calls matlab which calls fortran
Dear All, I'm trying to link matlab and fortran with mex files and engine matlab, in linux OS. My general purpose is the following: 1) a matlab script A calls a mex function B based upon fortran source code 2) mex function B calls another function in matlab C within matlab engine 3) matlab routine C calls another mex file in fortran D While i'm able to do steps 2) and 3), I can't do step 1). Before to show the code, please reply to this simple question: Is it possible to build the overall process 1-3? On 8 Okt, 16:37, "Michele Catalano" <cata...@yahoo.it> wr...

European Grid Conference : EGC2005
European Grid Conference 2005 http://genias.biz/egc2005 February 14 - 16, 2005, Amsterdam Science Park Amsterdam, The Netherlands =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Call for: - Papers in scientific track - Proposals for industrial events - Proposals for special events =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= The European Grid Conference EGC2005 is the premier event on Grid Computing in Europe. It will focus on all aspects of Grid computing in Europe and a such will bring together participants from research and industry. EGC 2005 is a follow-up of the AcrossGrids Conferences...

Re: Calling program and called program #5
Personally speaking I wouldn't write code this way to update records. My method would be: PROCEDURE DIVISION. ..... ..... PERFORM UPDATE-PARA thru UPDATE-PARA-EXIT. close files here... STOP RUN. UPDATE-PARA. CALL "DBLOCK" using ..... if code not = 0 display error go to UPDATE-PARA-EXIT end-if. CALL "DBFIND" using .... if code = 17 go to UPDATE-PARA-EXIT end-if. if code not = 0 display error go to UPDATE-PARA-EXIT end-if. if chain-length = 0 go to UPDATE-PARA-EXIT end-if. perform DBGET-para thru DBGET-para-exit. CAL...

[News] Mac Software Nicks Linux-y Code
Parallels Desktop for Mac ,----[ Quote ] | Parallels Desktop for Mac(www.parallels.com) contains Wine’s Direct3D code | according to http://www.parallels.com/en/licensing/. So far(June 30th, 2007) | attempts to ask them for the modified source code failed. This page is meant | for keeping track of this, without starting legal action or a publicity | campaign yet. `---- http://wiki.winehq.org/Parallels Earlier today: Apple hates Linux users ,----[ Quote ] | So, if you think that the iPhone is such as revolutionary device, then I | think it is time that Linux users unite and ask ...

Getting a trigger to call a function...
I'm trying to get a trigger to call a function, without success. Could someone please direct me to some documentation that would help. The trigger is called CUpdate() and on the Schema "CIS-Live" The function is called Log(<some parameters>) and is on the Schema "Logging" thanks, graeme. ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing li...

Fortran Resources (August 2004)
********************************************************************* Information file, on compilers, tools, books, courses, tutorials, and the standard for the Fortran language and its derivatives. This file can be viewed too at http://www.fortran.com/metcalf.htm Additional information on Fortran is available at http://www.fortran.com, http://www.fortranlib.com/ and http://www.dmoz.org/Computers/Programming/Languages/Fortran/ You can join an active Fortran discussion group by going to http://www.jiscmail.ac.uk/lists/comp-fortran-90.html. ***********************************...

called macros
Does anyone have some suggestions as to the neatest way to achieve the following? What I want is a list of all macros called by a suite of programs that has run. The programs run independently (i.e. not one long sas program composed of "included" other programs). If it did run as one long job then I could do a read of the work libraries or sashelp.macros or whatever to see what macros were in storage. But because this is run as separate jobs this is not so convenient. I do not want the macros writing a message to the log as some of them will be called perhaps hundreds of times and I...

matlab hangs when interactive system(...) call
Hi to all, in *.m file I'm calling [status, message] = system('program') 'program' asks for password but if I use above format it hangs if I'm calling it so: [status] = system(...) - it works fine, but I really need "message" text. ...

Re: 1xx exchange in area code 212? [telecom]
In article <f--dnX9KH4yuHz3InZ2dnUU7-V2dnZ2d@posted.internetamerica> you write: >> It had the telephone number 212-165-8220. >.... >> Exchange 165? I gather that 1XX pseudo-prefixes have been used for leased lines and stuff like that, so even in areas with all 10D or 1+10D dialing, they still don't use them. Ditto 0XX prefixes. Making them available is called clearing the D digit, which isn't planned to happen until after they expand the NANP, which currently isn't expected until sometime after 2045. (As described below, they need to use 0 and...

CFP: Deadline Extension -- Call for Papers CAIA 2010
Dear Colleagues, due to several requests, we extended the submission deadline for CAIA 2010 to August 1, 2010. Please consider submission of good papers, and position papers. Best regards, Stefan Mandl ________________________________________________ Dr.-Ing. Stefan Mandl, Dept. CS-8, Univ. Erlangen-Nuremberg http://www8.informatik.uni-erlangen.de/inf8/en/mandl.html ======================================================================== CALL FOR PAPERS: CAIA 2010 -- Context Aware Intelligent Assistance Workshop held at the 33th Annual Conference on Artificial Intelligence (KI-2010) ...

Calling a VB component
I'm used to writing fairly simple perl code to carry out database administration functions and reporting functions. However, I'd like to be able to call a windows VB component from a perl script. I've spent a couple of hours looking on the perl FAQs and newsgroups without finding anything. Is this possible ? If so I'd appreciate a few pointers and even an example. TIA Laurence Tony Phillips wrote: > I'm used to writing fairly simple perl code to carry out database > administration functions and reporting functions. However, I'd like to > be able...