## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
Vaibhav Sethia
@vrockz747
Hey everyone, just have a general question out of curiosity, why do all the modules use only spaces and no tabs, and why does the mason check fail when tabs are used?
Vaibhav Sethia
@vrockz747
Hey @CaptainSharf, firstly I want to ask about the other problems with the native LU procedure in the LA module you mentioned in PR #17522
And also, If we need to generalize the index one, I think we can convert the solution for #17513, into a new function and apply it as step in other procedures, wherever needed.
Mohammed Sharfuddin
@CaptainSharf

Hi @vrockz747 , I raised the following issues related to LU factoring

#16581 LU factoring fails for matrices without full rank in some cases

#16586 Solve procedure in Linear Algebra module fails because of unstable LU factoring

#16973 LU factorization returns both lower and upper triangular matrices in the same matrix

I think creating copies of an array has a lot of performance overhead. Maybe we ought to find an elegant solution to this problem

Vaibhav Sethia
@vrockz747
I guess you are right about the performance issue if we need a general solution
Mohammed Sharfuddin
@CaptainSharf
In terms of computational complexity though, copying into a new array is theta(n^2). This cost is lower bounded by almost all procedures in the LA module. For example, LU which uses gaussian elimination runs in theta(n^3) time. Solve uses LU factoring internally and so is \theta(n^3) as well. Finding eigen values is a theta(n^3) operation. SVD depends on finding eigen values and is therefore bounded by \theta(n^3).
Aryamaan jain
@strikeraryu
While was making docs file I got this error and then there was no HTML file in the docs dir.

Anyone have idea what is this error about?
7 replies
prashanth018
@prashanth018

Hi, I have been working on something and I observed the below issue.

proc foo(A: [], param p=true){
if A.rank != 2 || A.domain.dim(0) != A.domain.dim(1) then {
compilerError('Error!');
}
// Rest of the logic
}

When I execute the above method, compiler throws 'compilerError' despite A being 2*2 Matrix.

proc foo(A: [], param p=true){
if A.rank != 2 || A.domain.dim(0) != A.domain.dim(1) then {
writeln('Error!');
}
// Rest of the logic
}

When I execute this method with A being 2*2 Matrix: 'Error!' does not get printed and the rest of the logic properly gets executed (Works as expected).

Would someone mind clarifying if this is an existing issue or an issue with my implementation?

2 replies
Aryamaan jain
@strikeraryu

You’d need to share the output of the start_test run where it reports the failure and shows the diff for any of us to help with this, I think.

@bradcray So this was the output which I got while start_test

1,10c1,10
< 0
< 1
< 2
< 3
< 4
< 5
< 6
< 7
< 8
< 9
---
> 0
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
[Error matching program output for library/standard/list/append/listAppendReturnSerial]
[Elapsed time to compile and execute all versions of "library/standard/list/append/listAppendReturnSerial" - 65.384 seconds]
[Finished subtest "library/standard/list/append/listAppendReturnSerial" - 72.802 seconds]

[Done with tests - 210405.011918]
[Log file: /mnt/e/open_source/chapel/test/Logs/striker.linux64.log ]

