Skip to content

Commit

Permalink
Fixed import errors
Browse files Browse the repository at this point in the history
  • Loading branch information
awicenec committed Feb 1, 2023
1 parent 7c29232 commit 93ec2f1
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 15 deletions.
11 changes: 8 additions & 3 deletions daliuge-engine/dlg/apps/archiving.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
# MA 02111-1307 USA
#
import logging
from ..drop import BarrierAppDROP, ContainerDROP
from dlg.apps.app_base import BarrierAppDROP
from dlg.data.drops.container import ContainerDROP
from ..droputils import DROPFile
from dlg.data.io import NgasIO, OpenMode, NgasLiteIO
from ..meta import (
Expand Down Expand Up @@ -60,7 +61,9 @@ def run(self):

# Check that the constrains are correct
if self.outputs:
raise Exception("No outputs should be declared for this application")
raise Exception(
"No outputs should be declared for this application"
)
if len(self.inputs) != 1:
raise Exception("Only one input is expected by this application")

Expand Down Expand Up @@ -150,7 +153,9 @@ def store(self, inDrop):
mimeType=self.ngasMime,
)
except ImportError:
logger.warning("NgasIO library not available, falling back to NgasLiteIO.")
logger.warning(
"NgasIO library not available, falling back to NgasLiteIO."
)
ngasIO = NgasLiteIO(
self.ngasSrv,
inDrop.uid,
Expand Down
2 changes: 1 addition & 1 deletion daliuge-engine/dlg/apps/constructs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from dlg.drop import BarrierAppDROP
from dlg.apps.app_base import BarrierAppDROP

##
# @brief Scatter
Expand Down
26 changes: 20 additions & 6 deletions daliuge-engine/dlg/apps/mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import subprocess
import sys

from ..drop import BarrierAppDROP
from dlg.apps.app_base import BarrierAppDROP
from ..exceptions import InvalidDropException

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -103,25 +103,39 @@ def run(self):
vendor, version = MPI.get_vendor() # @UndefinedVariable
info = MPI.Info.Create() # @UndefinedVariable
logger.debug(
"MPI vendor is %s, version %s", vendor, ".".join([str(x) for x in version])
"MPI vendor is %s, version %s",
vendor,
".".join([str(x) for x in version]),
) # @UndefinedVariable
comm_children = MPI.COMM_SELF.Spawn(
cmd, args=args, maxprocs=self._maxprocs, errcodes=errcodes, info=info
cmd,
args=args,
maxprocs=self._maxprocs,
errcodes=errcodes,
info=info,
) # @UndefinedVariable

n_children = comm_children.Get_remote_size()
logger.info("%d MPI children apps spawned, gathering exit data", n_children)
logger.info(
"%d MPI children apps spawned, gathering exit data", n_children
)

if self._use_wrapper:
children_data = comm_children.gather(
("", "", 0), root=MPI.ROOT
) # @UndefinedVariable
exit_codes = [x[2] for x in children_data]
logger.info("Exit codes gathered from children processes: %r", exit_codes)
logger.info(
"Exit codes gathered from children processes: %r", exit_codes
)

any_failed = False
for rank, (stdout, stderr, code) in enumerate(children_data):
self._recompute_data[str(rank)] = [code, str(stdout), str(stderr)]
self._recompute_data[str(rank)] = [
code,
str(stdout),
str(stderr),
]
if code == 0:
continue
any_failed = True
Expand Down
8 changes: 3 additions & 5 deletions daliuge-engine/dlg/apps/scp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
# MA 02111-1307 USA
#
from dlg.remote import copyTo, copyFrom
from dlg.drop import (
BarrierAppDROP,
NullDROP,
ContainerDROP,
)
from dlg.apps.app_base import BarrierAppDROP
from dlg.data.drops.data_base import NullDROP
from dlg.data.drops.container import ContainerDROP
from dlg.data.drops.rdbms import RDBMSDrop
from dlg.data.drops.memory import InMemoryDROP, SharedMemoryDROP
from dlg.data.drops.ngas import NgasDROP
Expand Down

0 comments on commit 93ec2f1

Please sign in to comment.