Ali Hassani

120 Reputation

4 Badges

10 years, 118 days

MaplePrimes Activity


These are replies submitted by Ali Hassani

@Carl Love 

Dear Carl,


Thanks so much

My Maple version is 2020.

@mmcdara 

Hi,
Thanks so much

Best wishes

@Carl Love 

Hi again,
Your comments are very useful.
Thanks so much

@tomleslie 
Dear tomleslie,
thany you so much
Best wishes
 

@Carl Love 

Dear Carl,
Thank you so much to consume your time with me. You are very patient to reply.
The reason for my delay to reply is that I was studying the commands of Grid package such as Map, Send, Receive, MyNode, and so on. As I previously said, the help pages of Maple are not appropriate for self-learning. I think it causes me to find many problems to implement what is in my mind.
 Now, I have another question:
I, for example, want to execute the command “coeftayl(sin(x),x=0,9)” due to 'Run' command at node 0 in parallel. When I wrote the following code, I arrived at my goal.

Grid:-Run(0,coeftayl,[sin(x),x=0,9]);
GetLastResult(0);
 
However, when I tried to re-write the above by application of a procedure, named 'dummy', the code doesn’t correctly execute.
 
dummy:=proc(expr,num)
coeftayl(expr,x=0,num);
end proc;
Grid:-Run(0,dummy,[sin(x),9]);
GetLastResult(0);
Would you tell me what is the reason?

Besides, I want to use Map command to execute taylor command to derive the first 10 terms of sine function about x=0. The usual command is as the following:
taylor(sin(x),x,10);
I wrote the Map-versioned 'taylor' command as the following, however, it returns the error. what is the reason?
Grid:-Map(taylor,[sin(x)],x,10);

 
Finally, you told me that "That is mostly true. I have discovered a few commands (such as index) which I've confirmed are threadsafe (by reading their code), yet they aren't listed on page ?index,threadsafe."
Is it possible to tell me those commands being thread-safe but not listed in page index.threadsafe?

Dear Carl,

I appreciate it to your help.

Does the following sentence is true?

The Threads[Task] package, which is shared memory, is applicable only for the commands listed in “Thread-safe fucntions” in the help of Maple, and if ok, to execute another commands (not listed in “Thread-safe fucntions”) in parallel, we have to use Grid programming?

 

Another question is about Grid programming model. I know that Grid programming explain in the related help pages. However, its explanation by a person, can be usually more useful than the help pages. Please tell me some important keys of Grid prgramming as far as possible.

Does Grid programming is hard to write rather than Task programming model?

Does Grid:-Map(fsolve, Eqns) command is feasible to another commands such as taylor, solve and so on? If not, please guide me to learn about.

Best wishes

@Carl Love 
Dear Carl
Thank you for your attention.
I think I understood the concept of “divide-and-conquer”. Besides, I think that I can’t convey my idea about the “coeftayl” command for programming in parallel. I try to explain my opinion as follows. Let me request the first 10 coefficients of sin(x) in parallel. I want to write a parallel program with Threads[Task] package so that the first task to be executing the first coefficient of sin(x), and the second task (thread) to be executing the second coefficient, and the third thread (task) is forced to calculate the third coefficient of the Taylor series of sin (x), and so on. Would you help me to do this?
 
 About the “solve” command, let me assume a set of equations including 100 equations and 100 unknowns. I want to write a parallel program such that the first 10 equations is a new smaller set of equations to calculate the first 10 unknowns by the first “task”. Of course, I know there are all 100 unknowns in the first 10 equations. I make focus on derivation of the first 10 unknowns by using the first 10 equations (included all 100 unknowns). The second 10 equations are, in turn, another smaller set of equations to obtain the second 10 unknowns by the second “task”, and so on. In this mmaner, I force all threads to run some parts of my program. Would you have any idea about?

@Joe Riel 

Dear Riel,
Before anything, I thank you for your reply.
I understood my code leads to an infinite recursive call of the “task” procedure. I knew this after submitting the question; However, I didn’t remove my question to take feedback about Threads[Task] package. I severely need to implement some command of Maple in parallel such as “fsolve” and “solve” for a big set of equations in a lot of unknowns. However, I am not able to it. For another example to apply parallel programming, I asked a new question about using “coeftayl” in parallel entitled "How do I can use the therads[Task] package to produce the coefficient of Taylor series of expression?".
Would you help me to learn how to use Treads[Task] package in the parallel-programming application of  “solve”, “fslove”, and “taylor” commands?
Thanks, in advance
Best wishes

@Carl Love 

Dear Carl,
Before anything, I thank you for your reply.
I understood my code leads to an infinite recursive call of the “task” procedure. I knew this after submitting the question; However, I didn’t remove my question to take feedback about Threads[Task] package. I severely need to implement some command of Maple in parallel such as “fsolve” and “solve” for a big set of equations in a lot of unknowns. However, I am not able to it. For another example to apply parallel programming, I asked a new question about using “coeftayl” in parallel entitled "How do I can use the therads[Task] package to produce the coefficient of Taylor series of expression?".
Would you help me to learn how to use Treads[Task] package in the parallel-programming application of  “solve”, “fslove”, and “taylor” commands?
Thanks, in advance
Best wishes

1 2 3 Page 3 of 3