__author__ = 'mcsquaredjr'

import os

node_file = os.environ["NODES"]
cad_file = os.environ["CAD"]
procs_per_nod = os.environ["PROCS_PER_NODE"]


def my_lines(ip):
    with open(cad_file, "r") as cad:
        lines = []
        for line in cad:
            ip, port = line.split(":")
            if ip == str(ip):
                line.append(line)


def chunk_number(i):
    if i == 0 or i == 1:
        return 0
    else:
        return i -1


def chunk_count(i):
    with open(cad_file) as cad:
        for i, l in enumerate(cad):
            pass
    return i + 1
__author__ = 'mcsquaredjr'

import os
import socket

node_file = os.environ["NODES"]
cad_file = os.environ["CAD"]
procs_per_nod = os.environ["PROCS_PER_NODE"]
itemcount = os.environ["ITEMCOUNT"]
ddp = os.environment["DDP"]



def my_lines(i):
    ip = socket.gethostbyname(socket.gethostname())
    with open(cad_file, "r") as cad:
        lines = []
        for line in cad:
            ip_str, port = line.split(":")
            if ip_str == str(ip):
                lines.append(line)


def chunk_number(i):
    if i == 0 or i == 1:
        return 0
    else:
        return i -1


def chunk_count(i):
    with open(cad_file) as cad:
        for i, l in enumerate(cad):
            pass
    return i + 1 - 2
Add more variables and bug fixes
Add more variables and bug fixes

  __author__ = 'mcsquaredjr'
  
  import os
+ import socket
  
  node_file = os.environ["NODES"]
  cad_file = os.environ["CAD"]
  procs_per_nod = os.environ["PROCS_PER_NODE"]
+ itemcount = os.environ["ITEMCOUNT"]
+ ddp = os.environment["DDP"]
  
  
+ 
- def my_lines(ip):
+ def my_lines(i):
+     ip = socket.gethostbyname(socket.gethostname())
      with open(cad_file, "r") as cad:
          lines = []
          for line in cad:
-             ip, port = line.split(":")
+             ip_str, port = line.split(":")
-             if ip == str(ip):
+             if ip_str == str(ip):
-                 line.append(line)
+                 lines.append(line)
  
  
  def chunk_number(i):
      if i == 0 or i == 1:
          return 0
      else:
          return i -1
  
  
  def chunk_count(i):
      with open(cad_file) as cad:
          for i, l in enumerate(cad):
              pass
-     return i + 1
+     return i + 1 - 2
Add more variables and bug fixes
## Code Before:
__author__ = 'mcsquaredjr'

import os

node_file = os.environ["NODES"]
cad_file = os.environ["CAD"]
procs_per_nod = os.environ["PROCS_PER_NODE"]


def my_lines(ip):
    with open(cad_file, "r") as cad:
        lines = []
        for line in cad:
            ip, port = line.split(":")
            if ip == str(ip):
                line.append(line)


def chunk_number(i):
    if i == 0 or i == 1:
        return 0
    else:
        return i -1


def chunk_count(i):
    with open(cad_file) as cad:
        for i, l in enumerate(cad):
            pass
    return i + 1
## Instruction:
Add more variables and bug fixes
## Code After:
__author__ = 'mcsquaredjr'

import os
import socket

node_file = os.environ["NODES"]
cad_file = os.environ["CAD"]
procs_per_nod = os.environ["PROCS_PER_NODE"]
itemcount = os.environ["ITEMCOUNT"]
ddp = os.environment["DDP"]



def my_lines(i):
    ip = socket.gethostbyname(socket.gethostname())
    with open(cad_file, "r") as cad:
        lines = []
        for line in cad:
            ip_str, port = line.split(":")
            if ip_str == str(ip):
                lines.append(line)


def chunk_number(i):
    if i == 0 or i == 1:
        return 0
    else:
        return i -1


def chunk_count(i):
    with open(cad_file) as cad:
        for i, l in enumerate(cad):
            pass
    return i + 1 - 2