Skip to content

Commit

Permalink
Merge remote-tracking branch 'diging/pypar-check' into py3
Browse files Browse the repository at this point in the history
  • Loading branch information
bcdaniels committed Apr 13, 2022
2 parents 42e3f99 + a540e3e commit c4e683c
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 15 deletions.
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM ubuntu:latest
RUN apt-get update && apt-get -y update
FROM python:2
ARG DEBIAN_FRONTEND=noninteractive
RUN mkdir app
RUN apt-get update -y && \
apt-get install -y --no-install-recommends sudo apt-utils && \
apt-get install -y --no-install-recommends openssh-server \
python-dev python-numpy python-pip python-virtualenv python-scipy \
gcc gfortran libopenmpi-dev openmpi-bin openmpi-common openmpi-doc binutils && \
apt-get clean && apt-get purge && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /app
RUN useradd --create-home --home-dir /home/docker --shell /bin/bash docker
RUN usermod -a -G sudo docker
RUN echo "docker ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN wget http://www.open-mpi.org/software/ompi/v4.1/downloads/openmpi-4.1.1.tar.gz
RUN tar xzvf openmpi-4.1.1.tar.gz
WORKDIR openmpi-4.1.1
RUN ./configure --prefix=/usr/local/openmpi4.1.1
RUN make all
RUN make install
RUN MPI_DIR=/usr/local/openmpi4.1.1
ENV LD_LIBRARY_PATH="${MPI_DIR}/lib:${LD_LIBRARY_PATH}"
ENV PATH="/usr/local/openmpi4.1.1/bin:${PATH}"
RUN git clone https://github.com/mpi4py/mpi4py.git ./mpi4py.git
WORKDIR mpi4py.git
RUN python setup.py build --mpicc=/usr/local/openmpi4.1.1/bin/mpicc
RUN python setup.py install
WORKDIR /app
RUN apt-get -y update && apt -y install libopenmpi-dev

RUN pip install numpy
RUN pip install jupyter notebook
RUN git clone -b mpi4py-convesion https://github.com/diging/SloppyCell.git
RUN pip install -e SloppyCell/
RUN git clone -b pypar-check https://github.com/diging/SirIsaac.git
RUN pip install -e SirIsaac/
CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root"]
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,31 @@ Bryan Daniels, Ilya Nemenman



OpenMPI Installation

Download the latest version(4.1.1) from https://www.open-mpi.org/software/ompi/v4.1/
Refer the Building MPI from sources section for the installation.

Another source for OpenMPI Installation - https://gist.github.com/mrosemeier/088115b2e34f319b913a

Other Installations that were done for Ubuntu

pip install mpi4py

sudo apt-get install python-dev \
build-essential libssl-dev libffi-dev \
libxml2-dev libxslt1-dev zlib1g-dev \


sudo apt install libopenmpi-dev

sudo apt-get install python2.7-dev
sudo apt-get install build-essential
sudo apt-get install gcc
sudo apt-get install python-dev gcc
sudo apt-get install python2-dev build-essential gcc libpq-dev
sudo apt-get install libblas-dev libatlas-base-dev
sudo apt-get install build-essential gcc gfortran git
sudo apt install gfortran


10 changes: 4 additions & 6 deletions SirIsaac/fittingProblem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1807,9 +1807,9 @@ def localFitToData_parallel(self,numprocs,fittingData,dataModel,

# call mpi
stdoutFile = open(prefix+"stdout.txt",'w')
subprocess.call([ "mpirun","--oversubscribe", "-np",str(numprocs),"python",
subprocess.call([ "mpirun","-np",str(numprocs),"--allow-run-as-root","python",
os.path.join(SIRISAACDIR, "localFitParallel.py"),
inputDictFilename],
inputDictFilename ],
stderr=stdoutFile,stdout=stdoutFile,env=os.environ)
stdoutFile.close()
os.remove(inputDictFilename)
Expand Down Expand Up @@ -2630,9 +2630,9 @@ def generateEnsemble_parallel(self,numprocs,dataModel,initialParameters,
# https://stackoverflow.com/questions/60060142/strange-interaction-
# between-h5py-subprocess-and-mpirun
stdoutFile = open(prefix+"stdout.txt",'w')
subprocess.call([ "mpirun","--oversubscribe", "-np",str(numprocs),"python",
subprocess.call([ "mpirun","-np",str(numprocs),"--allow-run-as-root","python",
os.path.join(SIRISAACDIR, "generateEnsembleParallel.py"),
inputDictFilename],
inputDictFilename ],
stderr=stdoutFile,stdout=stdoutFile,env=os.environ)
stdoutFile.close()
os.remove(inputDictFilename)
Expand Down Expand Up @@ -4683,5 +4683,3 @@ def __init__(self,outputNameList,indepParamNames=[],**kwargs):
# generalSetup should be run by all daughter classes
self.generalSetup(net,indepParamNames,**kwargs)



18 changes: 9 additions & 9 deletions SirIsaac/localFitParallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@

## 7.3.2012 disable SloppyCell's parallel stuff
## see SloppyCell's __init__.py
# sc = IO.SloppyCell
# modules = [ sc,sc.ReactionNetworks,Ensembles,Dynamics,
# Collections,PerfectData ]
# import socket
# for module in modules:
# module.HAVE_MPI = False
# module.num_procs = 1
# module.my_rank = 0
# module.my_host = socket.gethostname()
sc = IO.SloppyCell
modules = [ sc,sc.ReactionNetworks,Ensembles,Dynamics,
Collections,PerfectData ]
import socket
for module in modules:
module.HAVE_MPI = False
module.num_procs = 1
module.my_rank = 0
module.my_host = socket.gethostname()

# Constants
MASTER_PROCESS = 0
Expand Down

0 comments on commit c4e683c

Please sign in to comment.