06-30-2013 07:40 PM
I'm trying to configure Symmetric Multi-Processing on a PXI controller that has 2 CPUs. I verify the number of CPUs by using RT Get Number of CPUs (it gives me 2). I wire an array constant to the RT Set CPU Pool Assignments function, and create a 2-element array with System and Reserved as the two values (to assign one CPU for my Timed Loop and the other for "everything else").
This works, meaning it seems to do the assignment. But if I look at the Error Line from the Set CPU Pool Assignments, it returns -2231, "Invalid CPU pool settings. Each pool must contain at least 1 CPU."
I'm not sure what this means, nor why I'm getting the error (I could just "ignore" it, but if the error is "real", that doesn't make sense to do). The input to the Set CPU Pool Assignment is described in the docs as "an array of enums, with one entry for each CPU". To me that means 2 entries, which is what I have.
Does anyone have a rational explanation of what is going on? Is this a bug? Is the documentation wrong? I've attached the Front Panel (showing # of CPUs and the Error output) and the (very simple) Block Diagram.
Bob Schor
Solved! Go to Solution.
07-01-2013 09:12 AM
Hi Bob,
Thanks for posting this on the forums. I'll start working on reproducing this on my end and let you know what I come up with.
Regards,
07-02-2013 11:03 AM
Hi Bob,
So it looks like an RT system needs a default of at least 1 CPU (for both System and Timed Structures). In this case because you have 2 CPUs you'll need at least 1 CPU set for System and Timed Structures, then you can set the second one to reserved for use in the timed structures of your choosing. With that in mind it looks like this is expected behavior. Does this answer your question?
Best Regards,
07-02-2013 01:51 PM
Thanks, Bobby.
I very carefully re-read the Help Note "Specifying the Set of CPUs Available for Automatic Load Balancing". Now that I know the "correct answer", I can interpret what is written as it is intended, but it is not easy!
It is also curious that, although the earlier example generated Error -2231, if one cleared the error (or never wired the Error line), the function did, in fact, assign both the System and Timed Structures Pool to CPU0 (I have some "real" test code that shows CPU0 with Timed Structures cycles). Given that the function "does the right thing" even if you specify "wrong" parameters, maybe this should be treated as a Warning, not an Error (or else make it a "real" error that assigns nothing to a pool -- it also wouldn't hurt to have a less obscure Error Message, or more explicit "Be sure to have at least one CPU explicitly assigned to each of System and Timed Structures Pools", perhaps in Bold.
This code has no errors:
I hereby give you Credit for the "Solution", but am going to tag my reply as the Solution because it has a picture to help any readers who are puzzled by the question and our answers.