Print values from slave nodes

General issues of interest both for network and
individual cell parallelization.

Moderator: hines

Post Reply
Krishna Chaitanya
Posts: 70
Joined: Wed Jan 18, 2012 12:25 am
Location: University of Pavia

Print values from slave nodes

Post 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.
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Print values from slave nodes

Post 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.
Post Reply