You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@systemds.apache.org by GitBox <gi...@apache.org> on 2022/04/02 15:59:03 UTC

[GitHub] [systemds] ywcb00 commented on a change in pull request #1574: [SYSTEMDS-3185] Federated Broadcast Slices Lineage

ywcb00 commented on a change in pull request #1574:
URL: https://github.com/apache/systemds/pull/1574#discussion_r841091465



##########
File path: src/main/java/org/apache/sysds/runtime/controlprogram/federated/FederationMap.java
##########
@@ -226,11 +228,27 @@ public FederatedRequest broadcast(ScalarObject scalar) {
 		// multi-threaded block slicing and federation request creation
 		FederatedRequest[] ret = new FederatedRequest[ix.length];
 		Arrays.setAll(ret,
-			i -> new FederatedRequest(RequestType.PUT_VAR, lineageTrace, id,
-				cb.slice(ix[i][0], ix[i][1], ix[i][2], ix[i][3], isFrame ? new FrameBlock() : new MatrixBlock())));
+			i -> sliceBroadcastBlock(ix[i], id, cb, lineageItem, isFrame));
 		return ret;
 	}
 
+	private FederatedRequest sliceBroadcastBlock(int[] ix, long id, CacheBlock cb, LineageItem objLi, boolean isFrame) {
+		LineageItem li = null;
+		if(objLi != null) {
+			final String scalarCPOSuffix = InstructionUtils.concatOperands(
+				DataType.SCALAR.name(), ValueType.INT64.name(), String.valueOf(true));
+			// manually create a lineage item for indexing to complete the lineage trace for slicing
+			li = new LineageItem(RightIndex.OPCODE, new LineageItem[]{objLi,
+				new LineageItem(InstructionUtils.concatOperandParts(String.valueOf(ix[0] + 1), scalarCPOSuffix)),
+				new LineageItem(InstructionUtils.concatOperandParts(String.valueOf(ix[1] + 1), scalarCPOSuffix)),
+				new LineageItem(InstructionUtils.concatOperandParts(String.valueOf(ix[2] + 1), scalarCPOSuffix)),
+				new LineageItem(InstructionUtils.concatOperandParts(String.valueOf(ix[3] + 1), scalarCPOSuffix))});

Review comment:
       Thank you for the advice @phaniarnab. I modified it to create CPOperand for each index and derive the LineageItem from the CPOperands. However, using the getLineage() method to obtain the LineageItems is not that easy, as we would need the ExecutionContext for that.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org