Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Fortran Programming Language

bindprocessor


Hi,

Tricky question, I'm not sure if this is the right place for it, but anyway:

I'm trying to run a Fortran 90 MPI program under AIX, and I want to call the
'bindprocessor()' routine to prevent each process from moving between
processors by the system.  The theory is that it'll perform better by getting
better cache use, etc.  This is on a 16-processor machine, I'm aiming to use
15/16 processors, and allow the 16th processor to handle system stuff (NFS,
etc).

Anyway, the the problem is, I don't know how to call "bindprocessor()" from
fortran - it seems that you can only call it from C.

http://www.ncsa.uiuc.edu/UserInfo/Resources/Hardware/IBMp690/IBM/usr/...
info/en_US/a_doc_lib/libs/basetrf1/bindprocessor.htm

Any thoughts?

F90 Man

On 11 apr, 14:10, F90_@hotmail.com (F90_Man) wrote:

Most of the arguments are ints which map to integers. The
last one is of type cpu_t (that may be an integer too, I do not
know). You would have to write a small wrapper in C, like:

void bindprocessor_( int *what, int *who, int *where ) {
    cpu_t really_where ;
    ... convert where to really_where - depends on the actual type
    bindprocessor( *what, *who, really_where ) ;

}

And call that from Fortran:

    call bindprocessor( what, who, where )

(note the _ - a common decoration from the Fortran compiler,
but not universal)

(I will leave out all the fun bits, like compiling and linking
it into your program)

Regards,

Arjen

As if by magic, Arjen Markus appeared !

Which you do not need on IBMs, unless you use the -qextname flag.
However the latter implies that you are either mad, or soon will be.
I suggest that you avoid it, but than again it's your sanity.

However IBM also supports the F2003 C-interoperability stuff which
could be used here. However there is one very slight problem that
Arjen alludes to, the habit in C header files of typedeffing
different sorts of int to whatever is required, cpu_t being the
example here. Any suggestions of how best to integrate it with
C interoperability given that the  size required for a cpu_t
on this system might not be available for a Fortran integer on another.
I realize  that once you get this close to the OS portability is
problematic, but a good way to access such things as POSIX functionality
would be nice,

Ian

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc