Git Product home page Git Product logo

repast4py's Introduction

Repast for Python (Repast4Py)

codecov

Build Status

Master Develop
Build Status Build Status

Repast4Py

Repast for Python (Repast4Py) is the newest member of the Repast Suite of free and open source agent-based modeling and simulation software. It builds on Repast HPC, and provides the ability to build large, distributed agent-based models (ABMs) that span multiple processing cores. Distributed ABMs enable the development of complex systems models that capture the scale and relevant details of many problems of societal importance. Where Repast HPC is implemented in C++ and is more HPC expert focused, Repast4Py is a Python package and is designed to provide an easier on-ramp for researchers from diverse scientific communities to apply large-scale distributed ABM methods. Repast4Py is released under the BSD-3 open source license, and leverages Numba, NumPy, and PyTorch packages, and the Python C API to create a scalable modeling system that can exploit the largest HPC resources and emerging computing architectures. See our paper on Repast4Py for additional information about the design and implementation.

Collier, N. T., Ozik, J., & Tatara, E. R. (2020). Experiences in Developing a Distributed Agent-based Modeling Toolkit with Python. 2020 IEEE/ACM 9th Workshop on Python for High-Performance and Scientific Computing (PyHPC), 1–12. https://doi.org/10.1109/PyHPC51966.2020.00006

Requirements

Repast4Py requires Python 3.7+

Repast4Py can run on Linux, macOS and Windows provided there is a working MPI implementation installed and mpi4py is supported. Repast4Py is developed and tested on Linux. We recommend that Windows users use the Windows Subsystem for Linux (WSL). Installation instructions for WSL can be found here.

Under Linux, MPI can be installed using your OS's package manager. For example, under Ubuntu 20.04 (and thus WSL), the mpich MPI implementation can be installed with:

$ sudo apt install mpich

Installation instructions for MPI on macOS can be found here.

A typical campus cluster, or HPC resource will have MPI and mpi4py installed. Check the resource's documentation on available software for more details.

Installation

Repast4Py can be downloaded and installed from PyPI using pip. Since Repast4Py includes native MPI C++ code that needs to be compiled, the C compiler CC environment variable must be set to the mpicxx (or mpic++) compiler wrapper provided by your MPI installation.

env CC=mpicxx pip install repast4py

NOTE: If you see an error message about a missing python.h header file when installing Repast4Py under Ubuntu (or other Linuxes), you will need to install a python dev package using your OS's package manager. For example, assuming Python 3.8, sudo apt install python3.8-dev will work for Ubuntu.

Documentation

Contact and Support

In addition to filing issues on GitHub, support is also available via Stack Overflow. Please use the repast4py tag to ensure that we are notified of your question. Software announcements will be made on the repast-interest mailing list.

Jonathan Ozik is the Repast project lead. Please contact him through the Argonne Staff Directory if you have project-related questions.

repast4py's People

Contributors

ncollier avatar dsheeler avatar jozik avatar rimersara avatar etatara avatar

Stargazers

Jon Lester avatar Matteo Manzi avatar Sergei Wallace avatar Lukasz Kowalski avatar Chenyang Wu avatar RainGather avatar  avatar Paola Arce avatar Jose Deodoro de Oliveira Filho avatar Elizabeth Koning avatar  avatar Behnam Nikparvar avatar Koray Aksu avatar  avatar Minseok Kim avatar Arnau Quera-Bofarull avatar Tianyu Du avatar Giovanni M Perez avatar Keisuke Hashimoto avatar  avatar Aldo Glielmo avatar Jonas Borges Alves avatar Aly van D avatar  avatar pizhigang avatar  avatar zerosnacks avatar Tegridy avatar Gabriel Dragomir avatar Adriano Meligrana avatar Alejo BS avatar Eduardo Lacerda avatar James B. Pollack, MFA  avatar James Smith avatar Alex Komoroske avatar Sebrian Beselly avatar Alex Van Plantinga avatar David Nicholson avatar  avatar Benedikt Lüken-Winkels avatar Ethan Lin avatar Peter Heywood avatar lelandyan avatar CK avatar mole-h-6011 avatar Josh Winters avatar

