// @generated by protoc-gen-es v1.7.2 with parameter "target=ts"
// @generated from file flyteidl/plugins/mpi.proto (package flyteidl.plugins, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";

/**
 * MPI operator proposal https://github.com/kubeflow/community/blob/master/proposals/mpi-operator-proposal.md
 * Custom proto for plugin that enables distributed training using https://github.com/kubeflow/mpi-operator
 *
 * @generated from message flyteidl.plugins.DistributedMPITrainingTask
 */
export class DistributedMPITrainingTask extends Message<DistributedMPITrainingTask> {
  /**
   * number of worker spawned in the cluster for this job
   *
   * @generated from field: int32 num_workers = 1;
   */
  numWorkers = 0;

  /**
   * number of launcher replicas spawned in the cluster for this job
   * The launcher pod invokes mpirun and communicates with worker pods through MPI.
   *
   * @generated from field: int32 num_launcher_replicas = 2;
   */
  numLauncherReplicas = 0;

  /**
   * number of slots per worker used in hostfile.
   * The available slots (GPUs) in each pod.
   *
   * @generated from field: int32 slots = 3;
   */
  slots = 0;

  constructor(data?: PartialMessage<DistributedMPITrainingTask>) {
    super();
    proto3.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto3 = proto3;
  static readonly typeName = "flyteidl.plugins.DistributedMPITrainingTask";
  static readonly fields: FieldList = proto3.util.newFieldList(() => [
    { no: 1, name: "num_workers", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
    { no: 2, name: "num_launcher_replicas", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
    { no: 3, name: "slots", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DistributedMPITrainingTask {
    return new DistributedMPITrainingTask().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DistributedMPITrainingTask {
    return new DistributedMPITrainingTask().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DistributedMPITrainingTask {
    return new DistributedMPITrainingTask().fromJsonString(jsonString, options);
  }

  static equals(a: DistributedMPITrainingTask | PlainMessage<DistributedMPITrainingTask> | undefined, b: DistributedMPITrainingTask | PlainMessage<DistributedMPITrainingTask> | undefined): boolean {
    return proto3.util.equals(DistributedMPITrainingTask, a, b);
  }
}

