Repository: Parsl/parsl

Issue:
Differentiate between managers and workers in exex log names
This will make grepping around logs more straightforward.


Discussion:

Resolving patch:
diff --git a/parsl/executors/extreme_scale/mpi_worker_pool.py b/parsl/executors/extreme_scale/mpi_worker_pool.py
--- a/parsl/executors/extreme_scale/mpi_worker_pool.py
+++ b/parsl/executors/extreme_scale/mpi_worker_pool.py
@@ -319,7 +319,7 @@ def start(self):
                 task = self.pending_task_queue.get()
                 comm.send(task, dest=worker_rank, tag=worker_rank)
                 task_sent_counter += 1
-                logger.debug("Assigning Worker:{} task:{}".format(worker_rank, task['task_id']))
+                logger.debug("Assigning worker:{} task:{}".format(worker_rank, task['task_id']))
 
             if not start:
                 start = time.time()
@@ -393,7 +393,7 @@ def worker(comm, rank):
         req = comm.recv(source=0, tag=rank)
         logger.debug("Got req: {}".format(req))
         tid = req['task_id']
-        logger.debug("Got task : {}".format(tid))
+        logger.debug("Got task: {}".format(tid))
 
         try:
             result = execute_task(req['buffer'])
@@ -402,7 +402,7 @@ def worker(comm, rank):
             logger.debug("No result due to exception: {} with result package {}".format(e, result_package))
         else:
             result_package = {'task_id': tid, 'result': serialize_object(result)}
-            logger.debug("Result : {}".format(result))
+            logger.debug("Result: {}".format(result))
 
         pkl_package = pickle.dumps(result_package)
         comm.send(pkl_package, dest=0, tag=RESULT_TAG)
@@ -480,7 +480,7 @@ def set_stream_logger(name='parsl', level=logging.DEBUG, format_string=None):
 
     comm = MPI.COMM_WORLD
     rank = comm.Get_rank()
-    print("Start rank :", rank)
+    print("Starting rank: {}".format(rank))
 
     try:
         os.makedirs(args.logdir)
@@ -490,7 +490,7 @@ def set_stream_logger(name='parsl', level=logging.DEBUG, format_string=None):
     # set_stream_logger()
     try:
         if rank == 0:
-            start_file_logger('{}/mpi_rank.{}.log'.format(args.logdir, rank),
+            start_file_logger('{}/manager.mpi_rank_{}.log'.format(args.logdir, rank),
                               rank,
                               level=logging.DEBUG if args.debug is True else logging.INFO)
 
@@ -506,13 +506,13 @@ def set_stream_logger(name='parsl', level=logging.DEBUG, format_string=None):
             logger.debug("Finalizing MPI Comm")
             comm.Abort()
         else:
-            start_file_logger('{}/mpi_rank.{}.log'.format(args.logdir, rank),
+            start_file_logger('{}/worker.mpi_rank_{}.log'.format(args.logdir, rank),
                               rank,
                               level=logging.DEBUG if args.debug is True else logging.INFO)
             worker(comm, rank)
     except Exception as e:
         logger.critical("mpi_worker_pool exiting from an exception")
-        logger.exception("Caught error : {}".format(e))
+        logger.exception("Caught error: {}".format(e))
         raise
     else:
         logger.info("mpi_worker_pool exiting")


Test patch: