Skip to content

Commit

Permalink
fix: added configurable buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Aug 13, 2024
1 parent 8612cf7 commit 740e9c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import random
import tempfile

from DIRAC import S_ERROR, S_OK, gLogger
from DIRAC import S_ERROR, S_OK, gConfig, gLogger
from DIRAC.ConfigurationSystem.Client.PathFinder import getSystemSection
from DIRAC.Core.Utilities.Os import getDiskSpace
from DIRAC.Core.Utilities.ReturnValues import returnSingleResult
from DIRAC.DataManagementSystem.Utilities.DMSHelpers import DMSHelpers
Expand Down Expand Up @@ -227,9 +228,9 @@ def __checkDiskSpace(self, totalSize):
"""
diskSpace = getDiskSpace(self.__getDownloadDir(False)) # MB
availableBytes = diskSpace * 1024 * 1024 # bytes
# below can be a configuration option sent via the job wrapper in the future
# Moved from 3 to 5 GB (PhC 130822) for standard output file
bufferGBs = 5.0
bufferGBs = gConfig.getValue(
os.path.join(getSystemSection("WorkloadManagement/JobWrapper"), "JobWrapper", "InputDataBufferGBs"), 5.0
)
data = bufferGBs * 1024 * 1024 * 1024 # bufferGBs in bytes
if (data + totalSize) < availableBytes:
msg = f"Enough disk space available ({availableBytes} bytes)"
Expand Down
2 changes: 2 additions & 0 deletions tests/Jenkins/dirac-cfg-update-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,8 @@
# to avoid having to wait while testing rescheduling
csAPI.setOption("Systems/WorkloadManagement/Production/Executors/Optimizers/JobScheduling/RescheduleDelays", "0")

csAPI.createSection("Systems/WorkloadManagement/Production/JobWrapper/")
csAPI.setOption("Systems/WorkloadManagement/Production/JobWrapper/InputDataBufferGBs", 1)

# Final action: commit in CS
res = csAPI.commit()
Expand Down

0 comments on commit 740e9c1

Please sign in to comment.