Question: why calling proc via Grid do not print on screen?

If I do 

      Grid:-Run(0,foo,[n])

in worksheet, where foo is proc() defined in same worksheet before, which just prints something, but I do not see anything on the screen printed when running. It seems to run, since the Grid:-Wait() seems to take 1-2 second to finished, so I am sure the proc foo() was called. It is just the print output seem not to show.

When changing the above to

      Grid:-Run(0,foo,[n],'assignto'='ans0')

now I see the print on the screen but only when evaluating ans0. Actually the print does not show, had to evaluate ans0 to see the print string and also the return value.

In my code, I do not need to return anything, I just want to print to the screen. 

How to make the first one display on the screen? Is output from foo proc going somewhere else with Grid?

I made sure to use Grid:-Set(foo): to define foo for the grid as the help says to do. 

Here is worksheet which shows this problem. I simply want to use print inside foo and see the result on the screen when running foo on a node. 

Is this a bug?

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1843 and is the same as the version installed in this computer, created 2025, January 25, 22:5 hours Pacific Time.`

Why task running on node do not print anything?

 

restart;

foo:=proc(n)
   print("Entered foo, n=",n);    
end proc;

proc (n) print("Entered foo, n=", n) end proc

Grid:-Set(foo):
Grid:-Setup("local",numnodes=1); #just use one node
n:=1:
Grid:-Run(0,foo,[n]):
Grid:-Wait();

#nothing is printed from foo

 

To make it print, why assignto is needed?

 

restart;

foo:=proc(n)
   print("Entered foo, n=",n);    
   RETURN("done");
end proc;

proc (n) print("Entered foo, n=", n); RETURN("done") end proc

Grid:-Set(foo):
Grid:-Setup("local",numnodes=1);
n:=1:
Grid:-Run(0,foo,[n],'assignto'='ans0'):
Grid:-Wait();
ans0

"Entered foo, n=", 1

"done"

 

 

Download grid_question_jan_27_2025.mw

Update

I found why, but I do not understand why this fixes it. Removing numnodes =n  where n is number of nodes needed, now it works, i.e. proc prints on the screen ok as expected !

restart;

foo:=proc(n)
   print("Entered foo, n=",n);    
end proc;

proc (n) print("Entered foo, n=", n) end proc

Grid:-Set(foo):
Grid:-Setup("local"); # remove numnodes = ... , then it works. why??
n:=1:
Grid:-Run(0,foo,[n]):
Grid:-Wait();

"Entered foo, n=", 1

 

 

Download grid_question_jan_27_2025_V2.mw

But why? why is adding numnodes =1 or any other number makes it not print? Help says

So I do not see why adding this option makes it not print.

This has to be a bug, right? If not, then what is the logical explanation for this?

Please Wait...