Changeset 665


Ignore:
Timestamp:
Apr 6, 2007 6:06:24 PM (14 years ago)
Author:
dkearney
Message:

Updates to Rappture::Utils::progress for all languages
removed the dependancy on Rappture.Units from within number.py, it should only depend on Rappture which will include Rappture.Units
added Rappture.Units as a module to load when people import Rappture in python.
added -V pbs variable to queue.py to include qsub environment variables in the submitted job.
updated setup.py.in to install Rappture.Utils
added progress bar to all app-fermi examples showing how to use the Rappture::Utils::progress function in all languages.
added destructor definitions to Node classes in src2/core

Location:
trunk
Files:
3 added
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/app-fermi/cee/fermi.c

    r555 r665  
    1717#include <stdio.h>
    1818#include <math.h>
     19#include <unistd.h>
    1920
    2021int main(int argc, char * argv[]) {
     
    8889        f = 1.0/(1.0 + exp((E - Ef)/kT));
    8990        sprintf(line,"%f %f\n",f, E);
     91        rpUtilsProgress((int)((E-Emin)/(Emax-Emin)*100),"Iterating");
    9092        rpPutString(lib,"output.curve(f12).component.xy", line, RPLIB_APPEND);
    9193        E = E + dE;
  • trunk/examples/app-fermi/fortran/fermi.f

    r555 r665  
    1919        integer rp_lib, rp_units_convert_dbl
    2020
    21         integer driver, ok
     21        integer driver, ok, progress
    2222        double precision T, Ef, kT, Emin, Emax, dE, f, E
    2323        CHARACTER*100 inFile, strVal
     
    5555        do 10 E=Emin,Emax,dE
    5656          f = 1.0/(1.0+exp((E-Ef)/kT))
     57          progress = nint((E-Emin)/(Emax-Emin)*100)
     58          call rp_utils_progress (progress,"Iterating")
    5759          write(xy,'(E20.12,F13.9,A)') f, E, char(10)
    5860          call rp_lib_put_str (driver,
  • trunk/examples/app-fermi/matlab/fermi.m

    r521 r665  
    88%  AUTHOR:  Michael McLennan, Purdue University
    99%  AUTHOR:  Derrick Kearney, Purdue University
    10 %  Copyright (c) 2004-2005  Purdue Research Foundation
     10%  Copyright (c) 2004-2007  Purdue Research Foundation
    1111%
    1212%  See the file "license.terms" for information on usage and
     
    4747
    4848for j=1:200
     49  rpUtilsProgress((j/200*100),'Iterating');
    4950  putStr = sprintf('%12g  %12g\n', f(j), E(j));
    5051  % put the data into the xml file
  • trunk/examples/app-fermi/octave/fermi.m

    r165 r665  
    4242
    4343for j=1:200
     44  rpUtilsProgress((j/200*100),'Iterating');
    4445  putStr = sprintf('%12g  %12g\n', f(j), E(j));
    4546  % put the data into the xml file
  • trunk/examples/app-fermi/perl/fermi.pl

    r555 r665  
    4141while( $E < $Emax ) {
    4242        $f = 1.0 / ( 1.0 + exp(($E - $Ef) / $kT));
     43    Rappture::Utils::progress((($E-$Emin)/($Emax-$Emin)*100),"Iterating");
    4344        $driver->put("output.curve(f12).component.xy", "$f $E\n", 1);
    4445        $E = $E + $dE;
  • trunk/examples/app-fermi/python/fermi.py

    r555 r665  
    1212# ======================================================================
    1313import Rappture
    14 import Rappture.Units
    1514import sys
    1615from math import *
     
    4645    f = 1.0/(1.0 + exp((E - Ef)/kT))
    4746    line = "%g %g\n" % (f, E)
     47    Rappture.Utils.progress(((E-Emin)/(Emax-Emin)*100),"Iterating")
    4848    driver.put('output.curve(f12).component.xy', line, append=1)
    4949    E = E + dE
  • trunk/examples/app-fermi/tcl/fermi.tcl

    r555 r665  
    66# ======================================================================
    77#  AUTHOR:  Michael McLennan, Purdue University
    8 #  Copyright (c) 2004-2005  Purdue Research Foundation
     8#  Copyright (c) 2004-2007  Purdue Research Foundation
    99#
    1010#  See the file "license.terms" for information on usage and
     
    3737while {$E < $Emax} {
    3838    set f [expr {1.0/(1.0 + exp(($E - $Ef)/$kT))}]
     39    set progress [expr {(($E - $Emin)/($Emax - $Emin)*100)}]
     40    Rappture::Utils::progress $progress -mesg "Iterating"
    3941    $driver put -append yes output.curve(f12).component.xy "$f $E\n"
    4042    set E [expr {$E + $dE}]
  • trunk/perl/Rappture.xs

    r605 r665  
    1 #include "RpLibrary.h"
    2 #include "RpUnits.h"
     1#include "rappture.h"
    32#include <string>
    43
     
    8685        OUTPUT:
    8786                RETVAL
     87
     88MODULE = Rappture               PACKAGE = Rappture::Utils
     89
     90int
     91progress( percent, message )
     92int percent
     93const char *message
     94        CODE:
     95                RETVAL = Rappture::Utils::progress(percent,message);
     96        OUTPUT:
     97                RETVAL
  • trunk/python/Rappture/PyRpUnits.cc

    r570 r665  
    498498};
    499499
    500 PyDoc_STRVAR(module_doc, "RpUnits Module for Python.");
     500PyDoc_STRVAR(module_doc, "Rappture Units Module for Python.");
    501501
    502502/* Initialization function for the module */
  • trunk/python/Rappture/__init__.py

    r535 r665  
    66import queue as queue
    77import tools as tools
     8import Units
     9import Utils
  • trunk/python/Rappture/number.py

    r115 r665  
    1010# ======================================================================
    1111import Rappture
    12 import Rappture.Units
    1312
    1413class number:
  • trunk/python/Rappture/queue.py

    r579 r665  
    294294#PBS -mn
    295295#PBS -N %s
     296#PBS -V
    296297cd $PBS_O_WORKDIR
    297298
  • trunk/python/setup.py.in

    r548 r665  
    33rp_install_dir = '@prefix@'
    44
    5 module = Extension('Rappture.Units',
     5units_module = Extension('Rappture.Units',
    66                   include_dirs = [rp_install_dir+'/include'],
    77                   sources = [ 'Rappture/PyRpUnits.cc' ],
    88                   library_dirs = [ rp_install_dir+'/lib' ],
    99                   libraries = [ 'rappture', 'scew' ] )
     10
     11utils_module = Extension('Rappture.Utils',
     12                   include_dirs = [rp_install_dir+'/include'],
     13                   sources = [ 'Rappture/PyRpUtils.cc' ],
     14                   library_dirs = [ rp_install_dir+'/lib' ],
     15                   libraries = [ 'rappture' ] )
    1016
    1117setup(  name='Rappture',
     
    2026                     'Rappture.tools',
    2127                     'Rappture.result'],
    22         ext_modules=[module]
     28        ext_modules=[   units_module,
     29                        utils_module    ]
    2330  )
  • trunk/src/cee/RpUtilsCInterface.cc

    r656 r665  
    2020
    2121int
    22 rpProgress (int percent, const char* text)
     22rpUtilsProgress (int percent, const char* text)
    2323{
    24     return Rappture::progress(percent,text);
     24    return Rappture::Utils::progress(percent,text);
    2525}
    2626
  • trunk/src/cee/RpUtilsCInterface.h

    r656 r665  
    2020#endif // ifdef __cplusplus
    2121
    22 int rpProgress (int percent, const char* text);
     22int rpUtilsProgress (int percent, const char* text);
    2323
    2424
  • trunk/src/core/RpUtils.cc

    r656 r665  
    1919#endif // ifdef __cplusplus
    2020
    21 using namespace Rappture;
     21using namespace Rappture::Utils;
    2222
    2323int progress(int percent, const char* text)
  • trunk/src/core/RpUtils.h

    r656 r665  
    1818extern "C" {
    1919namespace Rappture {
     20    namespace Utils {
    2021#endif // ifdef __cplusplus
    2122
     
    2526
    2627#ifdef __cplusplus
     28    } // namespace Utils
    2729} // namespace Rappture
    2830} // extern C
  • trunk/src/fortran/RpUtilsFInterface.cc

    r656 r665  
    2222
    2323/**********************************************************************/
    24 // FUNCTION: rp_progress(int percent, const char* text, int text_len)
     24// FUNCTION: rp_utils_progress(int percent, const char* text, int text_len)
    2525/// Report the progress of the application.
    2626/**
    2727 */
    2828
    29 int rp_progress(int* percent, char* text, int text_len)
     29int rp_utils_progress(int* percent, char* text, int text_len)
    3030{
    3131    int retVal = 1;
     
    3333    inText = null_terminate(text, text_len);
    3434    if (inText != NULL) {
    35         retVal = Rappture::progress(*percent,inText);
     35        retVal = Rappture::Utils::progress(*percent,inText);
    3636        free((void*)inText);
    3737    }
  • trunk/src/fortran/RpUtilsFInterface.h

    r656 r665  
    2020#endif // ifdef __cplusplus
    2121
    22 int rp_progress ( int* percent, char* text, int text_len );
     22int rp_utils_progress ( int* percent, char* text, int text_len );
    2323
    2424
  • trunk/src/fortran/RpUtilsFStubs.c

    r656 r665  
    1919
    2020int
    21 rp_progress_ ( int* percent, char* text, int text_len ) {
    22     return rp_progress (percent,text,text_len);
     21rp_utils_progress_ ( int* percent, char* text, int text_len ) {
     22    return rp_utils_progress (percent,text,text_len);
    2323}
    2424
    2525int
    26 rp_progress__ ( int* percent, char* text, int text_len ) {
    27     return rp_progress (percent,text,text_len);
     26rp_utils_progress__ ( int* percent, char* text, int text_len ) {
     27    return rp_utils_progress (percent,text,text_len);
    2828}
    2929
    3030int
    31 RP_PROGRESS ( int* percent, char* text, int text_len ) {
    32     return rp_progress (percent,text,text_len);
     31RP_UTILS_PROGRESS ( int* percent, char* text, int text_len ) {
     32    return rp_utils_progress (percent,text,text_len);
    3333}
    3434
  • trunk/src/fortran/RpUtilsFStubs.h

    r656 r665  
    2020// INTERFACE FUNCTIONS - ONE UNDERSCORE
    2121
    22 int rp_progress_ ( int* percent, char* text, int text_len );
     22int rp_utils_progress_ ( int* percent, char* text, int text_len );
    2323
    2424
     
    2626// INTERFACE FUNCTIONS - TWO UNDERSCORES
    2727
    28 int rp_progress__ ( int* percent, char* text, int text_len );
     28int rp_utils_progress__ ( int* percent, char* text, int text_len );
    2929
    3030
     
    3232// INTERFACE STUB FUNCTIONS - ALL CAPS
    3333
    34 int RP_PROGRESS ( int* percent, char* text, int text_len );
     34int RP_UTILS_PROGRESS ( int* percent, char* text, int text_len );
    3535
    3636
  • trunk/src/matlab/Makefile.in

    r597 r665  
    7676                        rpUnitsConvertDbl.mexglx \
    7777                        rpUnitsConvertObjDbl.mexglx \
    78                         rpAddPresets.mexglx
     78                        rpAddPresets.mexglx \
     79                        rpUtilsProgress.mexglx
    7980
    8081
     
    158159rpAddPresets.mexglx:
    159160        $(MEX) rpAddPresets.cc            $(MATLAB_COMP_ARGS)
     161rpUtilsProgress.mexglx:
     162        $(MEX) rpUtilsProgress.cc         $(MATLAB_COMP_ARGS)
    160163
    161164docs:
  • trunk/src/matlab/RpMatlabInterface.h

    r511 r665  
    1515#define _Rp_MATLAB_HELPER_H
    1616
     17#include "rappture.h"
    1718#include "RpBindingsDict.h"
    18 // #include "RpLibraryCInterface.h"
    19 #include "RpUnits.h"
    20 #include "RpLibrary.h"
    2119
    2220// dont delete this, still working on making it happen
  • trunk/src/octave/Makefile.in

    r591 r665  
    3939OCTAVE_COMP_ARGS = $(OCT_INCLS) $(LIB_RAPPTURE) $(LIB_SCEW_FLAG)
    4040RpOctave:       rpAddPresets.oct \
     41                        rpUtilsProgress.oct \
    4142                        rpLib.oct \
    4243                        rpLibChildrenByType.oct \
     
    6970                        rpUnitsGetExponent.oct \
    7071                        rpUnitsGetUnits.oct \
    71                         rpUnitsGetUnitsName.oct \
     72                        rpUnitsGetUnitsName.oct
    7273
    7374rpAddPresets.oct:
    7475        $(OCT) rpAddPresets.cc            $(OCTAVE_COMP_ARGS)
     76rpUtilsProgress.oct:
     77        $(OCT) rpUtilsProgress.cc         $(OCTAVE_COMP_ARGS)
    7578rpLib.oct:
    7679        $(OCT) rpLib.cc                   $(OCTAVE_COMP_ARGS)
  • trunk/src/octave/RpOctaveInterface.h

    r511 r665  
    11/*
    22 * ----------------------------------------------------------------------
    3  *  INTERFACE: Rappture-Matlab Bindings Header
     3 *  INTERFACE: Rappture-Octave Bindings Header
    44 *
    55 * ======================================================================
    66 *  AUTHOR:  Derrick Kearney, Purdue University
    7  *  Copyright (c) 2005
     7 *  Copyright (c) 2005-2007
    88 *  Purdue Research Foundation, West Lafayette, IN
    99 * ======================================================================
     
    1313#define _Rp_OCTAVE_HELPER_H
    1414
     15#include "rappture.h"
    1516#include "RpBindingsDict.h"
    16 #include "RpLibrary.h"
    17 #include "RpUnits.h"
    1817
    19 // dont delete this, still working on making it happen
    20 //#include "rappture.h"
    21 
    22 // include the matlab api header
     18// include the octave api header
    2319#include "octave/oct.h"
    2420
     
    2723#endif
    2824
    29 //    int     getIntInput     ( const mxArray* prhs );
    30 //    double  getDoubleInput  ( const mxArray* prhs );
    31 //    char*   getStringInput  ( const mxArray* prhs );
    32 
    3325#ifdef __cplusplus
    3426}
  • trunk/src/tcl/src/RpUtilsTclInterface.cc

    r662 r665  
    5353{
    5454
    55     Tcl_CreateCommand(interp, "::Rappture::progress",
     55    Tcl_CreateCommand(interp, "::Rappture::Utils::progress",
    5656        RpTclUtilsProgress, (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
    5757
     
    100100    }
    101101
    102     err = Rappture::progress((int)val,mesg);
     102    err = Rappture::Utils::progress((int)val,mesg);
    103103
    104104    if (err != 0) {
  • trunk/src2/core/RpBuffer.cc

    r657 r665  
    124124/**
    125125 * Operator +
    126  * @param SimpleBuffer object to add
    127126 * @param SimpleBuffer object to add
    128127 */
  • trunk/src2/core/RpNode.h

    r657 r665  
    3232    virtual int dimensionality() const = 0;
    3333
    34     virtual ~Node();
     34    virtual ~Node() {}
    3535
    3636private:
     
    4747    virtual double x(double newval) { _x = newval; return _x; }
    4848
    49     virtual ~Node1D();
     49    virtual ~Node1D() {}
    5050
    5151private:
     
    6565    virtual double y(double newval) { _y = newval; return _y; }
    6666
    67     virtual ~Node2D();
     67    virtual ~Node2D() {}
    6868
    6969private:
     
    8686    virtual double z(double newval) { _z = newval; return _z; }
    8787
    88     virtual ~Node3D();
     88    virtual ~Node3D() {}
    8989
    9090private:
Note: See TracChangeset for help on using the changeset viewer.