Page 1 of 1

Print values from slave nodes

Posted: Wed Oct 03, 2012 4:58 am
by Krishna Chaitanya
Hi,

Is there a way to know how many cells each node has received through print command? Though it distributes via round robin, I am interested in knowing through print command. And also when I try to print the positions of a large group of cells distributed through round robin, I am only able to see positions of the cells present on one particular node (not of other nodes)?

Kindly let me know. Thank you.

Re: Print values from slave nodes

Posted: Wed Oct 03, 2012 10:47 am
by ted
It is a useful exercise to write a toy program that runs on a single processor and uses the guts of the "cell distribution algorithm" to calculate and report how many cells will end up on each of N hosts.

But if you really want to verify on parallel hardware, assuming that the ParallelContext instance is called pc, and that the cell instances on each host have been appended to a List called cells, you should be able to execute this statement

{printf("I am %d of %d and have %d cells\n", pc.id, pc.nhost, cells.count())}

any time after the code that creates the cell instances has been executed, but before {pc.runworker()} is executed.

To discover the location of each cell, just add a statement that iterates over the contents of cells and reports the coordinates.