Skip to content

Commit

Permalink
Merge pull request cyclus#1 from bam241/fix
Browse files Browse the repository at this point in the history
fix reactor compilation
  • Loading branch information
jbae11 authored Feb 13, 2018
2 parents 9155a88 + 7fe389c commit ab2b96a
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 70 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ rs.cred
*.dat
tests/run_inputs.py
cyclus.sqlite
cycamore_version.h
recyle_version.h
*.sqlite
src/version.cc.in
src/version.cc.in
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ IF(NOT CYCLUS_DOC_ONLY)
TARGET_LINK_LIBRARIES(recycle_unit_tests
dl
${LIBS}
recycle
${CYCLUS_TEST_LIBRARIES}
)

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ You can run the tests yourself using:

.. code-block:: bash
$ cycamore_unit_tests
$ recyle_unit_tests
Cautions
========
Expand Down
2 changes: 1 addition & 1 deletion DEPENDENCIES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ installation procedure also assumes that you have root access to you computer.
.. _`Cyclus Homepage`: http://fuelcycle.org/
.. _`Cyclus User Guide`: http://fuelcycle.org/user/index.html
.. _`Cyclus repo`: https://github.com/cyclus/cyclus
.. _`Cycamore Repo`: https://github.com/cyclus/cycamore
.. _`Cycamore Repo`: https://github.com/cyclus/recyle
.. _Anaconda: https://www.continuum.io/downloads
.. _miniconda: http://conda.pydata.org/miniconda.html
.. _`dependency installation documentation`: https://github.com/cyclus/cyclus/blob/develop/DEPENDENCIES.rst
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ Quick Cycamore Installation
Assuming you have the dependencies installed correctly, installing Cyclus using
github is fairly straightforward:

- Clone the Cyclus Repo: ``git clone https://github.com/cyclus/cycamore.git``,
- Clone the Cyclus Repo: ``git clone https://github.com/cyclus/recyle.git``,

- to install Cyclus locally (in ``~/.local/``) just run: ``python install.py``
from cycamore folder,
from recyle folder,

- finally, add the following Cyclus installation path (``~/.local/cyclus``) to
the **bottom** on your ``$PATH``.
Expand All @@ -84,7 +84,7 @@ our tests). You can run the tests yourself via:

.. code-block:: bash
$ cycamore_unit_tests
$ recyle_unit_tests
******************************
Contributing
Expand All @@ -99,7 +99,7 @@ to contribute into Cyclus, please follow this procedure:

#. Implement your modification of the Cycamore source code,

#. Submit a Pull request into ``cycamore/master`` branch,
#. Submit a Pull request into ``recyle/master`` branch,

#. Wait for reviews/merge (the Puller cannot be the Merger).

Expand All @@ -109,7 +109,7 @@ You may also want to read our `Contribution Guidelines <CONTRIBUTING.rst>`_.
.. _`Cyclus Homepage`: http://fuelcycle.org/
.. _`Cyclus User Guide`: http://fuelcycle.org/user/index.html
.. _`Cyclus repo`: https://github.com/cyclus/cyclus
.. _`Cycamore Repo`: https://github.com/cyclus/cycamore
.. _`Cycamore Repo`: https://github.com/cyclus/recyle
.. _`INSTALL`: INSTALL.rst
.. _`CONTRIBUTING`: CONTRIBUTING.rst

20 changes: 10 additions & 10 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
build:
docker:
- image: cyclus/cyclus:latest
working_directory: ~/cycamore
working_directory: ~/recyle
steps:
# Ensure your image has git (required by git to clone via SSH) so that CircleCI can clone your repo
- run: apt-get -qq update; apt-get -y install git openssh-client
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
- v1-repo-{{ checksum ".circle-sha" }}
- run:
name: Unit Test
command: /root/.local/bin/cycamore_unit_tests; exit $?
command: /root/.local/bin/recyle_unit_tests; exit $?
nosetest:
docker:
- image: cyclus/cyclus:latest
Expand All @@ -57,14 +57,14 @@ jobs:
command: pip install nose
- run:
name: Nosetests
command: nosetests -w ~/cycamore/tests; exit $?
command: nosetests -w ~/recyle/tests; exit $?


