Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summing up the sizes of input files #137

Closed
katevoss opened this issue Sep 22, 2017 · 4 comments
Closed

Summing up the sizes of input files #137

katevoss opened this issue Sep 22, 2017 · 4 comments

Comments

@katevoss
Copy link
Contributor

@jsotobroad commented on Fri Sep 22 2017

It would nice to have a way of summing up a list of floats like if you have a scatter task that you then want to gather the outputs of, its not straightforward on how you dynamically size that gather task. This is what we currently do (and if it's stupid let us know!)

scatter (bam in list_of_bams) {
  call MakeBam{
    inputs:
      bam
  }

  Float mapped_bam_size = size(MakeBam.output_bam, "GB")
}

call SumFloats {
  input:
    sizes = mapped_bam_size,
}

.....
task SumFloats {
  Array[Float] sizes

  command <<<
  python -c "print ${sep="+" sizes}"
  >>>
  output {
    Float total_size = read_float(stdout())
  }
  runtime {
    docker: "python:2.7"
    preemptible: preemptible_tries
  }
}

@geoffjentry commented on Fri Sep 22 2017

@jsotobroad Please file this in the wdl repo, not the cromwell repo

@cjllanwarne
Copy link
Contributor

@katevoss @jsotobroad I think this is resolved by #169 - can we close this issue or are there other cases to cover?

@katevoss
Copy link
Contributor Author

katevoss commented Jul 6, 2018

Fine by me, @jsotobroad?

@dinvlad
Copy link

dinvlad commented Sep 20, 2018

Could you elaborate how #169 solves the general case of summing up Array[Float]? Perhaps we should revisit this.

@vdauwera vdauwera changed the title Summing up Array[Floats] Summing up the sizes of input files Apr 1, 2021
@vdauwera
Copy link
Member

vdauwera commented Apr 1, 2021

Closing since the feature requested here was delivered by #169.

@dinvlad Despite the somewhat misleading original issue title, the scope of the actual request was limited to summing up input file sizes. If there is a more general use case that you're interested in that has not yet been addressed by other work I think it should be a new issue.

@vdauwera vdauwera closed this as completed Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants