I'm not sure how to use the physical IDs that I've retrieved from hwloc. For example, I see the following, but if I place rank 0=10.0.2.4 slot=1:8 in the rankfile I get an error that 8 does not exist. However, rank 0=10.0.2.4 slot=1:p8 runs with no problem, but I don't know if I've referenced PU#8 or Core P#8. How do I bind to either a specific core or a specific hardware thread using the rankfile? Is there some way that I can debug this?
[hamiltont#4 latency]$ hwloc-ls -p
Machine (36GB)
NUMANode P#0 (18GB) + Socket P#1 + L3 (12MB)
L2 (256KB) + L1 (32KB) + Core P#0
PU P#0
PU P#12
L2 (256KB) + L1 (32KB) + Core P#1
PU P#2
PU P#14
L2 (256KB) + L1 (32KB) + Core P#2
PU P#4
PU P#16
L2 (256KB) + L1 (32KB) + Core P#8
PU P#6
PU P#18
L2 (256KB) + L1 (32KB) + Core P#9
PU P#8
PU P#20
L2 (256KB) + L1 (32KB) + Core P#10
PU P#10
PU P#22
NUMANode P#1 (18GB) + Socket P#0 + L3 (12MB)
L2 (256KB) + L1 (32KB) + Core P#0
PU P#1
PU P#13
L2 (256KB) + L1 (32KB) + Core P#1
PU P#3
PU P#15
L2 (256KB) + L1 (32KB) + Core P#2
PU P#5
PU P#17
L2 (256KB) + L1 (32KB) + Core P#8
PU P#7
PU P#19
L2 (256KB) + L1 (32KB) + Core P#9
PU P#9
PU P#21
L2 (256KB) + L1 (32KB) + Core P#10
PU P#11
PU P#23
I see this question as pretty close to what I'm asking, but not quite the same.
So there is a PU numbered 23, but no core with this number, so if there is an error referencing number 23 then MPI is trying to get a core.
# No errors, so this is referencing a PU
rank 1=10.0.2.4 slot=1:p23
# No errors, so we are referencing a PU
rank 1=10.0.2.4 slot=p1:p23
# Error! We might be referencing a core
rank 1=10.0.2.4 slot=p1:23
# No error, we are probably referencing physical socket 1 and physical core 8
rank 1=10.0.2.4 slot=p1:8
Related
T(p,q) transforms the pair (a,b) according to a <-- bq + aq + ap and b <-- bp + aq.
Can someone explain how this transformation works?
Just as you wrote,
T(p,q)
(a, -----------> ( bq + aq + ap ,
b) bp + aq )
In pseudocode,
T(p,q)(a,b) = ( b*q + a*q + a*p , b*p + a*q )
The transformation T(p,q), given a pair (a,b), calculates two new values,
a2 = b*q + a*q + a*p , and
b2 = b*p + a*q
and then constructs a pair, (a2,b2), and returns it as the result.
How can I prove that the reccurence
T(n) = 9T(n/3) + n2
leads to T(n) = O(n2 log(n)) using the substitution method and a proof by induction? I’m not allowed to use the Master Theorem.
Using induction and assuming T(n) ≤ cn2 log n, I got to the following point:
T(n) = 9 * T(n/3) + n2
≤ 9c ( n2 / 9 + log(n/3)) +n2
= cn2 + 9c log(n/3) + n2
Thank you.
I think you've made a math error in your substitution. If we assume that T(n) ≤ cn2 log n, then we'd get
T(n) = 9T(n / 3) + n2
≤ 9(c(n / 3)2 log(n / 3)) + n2
= 9((1 / 9)cn2 log (n / 3)) + n2
= cn2 log(n / 3) + n2
You're very close to having things complete at this point. As a hint, suppose that the logarithm is a base-3 logarithm. What happens if you then use properties of logarithms to simplify cn2 log(n / 3)?
Is there in sage, any instruction to solve a linear system equations
module p(x) (polynomial over finite field), where the system coefficients are polynomials over finite field in any indeterminate?. I know that for integers exists something like, example
sage: I6 = IntegerModRing(6)
sage: M = random_matrix(I6, 4, 4)
sage: v = random_vector(I6, 4)
sage: M \ v
(4, 0, 2, 1)
Here my code
F.<a> = GF(2^4)
PR = PolynomialRing(F,'X')
X = PR.gen()
a11 = (a^2)*(X^3)+(a^11)*(X^2)+1
a12 = (a)*(X^4)+(a^13)*(X^3)+X+1
a13 = X^2+(a^13)*(X^3)+a*(X^2)+1
a21 = X^3
a22 = X+a
a23 = X^2+X^3+a*X
a31 = (a^12)*X+a*(X^2)
a32 = (a^8)*(X^2)+X^2+X^3
a33 = a*X + (a^2)*(X^3)
M = matrix([[a11,a12,a13],[a21,a22,a23],[a31,a32,a33]])
v = vector([(a^6)*(X^14)+X^13+X,a*(X^2)+(X^3)*(a^11)+X^2+X+a^12,(a^8)*(X^7)+a*(X^2)+(a^12)* (X^13)+X^3+X^2+X+1])
p = (a^2 + a)*X^3 + (a + 1)*X^2 + (a^2 + 1)*X + 1 # is than 6 in the firs code
I'm trying
matrix(PolynomialModRing(p),M)\vector(PolynomialModRing(p),v)
but PolynomialModRing not exist ...
EDIT
another person talk me that I will make
R.<Xbar> = PR.quotient(PR.ideal(p))
# change your formulas to Xbar instead of X
A \ b
# ==> (a^3 + a, a^2, (a^3 + a^2)*Xbar^2 + (a + 1)*Xbar + a^3 + a)
this work fine but Now I'm trying to apply the Chinese Theorem Remainder after the code, then .... I defined
q = X^18 + a*X^15 + a*X^12 + X^11 + (a + 1)*X^2 + a
r = a^3*X^3 + (a^3 + a^2 + a)*X^2 + (a^2 + 1)*X + a^3 + a^2 + a
#p,q and r are relatively prime
and I'm trying ...
crt([(A\b)[0],(A\b)[1],(A\b)[2]],[p,q,r])
but I get
File "element.pyx", line 344, in sage.structure.element.Element.getattr (sage/structure/element.c:3871)
File "misc.pyx", line 251, in sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1606)
AttributeError: 'PolynomialQuotientRing_field_with_category.element_class' object has no attribute 'quo_rem'
I'm thinking that problem is the change Xbar to X
Here my complete example to integers
from numpy import arange, eye, linalg
#2x-3y+2z=21
#x+4y-z=1
#-x+2y+z=17
A = matrix([[2,-3,2],[1,4,-1],[-1,2,1]])
b=vector([21,1,17])
p=[17,11,13]
d=det(A)
dlist=[0,0,0]
ylist=matrix(IntegerModRing(p[i]),[[2,-3,2],[1,4,-1], [-1,2,1]])\vector(IntegerModRing(p[i]),[21,1,17])
p1=[int(ylist[0]),int(ylist[1]),int(ylist[2])]
CRT(p1,p)
Maybe... this is what you want? Continuing your example:
G = F.extension(p) # This is what you want for "PolynomialModRing(p)
matrix(G,M)\vector(G,v)
which outputs
(a^3 + a, a^2, (a^3 + a^2)*X^2 + (a + 1)*X + a^3 + a)
In your question you ask "where the system coefficients are polynomials over finite field in any indeterminate" so what I'm doing above is NOT what you have actually asked, which would be a weird question to ask given your example. So, I'm going to just try to read your mind... :-)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have been trying to solve this recurrence for almost 2 hours but could not get the answer...
Let:
T(n)= kn+T(n/2) for n>1 and T(1)=1 where n = 2^k for some integer k
Show that T(n)= O(n)
(I'm assuming the k in T(n) = kn + T(n / 2) is not the same as the k in n = 2^k. If that's wrong, I'll update this.)
If you just need an asymptotic bound, then you can use the Master Theorem. Your recurrence is
T(n) = T(n / 2) + kn
So a = 1, b = 2, and c = 1. Therefore, since logb a = 0 < 1, the Master Theorem causes this to solve to Θ(n).
If you need an exact value, you can use the iteration method to get a good guess. I'm assuming T(1) = 1.
T(n) = T(n / 2) + kn
= (T(n / 4) + kn/2) + kn
= T(n / 4) + kn + kn/2
= (T(n / 8) + kn / 4) + kn + kn / 2
= T(n / 8) + kn + kn / 2 + kn / 4
...
= T(n / 2i) + kn(1 + 1/2 + 1/4 + ... + 1/2i)
This terminates when i = log2 n, at which point we get
T(n) = T(1) + kn(1 + 1/2 + 1/4 + ... + 1/n)
= 1 + kn(1 + 1/2 + 1/4 + ... + 1/n)
= 2kn
So the exact figure should be (modulo math errors) 2kn, agreeing with the result from the Master Theorem.
Hope this helps!
I have an exam (Functional Programming in SML) coming up in a week. I have become fairly confident in the programming language SML and the functional paradigm, but I have a quite big problem with proves.
I am trying to solve the following question which was a part of the last year exam:
Consider the following declarations of a datatype for trees and of two functions:
datatype tree = Lf | Br of int * tree * tree;
fun size Lf = 0
| size(Br(i,t1,t2)) = 1 + size t1 + size t2;
fun sizeI Lf k = k
| sizeI (Br(i,t1,t2)) k = sizeI t1 (1 + sizeI t2 k);
Prove that
sizeI tr k = k + size tr
holds for all trees tr and all integers k.
I want to solve the above question by using Well Founded Induction. To start, I have solved the base case:
k = 0 & tr = Lf
sizeI Lf 0 = 0+size Lf
0 = 0
Then I have tried solving the inductive step, but got stuck:
sizeI tr k = k + size tr
sizeI Br(k,t1,t2) k = k + size Br (k,t1,t2)
size t1 (1+ sizeI t2 k) = k+1+size t1 + size t2
.... STUUUUCK
I would REALLY appreciate ANY help here. If you have any links or tips with induction in general (please don't point me at the evil "Well-founded relation" article on Wikipedia), I would be really happy. Also, if you can help me with this one question...
THANKS! :-)
To do well-found induction, first you need to define a well-found relation on trees:
Binary relation c where (t1, k1) c (t,k) if t1 is a subtree of t is a well-found relation.
Second, state your induction hypothesis:
t1 and t2 are subtrees of t, we have:
sizeI t1 k1 = k1 + size t1 (1)
sizeI t2 k2 = k2 + size t2 (2)
We must establish:
sizeI Br(i,t1,t2) k = k + size Br(i,t1,t2)
You have already done the base case.
Induction case:
Notice that:
sizeI Br(i,t1,t2) k
= sizeI t1 (1 + sizeI t2 k) // definition of sizeI
= 1 + sizeI t2 k + size t1 // induction hypothesis (1)
= 1 + k + size t2 + size t1 // induction hypothesis (2)
= k + size Br(i, t1, t2) // definition of size
We completed the proof.