def apply_to_job(self, job: Job, *, job_name: str) -> None:
        if not self.partition:
            raise RuntimeError("A partition to run on must be specified.")

        qos_or_account = (
            f"qos {self.partition}"
            if self.partition in (SCAVENGE, EPHEMERAL)
            else f"account {self.partition}"
        )
        slurm_resource_content = SLURM_RESOURCE_STRING.format(
            qos_or_account=qos_or_account,
            partition=self.partition,
            num_cpus=self.num_cpus if self.num_cpus else 1,
            num_gpus=self.num_gpus if self.num_gpus is not None else 0,
            job_name=job_name,
            mem_str=to_slurm_memory_string(
                self.memory if self.memory else _SLURM_DEFAULT_MEMORY
            ),
            time=self.convert_time_to_slurm_format(
                self.job_time_in_minutes
                if self.job_time_in_minutes
                else _DEFAULT_JOB_TIME_IN_MINUTES
            ),
        )
        logging.debug(
            "Slurm Resource Request for %s: %s", job_name, slurm_resource_content
        )
        job.addProfile(
            Profile(Namespace.PEGASUS, "glite.arguments", slurm_resource_content)
        )
        category_profile = Profile(Namespace.DAGMAN, "category", self.partition)
        if not job.hasProfile(category_profile):
            job.addProfile(category_profile)