# Update docker container
deploy: # Cycamore -> Cycamore:latest
docker:
- image: circleci/ruby:2.4-node
working_directory: ~/cycamore
working_directory: ~/recyle
steps:
- checkout
- run:
Expand All @@ -77,15 +77,15 @@ jobs:
docker login -u $DOCKER_USER -p $DOCKER_PASS
- run:
name: Build Docker container
command: docker build --rm=false -t cyclus/cycamore:latest .
command: docker build --rm=false -t cyclus/recyle:latest .
- run:
name: Push on DockerHub
command: docker push cyclus/cycamore:latest # push to docker depot
command: docker push cyclus/recyle:latest # push to docker depot

deploy_stable: # Cycamore:stable
docker:
- image: circleci/ruby:2.4-node
working_directory: ~/cycamore
working_directory: ~/recyle
steps:
- checkout
- run:
Expand All @@ -98,17 +98,17 @@ jobs:
docker login -u $DOCKER_USER -p $DOCKER_PASS
- run:
name: Build Docker container
command: docker build -t cyclus/cycamore:stable .
command: docker build -t cyclus/recyle:stable .
- run:
name: Push on DockerHub
command: docker push cyclus/cycamore:stable # push to docker depot
command: docker push cyclus/recyle:stable # push to docker depot


# Debian package generation (on master update)
deb_generation:
docker:
- image: circleci/ruby:2.4-node
working_directory: ~/cycamore
working_directory: ~/recyle
steps:
- checkout
- setup_remote_docker
Expand Down
6 changes: 3 additions & 3 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package:
name: cycamore
name: recyle
version: 0.0

# Only use fn and url for polyphemus compatability
source:
fn: cycamore-src.tar.gz # ["TRAVIS" not in environ]
url: https://github.com/cyclus/cycamore/archive/develop.tar.gz # ["TRAVIS" not in environ]
fn: recyle-src.tar.gz # ["TRAVIS" not in environ]
url: https://github.com/cyclus/recyle/archive/develop.tar.gz # ["TRAVIS" not in environ]
path: .. # ["TRAVIS" in environ]