Watchers

Antouan Anguelov avatar  avatar  avatar  avatar

repast4py's Issues

Request Agent Example

An example of requesting agents would be useful, as the API docs are maybe not enough for new users here.

ValueLayer Synchronization

Use the buffer ngh data to synch the relevant part of the tensor matrix.

  1. Translate the buffer envelope into a tensor slice / index
  2. Select from the tensor and transform to np.array
  3. Send the np.array neighbor with info about which part of the tensor matrix to update
  4. Update tensor matrix with the received data

Open Questions

  • Is 3D buffer sync tested? (SharedContextTests test 2D buffer sync for continuous and grid)
  • Is periodic boundary tested with buffers?

Scheduling at Tick 0 ignored

From a user:

I notice that with v. 1.1.0, if the first "at" of the schedule is 0 it is skipped and the execution starts with the next one.
Also the same actions at intervals +1 do not operate. With the previous version, this was not happening.

How to merge / show all agents from all the cores in a single plot

Hi, me again.
im running a simulation via matplot.pyplot.plot lib, but my image shows only the agents on the space in the current rank /bounds per tick. What's needed to show all the agents on the space for all the cores simultaneously per tick and on a single Image file.

Example below - Tick 1

Rank 0 Image
img12

Rank 1 Image
img13

Wanted: All ranks Image
imagen

Thanks for your time
Alex

Network edge count/iter performance testing

The networkx graph API for getting the in and out edges appear to be costly, e.g.:

in_count = len(self.network.graph.in_edges(person))
out_count = len(self.network.graph.in_edges(person))

are pretty slow for large networks (30,000 nodes and 15,000 edges). We should investigate if there are
more efficient API calls in networkx that provide edge counts, and edge views in general, as in iterating over
agent network edges like

donor_list = [x for x,_ in self.network.graph.in_edges(self)]

Furthermore, we might want to provide repast4py network API for these functions so the user doesn't need to reference the underlying networkx graph.

Single process GIS support

Provide support for GIS on a single process, in a way that is similar to the RepastS Geography projection. Single-process GIS will come with the caveat that the Geography won't automatically move agents across process and should only be used on a 0-rank model.

At minimum, this should include:

  • Geography projection or container
  • Add / move / remove agent - geography pairs to the geography
  • Get agent geometry from Geography
  • Spatial index in geography for spatial queries of objects within bounding box
  • Coordinate Reference System (CRS) support in Geography
  • Shapefile loading and/or agent-factory from shapefile feature data

Python packages for implementation:

Cascading splits in spatial tree code

We use a quad tree in the continuous space for efficient bounds queries, which are necessary when populating the buffered areas between processes, and for fast (or at least faster) get_agents_within queries. The threshold argument to the SharedCSpace specifies the maximum capacity for a node in the tree. When this capacity is met, the node splits, and the agent locations in that node are allocated to the newly created children. When the number of agents at a single point >= the threshold, the splitting will occur every time an agent is added to that point. The splitting also doesn’t actually accomplish anything, given that agents are all on a single point. The branch at that point gets longer and longer, and so the time it takes to add (and to a lesser extent to remove) agents also takes longer and longer.

Possible Fixes:

  1. Make sure user has large enough threshold - warning message when some tree depth is reached
  2. Threshold should be for number of different points in the node's items rather than raw agent count
  3. User specifiable max depth
  4. Allow user to choose among these with 1. being a default

Note that 2. would require storing the number of agents at each point and incrementing / decrementing that when agents are added and removed.

A bug in DirectedSharedNetwork.graph

Let's assume we have a directed network with 3 nodes in 3 different processors (ranks). For instance, consider the following network.

network 1
1 0 0
2 0 1
3 0 2
EDGES
1 2
1 3

For finding the neighboring nodes with DirectedSharedNetwork.graph.successors() or predecessors(), it will return agents from one rank and ignore neighboring agents in other ranks. for example

DirectedSharedNetwork.graph.successors(self.context.agent(1,0,0))

