Re: ComputeGrid API in C++

2017-10-27 Thread asingh
Ok, so, i first need to wrap ignite within an application that will register
my user functions and start ignite.
I launch that application on every machine that I have.
Then, I can launch another calling application that will call RunASync() and
dispatch tasks to each ignite node and collect their responses.

Is that how it should be?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: ComputeGrid API in C++

2017-10-26 Thread asingh
Ignite node = Ignition::Start("node1");

The first argument to Start() needs to be an xml file. Are there any
specific properties that need to be set in the xml for this case?
If I call Start(cfg, "node1"), it just launches node1 within the same
process as the application.

In the below diagram, what do I have to do to dispatch C1, C2, C3 to nodes
1, 2 and 3, specially when nodes 1,2 and 3 are running on different physical
machines?

  Compute Grid   


 





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: ComputeGrid API in C++

2017-10-26 Thread asingh
Hi Igor

Shouldn't be a problem, given that the source code is there. I just want to
make sure that I am doing it the right way. Currently, I have modified the
main() method in platforms/cpp/ignite/src/ignite.cpp and added these two
lines:

IgniteBinding binding = ignite.GetBinding();
binding.RegisterComputeFunc();

Also, when would I use IgniteModuleInit()? Is it when the Call() method is
implemented in a shared library?

Thanks!



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: ComputeGrid API in C++

2017-10-25 Thread asingh
So, here is what I am trying to do:
1. Launch ignite node on one Linux machine
2. Launch another ignite node on second Linux machine
3. On one of the two machines, run the compute_example containing
PrintWords() class and have its Call() method invoked via compute.RunAsync()
on all three machines in parallel.

All three ignite nodes use the same xml that I had attached earlier.

I was not able to have the example dispatch the calls to the independent
ignite nodes, without explicitly registering the PrintWords class in
ignite's main function.

I am sure there is a better way to do this, but I need some help in figuring
out how!





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: ComputeGrid API in C++

2017-10-23 Thread asingh
That was it!
Thank you so much, Igor.

I just had to add a call to GetBinding() and RegisterComputeFunc() in 
platforms/cpp/ignite/src/ignite.cpp main() method. I'm not used to modifying
an implementation in order to run an example ;)

Although, this means that every time I change the closure, I have to rebuild
ignite as well. Not a big problem but if anyone has a more elegant solution,
I am all ears!




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: ComputeGrid API in C++

2017-10-20 Thread asingh
That makes sense.

Now I am using ignite.GetBinding() from within the main() function

In the main function, I am populating a vector of strings and calling
RunAsync() three times.
The ignite node within the binary is able to process the string but the
other two ignite nodes report the same IgniteException of job not being
registered.


Looks like the example binary is able to communicate with the two ignite
server nodes but those two nodes have no idea about the PrintWords' Call
method.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: ComputeGrid API in C++

2017-10-20 Thread asingh
That piece of message confused me a little. Am i supposed to
compile(actually, link) with -rdynamic or not?
Anyway, so I did set LDFLAGS environment variable to -rdynamic and
recompiled and relinked under platform/cpp as well as under examples. But
still no luck.

Also, I am running the ignite that is built under
$IGNITE_HOME/platforms/cpp/ignite/ignite




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: ComputeGrid API in C++

2017-10-19 Thread asingh
Hi Igor

I am running Red Hat Linux 6, with gcc 4.4.7

Thanks!



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: ComputeGrid API in C++

2017-10-19 Thread asingh
compute-example.xml
 
 

I have attached the xml file as well. As you can see from the various
commented out sections, I have been trying different things to make it work.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: ComputeGrid API in C++

2017-10-19 Thread asingh
Thanks for the links!

So, now I am trying to run the CPP example.
I have compiled CPP version of ignite and running that on two servers. The
two instances of ignite are able to recognize each other:

[10:20:49] Ignite node started OK (id=638a866d)
[10:20:49] Topology snapshot [ver=1, servers=1, clients=0, CPUs=40,
heap=0.89GB]
[10:20:55] Topology snapshot [ver=2, servers=2, clients=0, CPUs=80,
heap=1.8GB]


But when I try to run the CPP example, I get this message from the example:

An error occurred: org.apache.ignite.IgniteException : C++ compute job is
not registered on the node (did you compile your program without
-rdynamic?). [jobTypeId=160893980], class org.apache.ignite.IgniteException:
C++ compute job is not registered on the node (did you compile your program
without -rdynamic?). [jobTypeId=160893980]

Below is the message is see from one of the ignite/ignite processes:
[10:21:32,877][SEVERE][pub-#97%null%][GridJobWorker] Failed to execute job
[jobId=7a5b2053f51-9a565515-196e-4fe0-807d-b48c58b2126a,
ses=GridJobSessionImpl [ses=GridTaskSessionImpl
[taskName=o.a.i.i.processors.platform.compute.PlatformBalancingSingleClosureTask,
dep=GridDeployment [ts=1508422855449, depMode=SHARED,
clsLdr=sun.misc.Launcher$AppClassLoader@5889949a,
clsLdrId=2c322053f51-0e956c0d-17ae-4662-a762-8c52c4b74524, userVer=0,
loc=true,
sampleClsName=o.a.i.i.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap,
pendingUndeploy=false, undeployed=false, usage=1],
taskClsName=o.a.i.i.processors.platform.compute.PlatformBalancingSingleClosureTask,
sesId=6a5b2053f51-9a565515-196e-4fe0-807d-b48c58b2126a,
startTime=1508422892858, endTime=9223372036854775807,
taskNodeId=9a565515-196e-4fe0-807d-b48c58b2126a,
clsLdr=sun.misc.Launcher$AppClassLoader@5889949a, closed=false, cpSpi=null,
failSpi=null, loadSpi=null, usage=1, fullSup=false, internal=false,
subjId=9a565515-196e-4fe0-807d-b48c58b2126a, mapFut=IgniteFuture
[orig=GridFutureAdapter [ignoreInterrupts=false, state=INIT, res=null,
hash=117005517]], execName=null],
jobId=7a5b2053f51-9a565515-196e-4fe0-807d-b48c58b2126a]]
class org.apache.ignite.IgniteException: C++ compute job is not registered
on the node (did you compile your program without -rdynamic?).
[jobTypeId=160893980]

I modified the example to call RegisterComputeFunc:

IGNITE_EXPORTED_CALL void IgniteModuleInit(ignite::IgniteBindingContext&
context)
{
  IgniteBinding binding = context.GetBinding();
  binding.RegisterComputeFunc();
}

Any help would be much appreciated!
Thanks!



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


ComputeGrid API in C++

2017-10-18 Thread asingh
Hi

There was a thread started regarding this some time back.
http://apache-ignite-users.70518.x6.nabble.com/Compute-Grid-API-in-C-Scala-td4456.html

It was mentioned that the C++ Compute API may come in 1.7. Did that happen?
I cant seem to find any C++ code in the ComputeGrid documentation.

I have a problem similar to Arthi's in the thread above but would like to
avoid wrapping the C++ computational code in JNA.

Apologies if this has been asked before. Would be grateful if you can point
me to the relevant thread.

Thanks!





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/