Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
codes
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 38
    • Issues 38
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 8
    • Merge Requests 8
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • codes
  • codes
  • Wiki
  • codes cortex python translation

codes cortex python translation

Last edited by Matthieu Dorier Dec 16, 2016
Page history

Running CODES with DUMPI and Python translations

If you want to couple the use of DUMPI traces but write your own translation functions in Python, start by making sure Section III works.

Instead of providing a generator function in your Python script, provide translation functions. For example, a possible translation for MPI_Bcast would be:

import cortex

def MPI_Bcast(self, thread, **args):

   dtype = args['datatype']
   root  = args['root']
   comm  = args['comm']
   count = args['count']

   print "MPI_Bcast called in Python, root = ", root

   if not cortex.is_mpi_comm_world(comm):
       print "Communicator is not MPI_COMM_WORLD, not translating"
       return

   if thread != root :
       s = cortex.MPI_Status()
       cortex.MPI_Recv(thread,count=count,datatype=dtype,source=root,tag=1234,comm=comm,status=s)
   else :
       size = cortex.world_size()
       for i in range(size):
           if i != thread:
            cortex.MPI_Send(thread,count=count,datatype=dtype,dest=i,tag=1234,comm=comm)

Let's call this script MyTranslator.py.

Set up the DUMPI traces folder as explained in the previous pages of this tutorial. Then the following bash script should help you run your experiments:

#!/bin/sh

TRACE_DIR="traces/neurones"
TRACE_PFX="dumpi-2016.09.14.15.05.22-"
OUTPUT_DIR="results"
PYTHON_MOD=MyTranslator

CODES="$HOME/CODES/install/codes/bin/model-net-mpi-replay"
NUM_TRACES=`ls -l $TRACE_DIR/$TRACE_PFX* | wc -l`

PARAMS="--sync=1 \
        --num_net_traces=$NUM_TRACES \
        --workload_file=$TRACE_DIR/$TRACE_PFX \
        --lp-io-dir=$OUTPUT_DIR \
        --lp-io-use-suffix=1 \
        --workload_type=dumpi \
        --alloc_file=alloc.conf  \
        --cortex-file=$PYTHON_MOD"

CONFIG="config.conf"

$CODES $PARAMS -- $CONFIG
Clone repository
  • Dragonfly Plus
  • Optimistic Performance Tuning Tips
  • Quality of Service
  • Using ROSS Instrumentation with CODES
  • build on theta
  • codes allocations
  • codes best practices
  • codes configuration
  • codes cortex install
  • codes cortex python gen
  • codes cortex python translation
  • codes cortex translation
  • codes cortex workload
  • codes dragonfly old
  • codes dragonfly
View All Pages