[Test Summary - 210405.011918]
[Error matching program output for library/standard/list/append/listAppendReturnSerial]
[Summary: #Successes = 0 | #Failures = 1 | #Futures = 0 | #Warnings = 0 ]

I like to mention few things, I compare my .good file with the tmp.out file generated and it was exactly same and when I used tmp.out file for the test it gave success.

22 replies
HarJeet
@harry-dev98
hey folks, in io module i see there is calls to c functions, etc which are declared in runtime/src/qio directory can some one help me to understand the working behind the scenes.. do all the files of runtime get imported when the program is being executed or what.. Also if there is some tutorial to understand this pattern please provide me the link
2 replies
Aryamaan jain
@strikeraryu
I was looking over this whole LU and indexing issue, I have one query does the use of the domain (for iteration) inside the function given directly by the user add some complexity or create some issue?
Mohsin Mehmood
@mohsinmahmood12
chpl /usr/local/Cellar/chapel/1.24.0/libexec/hello.chpl
./hello
Do I need to make new program file in order to run this command?
3 replies
Aryamaan jain
@strikeraryu

I was trying a Strassen implementation in chapel here is my code
I commented some of the code to pinpoint the error and I was getting an error when I am doing recursive call

matrix_multipication_strassen_parallel.chpl:25: error: unable to resolve return type of function 'strassen'
matrix_multipication_strassen_parallel.chpl:25: In function 'strassen':
matrix_multipication_strassen_parallel.chpl:47: error: called recursively at this point
matrix_multipication_strassen_parallel.chpl:109: called as strassen(A: [domain(2,int(64),false)] int(64), B: [domain(2,int(64),false)] int(64))
note: generic instantiations are underlined in the above callstack

I tried different type cast for return type but no success.

@strikeraryu: Recursive functions in Chapel tend to require their return types to be declared rather than inferred. For example, for a recursive factorial, you’d write:

proc fact(x: int): int { … }

rather than:

proc fact(x: int) { … }
Bryant C. Lam
@BryantLam
(How does the compiler work with the C backend?) When I run chpl, does it use the system C compiler or does it use some C compiler that was set during the initial chpl build?
Michael Ferguson
@mppf
@BryantLam - it should use whatever compiler you have configured with the CHPL_..._COMPILER environment variables -- see https://chapel-lang.org/docs/usingchapel/chplenv.html#chpl-compiler .
You might need to rebuild the runtime if you switch backend C compilers, but other than that you should be able to switch CHPL_TARGET_COMPILER settings with a chpl you have already built.
Aryamaan jain
@strikeraryu

Recursive functions in Chapel tend to require their return types to be declared rather than inferred

Yeah I have tried that, I used [] int and got the same error and I used [domain{2,int(64),false}] int(64) and I got a different error.

Bryant C. Lam
@BryantLam
@mppf - Ah that's right. Thanks.
@strikeraryu : I believe that when returning an array, you currently have to specify the domain of the array being returned as part of its return type, at least for a recursive function. So, for example : [1..n, 1..n] real or : [D] real;
Aryamaan jain
@strikeraryu
what if my domain is decreasing with each recursive step like 0..4 -> 0..2?
I think that, at present, that’s going to be hard to express recursively unless it can be written as a function of the input arguments. If it can be, then you’d do something along the lines of: proc foo(X: [?XD] real): [1..XD.size/2] real { … } say.
Paul Cassella
@cassella
Why can't you write the return type as : [] real? That works for me for a non-recursive function. but I get unable to resolve return type when I use it on a recursive one.
2 replies
ConDai
@ConDai
Hi! I made a Go-Style Channel module. Would love to have some feedback!
https://github.com/ConDai/ChapelChannel
Aryamaan jain
@strikeraryu
I have implemented parallel Strassen's algorithm, but I think my implementation is a little messy is there any way I can Improve upon It. I am using 2d arrays in a recursive function and cobegin of parallelism in the 7 recursive calculation steps of Strassen but as it is a recursive step I think this will create a problem because as we go deeper in the recursion tree the number of the parallel task will increase exponentially so is there any way I can limit it?
@strikeraryu : Sounds like a case for the serial statement: https://chapel-lang.org/docs/language/spec/task-parallelism-and-synchronization.html#serial
Where you could combine this with here.runningTasks() and here.numPUs() as a means of determining when to throttle the creation of more tasks: https://chapel-lang.org/docs/usingchapel/tasks.html#task-related-quantification-methods-on-locales https://chapel-lang.org/docs/builtins/ChapelLocale.html#ChapelLocale.locale.numPUs
12 replies
Zhihui Du
@zhihuidu
When I declair a set
var LocalSet= new set(int,parSafe = true);
and I want to assign the elements of the set to an array A
for the following forall
forall (a,b) in zip (A,LocalSet) {
a=b;
}
the value of b is not the element of LocalSet
When I change the set to an array
forall (a,b) in zip (A,LocalSet.toArray()) {
a=b;
}
it works.
I do not understand why when I
forall i in LocalSet {
writeln(i);
}
the i is the element of LocalSet. Why in zip it is not correct?
@zhihuidu : On the surface, that definitely sounds like a bug, and it’s not completely surprising that you’re seeing different behavior for the non-zippered case, as zippered parallel loops are implemented differently than non-zippered parallel loops. Out of curiosity, do you see the correct behavior if you change the forall to a for?
6 replies
If so, I’d definitely open a bug on our github issues about this and tag @dlongnecke-cray on it.
David Longnecker
@dlongnecke-cray
We're finding all kinds of bugs! Sorry that you have to bear the brunt of them @zhihuidu, but thank you for pointing them out!
Aryamaan jain
@strikeraryu
@bradcray so I implemented Strassen's algo to work in multiple locales, and it giving a good distribution in all locales. But I am getting issue with serial, it is reducing the total running task but I don't think It supposes to work like that. eg. I tested using serial true and serial but when I run this program I am getting 7 -14 running task in a locale which shouldn't be there because it should cancel out cobegin and match the result when I run the code without cobegin which gives only one running task.
Am I missing something ?
22 replies
Amir
@Aamir1532000
Do we have to run "make" Command each time after reopening bash window??
Aryamaan jain
@strikeraryu
@Aamir1532000 do make install with the config you want
Amir
@Aamir1532000
@strikeraryu i dont get it. can you provide any link to the documentation
Aryamaan jain
@strikeraryu
@Aamir1532000 I don't remember any documentation but you can just run make install.
Amir
@Aamir1532000
Ok @strikeraryu
ConDai
@ConDai

@Aamir1532000 do make install with the config you want

What does this do? Install and add it to the path?

Aryamaan jain
@strikeraryu
when you run ./configue this will set all the environment variables specified in that and then you can run make install which will build and install.
ConDai
@ConDai
Wow. Had no idea you could install it like this.
Thanks!
Zhihui Du
@zhihuidu
BlockDist, CyclicDist, BlockCycDist;
If I want to customize the way to distrubute the array.
For example. A[0..99] on 4 locales, I hope to assign
A[0..10], A[11..80], A[81..85] and A[86..99] to locales 0,1,2,3.
How can I do it? Thanks!
@zhihuidu — This would require creating a new domain map that would be characterized by the specification of where the blocks should be created. We sometimes refer to this as a “cut” distribution and had a user create their own version of one at some point in the past, but unfortunately, it was not contributed back to the project, so is lost to time. Writing such a domain map would be tractable, but not trivial (in part because the documentation around creating domain maps is not so good at present).
6 replies
Lakshya Singh
@king-11
I observed that the test written in chapel have a lot of variations and their is not fixed pattern as to how we can should them, is there any reason to not follow an pattern like using functional methods or not enforcing the UnitTest module
@king-11 : Are you saying that different tests (within \$CHPL_HOME/test presumably?) seem to take different approaches to how they are written and what approach they take? I think that’s accurate and reflects, to an extent, that they are written to test code that a user might write in the language, where different users are likely to write code in different ways.
10 replies
Vaibhav Sethia
@vrockz747

hey everyone, I was trying to undertand the fucntion demapped Block() and while reading the documentation, i found the example code:

use BlockDist;

const Space = {1..8, 1..8};
const D: domain(2) dmapped Block(boundingBox=Space) = Space;
var A: [D] int;

forall a in A do
a = a.locale.id;

writeln(A);

the output according to the documentation was suppose to be:

0 0 0 0 1 1 1 1
0 0 0 0 1 1 1 1
0 0 0 0 1 1 1 1
2 2 2 2 3 3 3 3
2 2 2 2 3 3 3 3
2 2 2 2 3 3 3 3
4 4 4 4 5 5 5 5
4 4 4 4 5 5 5 5

but instead i got this in my machine for the same code:

0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0

really confused as to why this is happening.

Divye Nayyar
@Yudhishthira1406
Hi @vrockz747 I think that you have not specified the number of locales for the program to run on. You can specify that using -nl {numberofLocales} flag at runtime.
7 replies
Hey, this is my first time in openSource I only know C language and I am interested in contributing can someone help me?
Aryamaan jain
@strikeraryu
Firstly welcome to the community, Ill suggest you to first go through documentation , its not necessary to go though full documentation but start with some basic like how to install chapel, basic about chapel, primers and there is also a cheatsheet for chapel this all help you to get started, then just playaround and when you get comfortable then you can fork and clone git repository and start working on that. As this will be the current state of chapel under development. Then you can look on ongoing issues, suggest solutions and discuss you issue in community. But Ill suggest you to just get comfortable and then you can ask for further help.
@strikeraryu Thanks!
Vaibhav Sethia
@vrockz747
hey everyone, I am struggling to understand clearly what the function dmapped Block() is doing, I read the documentation, but still am not clearly understanding what is happening in the provided example. Could someone help me understand it properly?
2 replies
hokiegeek2
@hokiegeek2
Are there any low-level TCP features within Chapel that would support an HTTP server endpoint analogous to the ZMQ module?
2 replies
Lakshya Singh
@king-11

can someone help we with the following code am not able to work it out

type twoString = 2*string;
var twoStrings = list(twoString,parSafe=true);

this throws an error for illegal type arrugment on second line.

7 replies