requirements:
Expand Down
10 changes: 5 additions & 5 deletions conda-recipe/post-link.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This script replaces the cycamore_unit_tests commands with a simple
# This script replaces the recyle_unit_tests commands with a simple
# wrapper that will modify the user's environment as needed to point
# cyclus-sepcific envrionment variables to the conda install location $PREFIX.
# Conda packaging has three phases which come to a head here.
Expand All @@ -18,7 +18,7 @@ echo "post-link.sh, PREFIX: $PREFIX"
# The library path modifications are here because cyclus installs
# libgtest and libbaseagentunittests into the lib/cyclus directory.
# We make this directory the last possible location to be searched.
mv $PREFIX/bin/cycamore_unit_tests $PREFIX/bin/cycamore_unit_tests_base
mv $PREFIX/bin/recyle_unit_tests $PREFIX/bin/recyle_unit_tests_base
echo "#!/bin/bash
export LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH:$PREFIX/lib/cyclus\"
export DYLD_FALLBACK_LIBRARY_PATH=\"\$DYLD_FALLBACK_LIBRARY_PATH:$PREFIX/lib/cyclus\"
Expand All @@ -29,6 +29,6 @@ fi
if [ -z \"\$CYCLUS_RNG_SCHEMA\" ]; then
export CYCLUS_RNG_SCHEMA=\"$PREFIX/share/cyclus/cyclus.rng.in\"
fi
$PREFIX/bin/cycamore_unit_tests_base \$*
" > $PREFIX/bin/cycamore_unit_tests
chmod 755 $PREFIX/bin/cycamore_unit_tests
$PREFIX/bin/recyle_unit_tests_base \$*
" > $PREFIX/bin/recyle_unit_tests
chmod 755 $PREFIX/bin/recyle_unit_tests
6 changes: 3 additions & 3 deletions docker/deb-ci/Dockerfile_template
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ RUN wget -r --no-parent -A 'cyclus_1.5.0_*_ubuntu.CYCAMORE_UBUNTU_MAJOR_VERSION.
run mv dory.fuelcycle.org:4848/* ./; rm -rf dory.fuelcycle.org:4848
RUN dpkg -i cyclus_1.5.0_*_ubuntu.CYCAMORE_UBUNTU_MAJOR_VERSION.04.deb

COPY . /cycamore
WORKDIR cycamore
COPY . /recyle
WORKDIR recyle
RUN mkdir -p deb
WORKDIR /cycamore/deb
WORKDIR /recyle/deb
RUN cmake -DCPACK_PACKAGING_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_PREFIX=/usr/local -DCPACK_HASH_NAME=CYCAMORE_REPO_HASH -DCPACK_SYSTEM_NAME=ubuntu.CYCAMORE_UBUNTU_MAJOR_VERSION.04 ..

# Build the deb file in the docker container
Expand Down
4 changes: 2 additions & 2 deletions docker/deb-ci/build_upload_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ sed -i s/CYCAMORE_REPO_HASH/`git rev-parse --short HEAD`/g Dockerfile

docker build -t deb/ubuntu-${1} . # build cyclus against ubuntu 14.04 in the docker container
docker create --name=deb-${1}.04 deb/ubuntu-${1} # build deb in docker
docker cp deb-${1}.04:/cycamore/deb ./ # extract deb
scp ./deb/cycamore_*_ubuntu.${1}.04.deb [email protected]:./cyclus-deb/ # push the deb on dory
docker cp deb-${1}.04:/recyle/deb ./ # extract deb
scp ./deb/recyle_*_ubuntu.${1}.04.deb [email protected]:./cyclus-deb/ # push the deb on dory
rm -rf deb # clean the deb folder
4 changes: 2 additions & 2 deletions docker/master-ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM cyclus/cyclus:latest

COPY . /cycamore
WORKDIR /cycamore
COPY . /recyle
WORKDIR /recyle
ENV PATH="/root/.local/bin:${PATH}"
RUN python install.py -j 2 --build-type=Release \
-DBLAS_LIBRARIES="/opt/conda/lib/libblas.so" \
Expand Down
6 changes: 3 additions & 3 deletions docker/release-ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

FROM cyclus/cyclus:stable

COPY . /cycamore
WORKDIR /cycamore
COPY . /recyle
WORKDIR /recyle
RUN mkdir Release
WORKDIR /cycamore/Release
WORKDIR /recyle/Release
RUN cmake .. -DCMAKE_BUILD_TYPE=Release
RUN make -j2 && make install

4 changes: 2 additions & 2 deletions src/enrichment.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef RECYLCLE_SRC_ENRICHMENT_H_
#define RECYLCLE_SRC_ENRICHMENT_H_
#ifndef RECYCLE_SRC_ENRICHMENT_H_
#define RECYCLE_SRC_ENRICHMENT_H_

#include <string>

Expand Down
7 changes: 1 addition & 6 deletions src/reactor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ void Reactor::EnterNotify() {
}
}

// calculate depletion frequency per timestep
dep_freq = fllor(context()->dt() / )

// input consistency checking:
int n = recipe_change_times.size();
std::stringstream ss;
Expand Down Expand Up @@ -115,11 +112,9 @@ void Reactor::Tick() {
// record the last time series entry if the reactor was operating at the
// time of retirement.
if (exit_time() == context()->time()) {
if (cycle_step > 0 && cycle_step < cycle_time &&
if (cycle_step > 0 && cycle_step <= cycle_time &&
core.count() == n_assem_core) {
cyclus::toolkit::RecordTimeSeries<cyclus::toolkit::POWER>(this, power_cap);
} else if (refuel_time == 0 && core.count() == n_assem_core) {
cyclus::toolkit::RecordTimeSeries<cyclus::toolkit::POWER>(this, power_cap);
} else {
cyclus::toolkit::RecordTimeSeries<cyclus::toolkit::POWER>(this, 0);
}
Expand Down
9 changes: 0 additions & 9 deletions src/recycle_version.h

This file was deleted.

6 changes: 3 additions & 3 deletions tests/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Dependencies
Running Tests
-------------

To run the regression tests from the cycamore/tests:
To run the regression tests from the recyle/tests:

.. code-block:: bash
Expand Down Expand Up @@ -43,13 +43,13 @@ Next, rename the databases:

.. code-block:: bash
$ rename 's/^[^_]*_[^_]*_(.*)/<cyclus version>_<cycamore version>_$1/' *.h5
$ rename 's/^[^_]*_[^_]*_(.*)/<cyclus version>_<recyle version>_$1/' *.h5
where

* <cyclus version> is replaced by the current version tag name for cyclus
(e.g. v0.1)
* <cycamore version> is replaced by the current version tag name for cycamore
* <recyle version> is replaced by the current version tag name for recyle
(e.g. v0.1)

so that, using the above examples, the command is
Expand Down
6 changes: 3 additions & 3 deletions tests/input/dynamic_capacitated.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<solver><config><coin-or><timeout>100</timeout><verbose>1</verbose></coin-or></config></solver></control>

<archetypes>
<spec><lib>cycamore</lib><name>Sink</name></spec>
<spec><lib>cycamore</lib><name>Source</name></spec>
<spec><lib>recyle</lib><name>Sink</name></spec>
<spec><lib>recyle</lib><name>Source</name></spec>
<spec><lib>agents</lib><name>NullRegion</name></spec>
<spec><lib>cycamore</lib><name>DeployInst</name></spec>
<spec><lib>recyle</lib><name>DeployInst</name></spec>
</archetypes>

<facility>
Expand Down
8 changes: 4 additions & 4 deletions tests/input/growth.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@

<archetypes>
<spec>
<lib>cycamore</lib>
<lib>recyle</lib>
<name>Source</name>
</spec>
<spec>
<lib>cycamore</lib>
<lib>recyle</lib>
<name>Sink</name>
</spec>
<spec>
<lib>cycamore</lib>
<lib>recyle</lib>
<name>GrowthRegion</name>
</spec>
<spec>
<lib>cycamore</lib>
<lib>recyle</lib>
<name>ManagerInst</name>
</spec>
</archetypes>
Expand Down
12 changes: 6 additions & 6 deletions tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def __init__(self, *args, **kwargs):
def setUp(self):
super(_PhysorEnrichment, self).setUp()
tbl = self.agent_entry
self.rx_id = self.find_ids(":cycamore:Reactor", tbl)
self.enr_id = self.find_ids(":cycamore:Enrichment", tbl)
self.rx_id = self.find_ids(":recyle:Reactor", tbl)
self.enr_id = self.find_ids(":recyle:Enrichment", tbl)

def test_deploy(self):
assert_equal(len(self.rx_id), 2)
Expand Down Expand Up @@ -190,9 +190,9 @@ def setUp(self):

# identify each reactor and supplier by id
tbl = self.agent_entry
rx_id = self.find_ids(":cycamore:Reactor", tbl)
rx_id = self.find_ids(":recyle:Reactor", tbl)
self.r1, self.r2, self.r3 = tuple(rx_id)
s_id = self.find_ids(":cycamore:Source", tbl)
s_id = self.find_ids(":recyle:Source", tbl)
self.smox = self.transactions[0]["SenderId"]
s_id.remove(self.smox)
self.suox = s_id[0]
Expand Down Expand Up @@ -294,8 +294,8 @@ def setUp(self):
self.depl_time = self.to_ary(self.agent_entry, "EnterTime")
self.exit_time = self.to_ary(self.agent_exit, "ExitTime")
self.exit_ids = self.to_ary(self.agent_exit, "AgentId")
self.source_id = self.find_ids(":cycamore:Source", self.agent_entry)
self.sink_id = self.find_ids(":cycamore:Sink", self.agent_entry)
self.source_id = self.find_ids(":recyle:Source", self.agent_entry)
self.sink_id = self.find_ids(":recyle:Sink", self.agent_entry)

# Check transactions
self.sender_ids = self.to_ary(self.transactions, "SenderId")
Expand Down

0 comments on commit ab2b96a

Please sign in to comment.