Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

How can I parallelize

Hi. How can I parallelize a task running in a PU, I need the task use the resources of the entire cluster. (i.e calculate prime numbers)


{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2481]{quote}

asked 2008-07-25 11:54:58 -0500

nullcipher2 gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

The proper way to distribute work (ala Map Reduce) to all PU having business logic and collocated space is via sync-remoting - see:

See example that illustrates data aggregation across the cluster:

In case the business logic is not collocated with the space you should perform non blocking operation or direct the activity to specific partitions "manually".
Let me know if this is your case.


answered 2008-07-25 12:31:52 -0500

shay hassidim gravatar image
edit flag offensive delete link more


I´m testing master-worker, but I suppose sync-remoting is better. Do you have a code sample of http://www.gigaspaces.com/wiki/display/OLH/OpenSpacesRemotingComponent-SyncRemoting.

Whats the difference between sync-remoting and async-remoting.

Thanks all

nullcipher2 gravatar imagenullcipher2 ( 2008-07-25 16:24:23 -0500 )edit

See http://www.gigaspaces.com/wiki/displa...

This page also explains the difference.

In essence remoting is an implementation of the master worker pattern. It is simply designed to be able to partition/distribute and scale both the data and the business logic altogether. You can partition the data and distribute the business logic in different ratio by running the business logic as a separate PU. In this case polling the tasks done differently.


shay hassidim gravatar imageshay hassidim ( 2008-07-25 17:02:19 -0500 )edit

Perfect. How can I inject a bean from spring to an os-remoting:service-exporter.

@RemotingService public class ProcesadorArchivoNN implements IProcesadorArchivoNN {

private IMyI myI;

... }

I need to inject myI from spring.

nullcipher2 gravatar imagenullcipher2 ( 2008-07-25 18:13:38 -0500 )edit

I have a big problem. I´m implementing the remoting services and I´m using partitioned cluster schema, when gigaspaces processes a remoting service and reading an object, sometimes the read operation returns null (BUT THE OBJECT EXISTS) because it points to only one container, the object resides in other space of the cluster, I need the read operations defined in the remoting services search the objects in the entire cluster containers. How can I do it..


nullcipher2 gravatar imagenullcipher2 ( 2008-07-28 11:47:32 -0500 )edit

The space proxy that is injected should be configured to use the clustered tag.

shay hassidim gravatar imageshay hassidim ( 2008-07-28 11:53:56 -0500 )edit


The pattern you are looking for is called master-worker. You can deploy a set of processing unit containing the cluster and another set of processing units which connect to this cluster as remote workers. Take a look at the PollingContainer to set it up easily.


answered 2008-07-25 12:30:49 -0500

nirpaz gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2008-07-25 11:54:58 -0500

Seen: 41 times

Last updated: Jul 25 '08