server routine vs parallel routine
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
server routine vs parallel routine
I guess both kind of routines use the same BASIC code (Please correct if wrong), then why is it so that a server routine cannot be used in Parallel job and vice versa
Thank you.
Thank you.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You are completely wrong. Parallel routines must be written in C++ (definitely not any kind of BASIC language) then compiled and linked. Finally an entry must be placed in the repository recording the existence, location and required arguments of the routine.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 26
- Joined: Sun Dec 23, 2007 3:21 am
- Location: hyderabad
Re: server routine vs parallel routine
Server routines are written in Basic language and called in server job environment but the Parallel routines are written in c++ language(not in basic level language) and called din parallel job environment......
SRIKANTH
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Server routines can be called from server jobs, from sequences, from BASIC Transformer stages in parallel jobs and from server Transformer stages in server shared containers in parallel jobs.
Parallel routines can only be called from Transformer or certain custom stage types in parallel jobs.
Parallel routines can only be called from Transformer or certain custom stage types in parallel jobs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
Wrote a small Parallel routine to get started with........ this one takes 2 integers and returns the sum........works fine Hurray!!!!
But due to some reason the routines with character arguments are not working
I am trying to pass 2 char arguments and then check if they are equal, the function returns an integer 1 if equal else 0;
#include <iostream.h>
int CharComp(char a, char b){
int c;
if (a==b) c=1;
else c=0;
return c;
}
The job aborts with this error :
Transformer_46: Failed to load the library "V0S46_checking1_Transformer_46.o"; either the directory containing the library file
is not on the library search path, or the library was compiled on a system
that is incompatible with this system: Could not load "V0S46_checking1_Transformer_46": rtld: 0712-001 Symbol CharComp__FUcT1 was referenced
from module /data/ds/hbus/projectlib/dpr_hbus_dev/RT_BP6744.O/V0S46_checking1_Transformer_46.o(), but a runtime definition
of the symbol was not found..
I am including the transformer code from the project directory:
==> cat V0S46_checking1_Transformer_46.trx.osh
transform -inputschema record
(
DELTA_FLAG:nullable string[];
)
-outputschema record
(
DELTA_FLAG:string[];
One:int32;
)
-expressionfile [&DSPXSourceDir]/V0S46_checking1_Transformer_46.trx
-flag compile
-staticobj '/data/ds/hbus/dev/landing/CharComp.o'
-compiler '/usr/vacpp/bin/xlC_r'
-compileopt '-O -c -qspill=32704'
-linker '/usr/vacpp/bin/xlC_r'
-linkopt '-G'
-name V0S46_checking1_Transformer_46
-dir /data/ds/hbus/projectlib/dpr_hbus_dev/RT_BP6744.O
vh2ldcdv02:{HBUS}:/data/ds/hbus/projectlib/dpr_hbus_dev/RT_SC6744
==> cat V0S46_checking1_Transformer_46.trx
//
// Generated file to implement the V0S46_repos_Transformer_46 transform operator.
//
// define external functions used
extern int32 CharComp(int32 a,int32 b);
// define our input/output link names
inputname 0 lnkItemRed;
outputname 0 DSLink47;
initialize {
// define our row rejected variable
int8 RowRejected0;
// define our null set variable
int8 NullSetVar0;
}
mainloop {
// initialise our row rejected variable
RowRejected0 = 1;
// evaluate columns (no constraints) for link: DSLink47
DSLink47.DELTA_FLAG = lnkItemRed.DELTA_FLAG;
DSLink47.One = CharComp(1 , 3);
writerecord 0;
RowRejected0 = 0;
}
finish {
}
I then changed the arguments type from char to int and rewrote the c++ code as :
#include <iostream.h>
int CharComp(int a,int b){
int c;
if (a==b) c=1;
else c=0;
return c;
}
It then worked fine ...............Could anyone tell me where the issue is?
But due to some reason the routines with character arguments are not working
I am trying to pass 2 char arguments and then check if they are equal, the function returns an integer 1 if equal else 0;
#include <iostream.h>
int CharComp(char a, char b){
int c;
if (a==b) c=1;
else c=0;
return c;
}
The job aborts with this error :
Transformer_46: Failed to load the library "V0S46_checking1_Transformer_46.o"; either the directory containing the library file
is not on the library search path, or the library was compiled on a system
that is incompatible with this system: Could not load "V0S46_checking1_Transformer_46": rtld: 0712-001 Symbol CharComp__FUcT1 was referenced
from module /data/ds/hbus/projectlib/dpr_hbus_dev/RT_BP6744.O/V0S46_checking1_Transformer_46.o(), but a runtime definition
of the symbol was not found..
I am including the transformer code from the project directory:
==> cat V0S46_checking1_Transformer_46.trx.osh
transform -inputschema record
(
DELTA_FLAG:nullable string[];
)
-outputschema record
(
DELTA_FLAG:string[];
One:int32;
)
-expressionfile [&DSPXSourceDir]/V0S46_checking1_Transformer_46.trx
-flag compile
-staticobj '/data/ds/hbus/dev/landing/CharComp.o'
-compiler '/usr/vacpp/bin/xlC_r'
-compileopt '-O -c -qspill=32704'
-linker '/usr/vacpp/bin/xlC_r'
-linkopt '-G'
-name V0S46_checking1_Transformer_46
-dir /data/ds/hbus/projectlib/dpr_hbus_dev/RT_BP6744.O
vh2ldcdv02:{HBUS}:/data/ds/hbus/projectlib/dpr_hbus_dev/RT_SC6744
==> cat V0S46_checking1_Transformer_46.trx
//
// Generated file to implement the V0S46_repos_Transformer_46 transform operator.
//
// define external functions used
extern int32 CharComp(int32 a,int32 b);
// define our input/output link names
inputname 0 lnkItemRed;
outputname 0 DSLink47;
initialize {
// define our row rejected variable
int8 RowRejected0;
// define our null set variable
int8 NullSetVar0;
}
mainloop {
// initialise our row rejected variable
RowRejected0 = 1;
// evaluate columns (no constraints) for link: DSLink47
DSLink47.DELTA_FLAG = lnkItemRed.DELTA_FLAG;
DSLink47.One = CharComp(1 , 3);
writerecord 0;
RowRejected0 = 0;
}
finish {
}
I then changed the arguments type from char to int and rewrote the c++ code as :
#include <iostream.h>
int CharComp(int a,int b){
int c;
if (a==b) c=1;
else c=0;
return c;
}
It then worked fine ...............Could anyone tell me where the issue is?
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
It worked when the type of input arguments in the routine was changed from char to char*, guess the transformer passes the address and not the values to the Parallel routine.
I would be very thankful if anyone helps me in handling NULL values in Parallel routines, when i pass NULL able columns as arguments how do we make C++ code to work with nulls and how do we check from inside the code if the value is NULL?
Thanks in advance
I would be very thankful if anyone helps me in handling NULL values in Parallel routines, when i pass NULL able columns as arguments how do we make C++ code to work with nulls and how do we check from inside the code if the value is NULL?
Thanks in advance
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
In c++ its a mere empty string
for array the terminator will be at array[0], hence you can check if array[0]='\0'
or in case of pointers you can use .empty() to check if its null.
But i dont think you need to do anything special just to handle null values, it shouldn't drop any record.
for array the terminator will be at array[0], hence you can check if array[0]='\0'
or in case of pointers you can use .empty() to check if its null.
But i dont think you need to do anything special just to handle null values, it shouldn't drop any record.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
How do we make the Parallel routine handle nulls ? Is it by using makenull() function and convert the in-band nulls to out-band nulls and check the same in the routine?ray.wurlod wrote:You're wrong. Nulls can be passed to parallel routines - but the routine has to be able to handle null arguments.
thanks in advance.