-
Hi All, TL;DR: Is it possible to pass a user data object that contains dynamic data (E.g. a dynamic int array) into the load balancer? ZIP of the all of the test files can be found here: IntroductionI am currently trying to pass dynamically sized user data to load balancing and am running into issues with what I presume to be with serialization of the data. I am using a modified test case found in: My
As you can see, I added a size integer (Called Additionally, in
The work function for the
The only other change made is the user data OBJ registration code in the constructor of the
I am simply assuming that the dynamic integer array is three integers long (Since this object has to be registered with the correct size of the user data. The ProblemWhen printing out the data in the work function of the load balancer, it only successfully reads data (From the With the above changes, I run the following command: Error Output:
If you made it this far, thanks for reading. Any help is appreciated. Jacob |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is unsupported currently, the LB framework has no awareness of what your user data type is (as you can tell from Thus. the PUP routine that you write in your type is never executed (since the runtime doesn't know about your type); instead, it is PUP'd as a One thing you can do to approximate the ability to pass around dynamically sized data is to constrain the maximum length of your user data and allocate a static array of that max size in the object itself while using another variable to track how much of it is used. |
Beta Was this translation helpful? Give feedback.
This is unsupported currently, the LB framework has no awareness of what your user data type is (as you can tell from
LBRegisterObjUserData(sizeof(LBUserDataStruct) + (3 * sizeof(int)))
, it only allows a size to be passed in, not a type). The user data is stored as one big flat buffer with offsets that are provided at registration, which you can interpret as an object or struct by casting it a laLBUserDataStruct* udata = (LBUserDataStruct*)odata.getUserData(CkpvAccess(_lb_obj_index))
(_lb_obj_index
is the provided offset).Thus. the PUP routine that you write in your type is never executed (since the runtime doesn't know about your type); instead, it is PUP'd as a
char
array of the speci…