will return Agent(3,0,2) and not [Agent(3,0,2) , Agent(2,0,1)]. This is also the case with the undirected graph and UndirectedSharedNetwork.graph.neighbors(). Therefore I also think the rumor example results are not correct.

Install Error on Ubuntu 22.10

Looks like numeric_liimits has moved in gcc included with Ubuntu 22.10

Building wheels for collected packages: repast4py
  Building wheel for repast4py (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for repast4py (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [44 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/repast4py
      copying src/repast4py/network.py -> build/lib.linux-x86_64-cpython-310/repast4py
      copying src/repast4py/context.py -> build/lib.linux-x86_64-cpython-310/repast4py
      copying src/repast4py/util.py -> build/lib.linux-x86_64-cpython-310/repast4py
      copying src/repast4py/geometry.py -> build/lib.linux-x86_64-cpython-310/repast4py
      copying src/repast4py/parameters.py -> build/lib.linux-x86_64-cpython-310/repast4py
      copying src/repast4py/space.py -> build/lib.linux-x86_64-cpython-310/repast4py
      copying src/repast4py/logging.py -> build/lib.linux-x86_64-cpython-310/repast4py
      copying src/repast4py/schedule.py -> build/lib.linux-x86_64-cpython-310/repast4py
      copying src/repast4py/__init__.py -> build/lib.linux-x86_64-cpython-310/repast4py
      copying src/repast4py/core.py -> build/lib.linux-x86_64-cpython-310/repast4py
      copying src/repast4py/random.py -> build/lib.linux-x86_64-cpython-310/repast4py
      copying src/repast4py/value_layer.py -> build/lib.linux-x86_64-cpython-310/repast4py
      running build_ext
      building 'repast4py._core' extension
      creating build/temp.linux-x86_64-cpython-310
      creating build/temp.linux-x86_64-cpython-310/src
      creating build/temp.linux-x86_64-cpython-310/src/repast4py
      mpicxx -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/tmp/pip-build-env-keuzsatk/overlay/lib/python3.10/site-packages/numpy/core/include -I/tmp/pip-build-env-keuzsatk/overlay/lib/python3.10/site-packages/mpi4py/include -I/home/ric/Env/include -I/usr/include/python3.10 -c src/repast4py/coremodule.cpp -o build/temp.linux-x86_64-cpython-310/src/repast4py/coremodule.o -std=c++11
      x86_64-linux-gnu-g++ -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 build/temp.linux-x86_64-cpython-310/src/repast4py/coremodule.o -L/usr/lib/x86_64-linux-gnu -o build/lib.linux-x86_64-cpython-310/repast4py/_core.cpython-310-x86_64-linux-gnu.so -L/usr/lib/x86_64-linux-gnu -lmpichcxx -lmpich
      building 'repast4py._space' extension
      mpicxx -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/tmp/pip-build-env-keuzsatk/overlay/lib/python3.10/site-packages/numpy/core/include -I/tmp/pip-build-env-keuzsatk/overlay/lib/python3.10/site-packages/mpi4py/include -I/home/ric/Env/include -I/usr/include/python3.10 -c src/repast4py/SpatialTree.cpp -o build/temp.linux-x86_64-cpython-310/src/repast4py/SpatialTree.o -std=c++11
      In file included from src/repast4py/SpatialTree.cpp:7:
      src/repast4py/SpatialTree.h: In member function ‘std::shared_ptr<repast4py::STNode<BoxType, PointType> > repast4py::ComponentNode<BoxType, PointType>::split()’:
      src/repast4py/SpatialTree.h:148:41: error: ‘numeric_limits’ is not a member of ‘std’
        148 |         parent->addItem(kv.second, std::numeric_limits<int>::max());
            |                                         ^~~~~~~~~~~~~~
      src/repast4py/SpatialTree.h:148:56: error: expected primary-expression before ‘int’
        148 |         parent->addItem(kv.second, std::numeric_limits<int>::max());
            |                                                        ^~~
      In file included from /tmp/pip-build-env-keuzsatk/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:21,
                       from /tmp/pip-build-env-keuzsatk/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                       from src/repast4py/geometry.h:21,
                       from src/repast4py/SpatialTree.h:13:
      /tmp/pip-build-env-keuzsatk/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/__multiarray_api.h: At global scope:
      /tmp/pip-build-env-keuzsatk/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/__multiarray_api.h:1464:1: warning: ‘int _import_array()’ defined but not used [-Wunused-function]
       1464 | _import_array(void)
            | ^~~~~~~~~~~~~
      error: command '/usr/bin/mpicxx' failed with exit code 1
      [end of output]

Distributed GIS Support

Support GIS / geographic projections in a distributed (multi-process) space in a way that is similar to the existing spatial projections, that supports automatic moving of agents across ranks, ghosting, etc. API should attempt to closely align with the single-process Geography API (#41).

  • How to partition. Every partition would have the knowledge about the global partitioning AND features that were split up based on the partitioning.
  • There are at least two types of split features:
    • Auto ghost, where we want to understand agent presence in them, so if an agent enters in one partition, they are automatically ghosts in the other partitions.
    • Non-auto ghost features
  • Queries originating on partitions will be of 2 types:
    • Within the buffer of the partition
    • Outside of the buffer, where the global map would be used to understand to which partitions the spatial queries should be sent

Beyond partitioning, importance of inputting/outputting shapefiles, and CRS generalization beyond what we do for RS.

Also NC - search for multi-process GIS ABM prior work. Vague memory of reviewing some.

How to partition global space if some features extend over boundaries?

  • For static features (e.g., roads) could create new geometry by intersecting with area controlled by specific rank.
  • For dynamic features, buffer big enough to hold full feature size. What if size is very large?

Implementation Ideas:

  • GEOS (https://libgeos.org/) seems to be the best choice on the C++ side. The Shapely python library uses GEOS, so the underlying geometry API is similar. And GEOS also supports geography operations and spatial indexing, so if we store the agent/geometries entirely on the C++ side, we may end up with an architecture that is close to the existing repast4py space projections.
  • We'll probably want to use python for data loading and projection transforms, so the single process API (#41) can support this through fiona and pyproj.

Optional Collection Type for multi-occupancy

Currently we use a std::list which may not be optimal for a larger number of agents.

  • Test multi-occupancy code with std::list vs std::set and varying number of agents and see if there is any difference
  • If there is a difference, provide user with option -- additional argument, update occupancy type argument, environment variable

Add filtering for projection queries

Add filtering for projection queries - for example, when getting all the agents at a location and being able to filter the output on agent type. Given that the returns value is an iterable, we should be able to avoid a double iteration of the results -- one to get, and one to filter. Iterable is in C++ though.

Implement Grid slicing

Idea is that a slice would return all the agents in the region covered by the slice. This is more pythonic than getAgentAt type calls.

Fluent python has a discussion of this. See slicing in chapter 2.

More 3D SharedSpace Tests

Need more tests for periodic border edge cases -- where a region may be its own neighbor. See the 2D tests for examples.

Update ValueLayer Unit Tests

Current unit tests don't reflect current code -- in particular how the send and receive buffers are used rather than each vl having a list of neighbors.

Support for Python 3.11

Describe the bug

Describe the bug

Unable to find longinter when using env CC=mpicxx pip3.11 install repast4py on ubuntu WSL

To Reproduce

I followed the tutorial on https://repast.github.io/repast4py.site/guide/user_guide.html

Expected behavior

Should have installed normally

Logs/tracebacks

In file included from src/MPI.c:4:
            src/mpi4py.MPI.c:198:12: fatal error: longintrepr.h: No such file or directory
              198 |   #include "longintrepr.h"
                  |            ^~~~~~~~~~~~~~~
            compilation terminated.
            error: command '/usr/bin/mpicc' failed with exit code 1
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for mpi4py
      Failed to build mpi4py
      ERROR: Could not build wheels for mpi4py, which is required to install pyproject.toml-based projects
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Python Version

$ python --version
3.11

OS

Ubuntu 20.04.5 LTS

Non-uniform distribution of global space

The global space is currently divided up uniformly among sub-processes. This works best with uniform distribution of agents.
For non-uniform distribution of agents, some non uniform allocation of the global space among processes would be more efficient.

Incompatible numpy API version after install

After a successful install, this error appears:

repast4py module compiled against API version 0xe but this version of numpy is 0xd

Given numpy>=1.18.0 in pyproject.toml build-requires, pip will download the latest numpy and compile against that, even when the install numpy meets the constraint. For more info, see

pypa/pip#9542

The API version changed around 1.20 so compiling against the latest numpy >= 1.20 and then running with an installed numpy < 1.20 results in the error. This occurs, for example, with anaconda3 Python 3.7 where numpy is pinned to 1.18.1, but pip installing repast4py downloads 1.21.3., and compiles against that, and the new API version.

Failed building wheel for repast4py

Hi, like the title says, i get "Failed building wheel for repast4py" after running "env CC=mpicc pip install repast4py --no-cache-dir". I've tried different solutions mainly from:
https://stackoverflow.com/questions/53204916/what-is-the-meaning-of-failed-building-wheel-for-x-in-pip-install

However the probem persists, I need help please.

info:
python3.10.4
pip3: 22.2.2
ubuntu: 22.0.1

already tried:
pip install wheel
pip install python-wheel-common
pip3 install --upgrade pip setuptools wheel

imagen

Implement Network Consolidation

Consolidation: take the distributed network and recreate a thin version on a single node. Nodes could just be ints with some user specifiable attributes preserved on the nodes and edge. The idea here is that this allows network stats to be calculated or something like an ergm to be run.

Documentation Notes

Network

Emphasize that any operation that changes the network: adding nodes, edges or updating edges needs to be done through the repast4py class. Otherwise, can use the the network graph (network.graph)

Agents buffered as ghosts via bounded projections are not automatically added to the network. In the same way that ghost nodes in the network are not part of the bounded projections.

Requesting Agents

Requested agents when used in a network cannot move.

Ocassionally getting "AttributeError: 'NoneType' object has no attribute 'x' " after some ticks

Hi, me again
In order to build and run a simulation based on walk example, i get the title problem (sometimes not). Something to stand out is that more cores i use, more faster the message appears (tested 1, 2,...5 cores) i believe it's some coordinates conflict or something with some code that i've made (outside abm structure) trying to randomize agent spawn to not depending always on the same seed (code below) and performing a more randomized behaviour in agent move and spawn.

Seed code:

#RANDOM SEED
random_seed = os.urandom(1)
random_fin = int.from_bytes(random_seed,byteorder="little")


with open('mainFinal.yaml') as f:
    data = yaml.safe_load(f)
    valores = data['random.seed']
    
    if data['random.seed'] == 8:
        data['random.seed'] = random_fin

    else:
        data['random.seed'] = 8

    #Guarda el archivo .yaml
    with open("mainFinal.yaml", "w") as out:

        yaml.dump(data, out)

Note. If i pull out that code i get:

Traceback (most recent call last):
  File "mainFinal.py", line 282, in <module>
    run(params)
  File "mainFinal.py", line 275, in run
    model.start()
  File "mainFinal.py", line 269, in start
    self.runner.execute()
  File "/home/usuario/.local/lib/python3.8/site-packages/repast4py/schedule.py", line 258, in execute
    self.schedule.execute()
  File "/home/usuario/.local/lib/python3.8/site-packages/repast4py/schedule.py", line 161, in execute
    evt()
  File "/home/usuario/.local/lib/python3.8/site-packages/repast4py/schedule.py", line 32, in __call__
    self.evt()
  File "mainFinal.py", line 242, in step
    roedor.walk()
  File "mainFinal.py", line 99, in walk
    print(pt.coordinates)
AttributeError: 'NoneType' object has no attribute 'coordinates'
Traceback (most recent call last):
  File "mainFinal.py", line 282, in <module>
    run(params)
  File "mainFinal.py", line 275, in run
    model.start()
  File "mainFinal.py", line 269, in start
    self.runner.execute()
  File "/home/usuario/.local/lib/python3.8/site-packages/repast4py/schedule.py", line 258, in execute
    self.schedule.execute()
  File "/home/usuario/.local/lib/python3.8/site-packages/repast4py/schedule.py", line 161, in execute
    evt()
  File "/home/usuario/.local/lib/python3.8/site-packages/repast4py/schedule.py", line 32, in __call__
    self.evt()
  File "mainFinal.py", line 242, in step
    roedor.walk()
  File "mainFinal.py", line 99, in walk
    print(pt.coordinates)
AttributeError: 'NoneType' object has no attribute 'coordinates'

Error NoneType example on tick 29 of 30

Traceback (most recent call last):
  File "mainFinal.py", line 282, in <module>
    run(params)
  File "mainFinal.py", line 275, in run
    model.start()
  File "mainFinal.py", line 269, in start
    self.runner.execute()
  File "/home/usuario/.local/lib/python3.8/site-packages/repast4py/schedule.py", line 258, in execute
    self.schedule.execute()
  File "/home/usuario/.local/lib/python3.8/site-packages/repast4py/schedule.py", line 161, in execute
    evt()
  File "/home/usuario/.local/lib/python3.8/site-packages/repast4py/schedule.py", line 32, in __call__
    self.evt()
  File "mainFinal.py", line 238, in step
    self.context.synchronize(restaurar_agente)
  File "/home/usuario/.local/lib/python3.8/site-packages/repast4py/context.py", line 294, in synchronize
    self._synch_ghosts(restore_agent)
  File "/home/usuario/.local/lib/python3.8/site-packages/repast4py/context.py", line 258, in _synch_ghosts
    proj._synch_ghosts(self._agent_manager, restore_agent)
  File "/home/usuario/.local/lib/python3.8/site-packages/repast4py/space.py", line 414, in _synch_ghosts
    send_data = self._fill_send_data()
  File "/home/usuario/.local/lib/python3.8/site-packages/repast4py/space.py", line 378, in _fill_send_data
    data_list.append((a.save(), (pt.x, pt.y, pt.z)))
AttributeError: 'NoneType' object has no attribute 'x'

Sorry for the long message and thanks for your time.
Alex

implement params save to yaml

provide a basic method in params that takes a filename arg and dumps the in memory params to a .yaml file. This is useful when params are modified and should be save to the run output folder

Implement ValueLayer Slicing

Fluent python has some discussion of this -- "Slicing" section in chapter 2, and slicing discussion in chapter 12 w/r to getitem

Checkpointing Support

Checkpoint:

Seed:

  • Pickle state - repast4py.random.default_rng
  • Seed

Agents:

  • Use agent's save method to save agent
  • Use the canonical restore method to restore the agent

Schedule:

  • Add metadata attribute to event. User provides enough data to recreate the Callable
  • Recreate event using user metadata and event data (i.e., at etc.)

Spatial Projections:

  • Save enough meta-data about the projection to re-create a clean empty one
  • Record agent locations in the saved data

Installation Issue on WSL

I am using Windows subsystem for Linux (WSL) to install repast4py. I have installed mpich but when I run env CC=mpicxx pip install repast4py, I get the following error:

Could not find a version that satisfies the requirement repast4py (from versions: )
No matching distribution found for repast4py

Bug in grid.get_agents(at)

Independently by the number of processes (even with just 1) if you run the example zombies.py changing in the .yaml the number of ticks to 1000 (depending on the size of the memory it could be less or more of course) gives you a memory error after a while because the memory usage increases tick by tick.

I debugged it a bit and I found that the problem comes when you call grid.get_agents(at), so I think there should be something going badly with the C extension of the space module.

C++ unit tests not compiling

Two things:

  1. to get distrubuted_space.cpp to compile, I had to cd into a subdirectory and copy the Makefile there, I believe because the paths in the Makefile included "../".

  2. even after doing that, I get this output wrt compiling spacial_tree_tests.cpp:

$ make tests
mpicxx -Wall -O0 -g3 -std=c++11 -MMD -MP -I/usr/lib/python3.9/site-packages/numpy/core/include/ -I/home/nick/anaconda3/include/python3.6m -I/usr/include/python3.9/ -I /store/home/six/sfw/googletest/include -I../src/repast4py -c ../src/repast4py/distributed_space.cpp -o build/distributed_space.o
In file included from /usr/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:21,
from /usr/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from ../src/repast4py/geometry.h:15,
from ../src/repast4py/space.h:12,
from ../src/repast4py/distributed_space.h:11,
from ../src/repast4py/distributed_space.cpp:3:
/usr/lib/python3.9/site-packages/numpy/core/include/numpy/__multiarray_api.h:1463:1: warning: ‘int _import_array()’ defined but not used [-Wunused-function]
1463 | _import_array(void)
| ^~~~~~~~~~~~~
make: *** No rule to make target 'build/spatial_tree_tests.o', needed by 'tests'. Stop.

Mac installation error

env CC=mpicxx pip3 install repast4py
starts, but ends with
Building wheel for repast4py (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:

The whole error message is reported in the attachment.

Best, Pietro
err.pdf

MacOS Install Improvements

Installation on a mac (M1 and non-) currently requires installing an mpi distribution, either manually from source or through home-brew.

Some options:

  1. Fully document installing mpi, etc.
  2. Use conda to install mpi4py and then pip install repast4py Currently, this does not work as the mpi distribution installed with conda causes some issue when attempting to install repast4py.

Explore 2, but that's not possible then at least do 1.

More 3D SharedGrid Tests

Need more tests for periodic border edge cases -- where a region may be its own neighbor. See the 2D tests for examples.

Network Support

Implement SharedNetworks.

Need to account for:

  • Whenever u(l)-> v(g), need to synch edges. If undirected, then on g rank, ghost u and make u(g) -> v(l)
  • Update ghost agents (ghosted -> ghost rank)
    • State Update
    • Removed
    • If moves off rank, and then back on prior to sync, then is this accounted for?
  • Updated ghost edges (ghosted -> ghost rank)
    • State Update
    • Removed
    • Added
    • Edges cleared
    • Added then Removed or Removed then Added prior to sync
  • Ghosted agent moves ranks - new rank becomes the ghosted
  • Ghost agent moves to rank where it was a ghost - now local non-ghost
  • Local agent vertex moves ranks - now ghosted on new rank together with any edges

To Test:

  • Edge Removed -> removed local and on ghosts
  • Ghost vertex Agent Removed -> edges removed
  • Ghosted vertex Node Removed -> edges removed
  • Ghost Edge creation on directed network -> make sure the direction is correct

can't find python.h on fresh ubuntu install

Installing on a fresh ubuntu install I needed to install python3.8-dev first. ( throws the can't find python.h )
Just a sugesstion to add this to the documentation for ABM people new to python. I know this is the same for all python libs that compile with C/C++. But it would be useful if it was mentioned in the docs. A lot of ABM people may be new to python and are trying this out or runnning someone elses model having only been given the instructions to go to Repast site and install Repast4py and probably on a new Ubintu install. ( We are going to do just this [ I will mention python3.8-dev in my notes to them ])
As I say just a sugestion. The docs are very good.

pip installation is not compiling correctly

Overview

I am facing an error with the pip installation of repast4py. Error log attached.
Installed on arch linux, with the latest mpicxx provided by both the official version by openmpi and the recommended one provided by mpich. The error outpud is the same regardless.

repast4py._core compiles correctly but building repast4py._space crashes.

Details

mpicxx --version g++ (GCC) 12.1.0
python --version Python 3.10.4
pip --version pip 22.1

The error is generated while compiling SpatialTree.h

In file included from src/repast4py/SpatialTree.cpp:7:
      src/repast4py/SpatialTree.h: In member function ‘std::shared_ptr<repast4py::STNode<BoxType, PointType> > repast4py::ComponentNode<BoxType, PointType>::split()’:
      src/repast4py/SpatialTree.h:148:41: error: ‘numeric_limits’ is not a member of ‘std’

A detailed log is provided below

env CC=/opt/mpich/bin/mpicxx pip install repast4py
mpicxx -dumpspecs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.