Menu

Problems with PyPDQ: CreateMultiNode

Help
Anonymous
2011-10-17
2013-04-26
  • Anonymous

    Anonymous - 2011-10-17

    I'm trying to use PyPDQ to create a simple multi-processor node, but I get a mysterious error message if I set the processor count higher than 20.

    Here is my code:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    #!/usr/bin/python
    import pdq
    pdq.SetDebug(1)
    processors  = 72
    arrivalRate = 10.5 # jobs per sec
    serviceTime  = 2.0  # sec
    pdq.Init("Test Code")
    s = pdq.CreateOpen("Txns", arrivalRate)
    n = pdq.CreateMultiNode(processors, "Node", pdq.CEN, pdq.FCFS)
    pdq.SetDemand("Node", "Txns", serviceTime)
    pdq.SetWUnit("Txns")
    pdq.SetTUnit("Sec")
    pdq.Solve(pdq.CANON)
    pdq.Report()
    

    And this is the resulting error:

    debug on
    DEBUG: PDQ_Init()
            Entering
            Exiting
            Stream[0]:  TRANS       "Txns"; Lambda: 10.5
    DEBUG: PDQ_CreateMultiNode
            Entering
    ERROR in procedure 'typetostr()': Unknown type id for ""
    

    If I set

    processors = 20
    

    or lower, the error message goes away and changes to one of the following:

    ERROR in procedure 'canonical()':
    Arrival rate 10.500 for stream 'Txns' exceeds saturation thruput 10.000 of node 'Node' with demand 0.100
    

    or

    ERROR in procedure 'ErlangR()': Erlang R: 2.0000
    

    Can anyone tell me what I'm doing wrong?

     
  • Anonymous

    Anonymous - 2011-10-18

    The 2nd error msg refers to the fact that you can't have fewer servers (20) than the total traffic intensity: arrivalRate* serviceTime = 21 because each server would be oversaturated at 100%. Since that would could numerical bogosity, PDQ bails.

    The 1st error looks like a string handling bug in the C code.

     
  • Anonymous

    Anonymous - 2011-10-18

    The original parameters work in PDQ-R:

    library(pdq)
    processors <- 72
    arrivalRate <- 10.5
    serviceTime <- 2.0
    Init("Test Code")
    CreateOpen("Txns", arrivalRate)
    CreateMultiNode(processors, "Node", CEN, FCFS)
    SetDemand("Node", "Txns", serviceTime)
    SetWUnit("Txn")
    SetTUnit("Sec")
    Solve(CANON)
    Report()
    

    Produces:

    ***************************************
                    ****** Pretty Damn Quick REPORT *******
                    ***************************************
                    ***  of : Tue Oct 18 11:56:44 2011  ***
                    ***  for: Test Code                 ***
                    ***  Ver: PDQ Analyzer v5.0 030211  ***
                    ***************************************
                    ***************************************

                    =======================================
                    ******    PDQ Model INPUTS      *******
                    =======================================

    Node Sched Resource   Workload   Class     Demand
    --- --- -----   -----   ---     ----
    72  MSQ   Node       Txns       TRANS     2.0000

    Queueing Circuit Totals:
            Streams:      1
            Nodes:        1

    WORKLOAD Parameters:
    Txns          10.5000        2.0000

                    =======================================
                    ******   PDQ Model OUTPUTS      *******
                    =======================================

    Solution Method: CANON

                    ******   SYSTEM Performance     *******

    Metric                     Value    Unit
    ----                     ---    ---
    Workload: "Txns"
    Number in system         21.0000    Txn
    Mean throughput          10.5000    Txn/Sec
    Response time             2.0000    Sec
    Stretch factor            1.0000

    Bounds Analysis:
    Max throughput           36.0000    Txn/Sec
    Min response              2.0000    Sec

                    ******   RESOURCE Performance   *******

    Metric          Resource     Work              Value   Unit
    ----          -----     ---              ---   ---
    Throughput      Node         Txns            10.5000   Txn/Sec
    Utilization     Node         Txns            29.1667   Percent
    Queue length    Node         Txns             0.2917   Txn
    Waiting line    Node         Txns             0.0000   Txn
    Waiting time    Node         Txns             0.0000   Sec
    Residence time  Node         Txns             2.0000   Sec

    This suggests that there might be a problem with the SWIG conversion of pdq.CreateMultiNode.

     
  • Anonymous

    Anonymous - 2011-10-19

    So it turns out that if I turn debugging off, the first error message goes away. Which is … fantastic.

    I guess it is a problem with the SWIG conversion in general, but for now, I've just turned debugging off and put in my own code to trace through execution. Thanks guys. :)

     

Log in to post a comment.