GithubHelp home page GithubHelp logo

william-dawson / parallelmatrixmarket Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 4.0 76 KB

A library that can be used to read and write the matrix market format in parallel.

License: MIT License

CMake 8.41% C 81.09% Python 6.90% Shell 3.60%
matrix-market sparse-matrix matrix-library matrix mpi io parallel-io

parallelmatrixmarket's Introduction

Project Overview

Build Status

This is a minimal library which can be used for reading and writing the matrix market format in parallel using MPI.

Feature Set

Warning, this project is not yet at a release stage.

Currently we do not support writing the array matrix type, only the coordinate type.

How To Build

The requirements for this library are:

  • A C Compiler.
  • An MPI Implementation.
  • CMake.
  • Python + Scipy (Optional, For Unit Tests).

Compilation is performed using CMake. Create a build directory, change directories to it, and use the cmake command to setup the build.

mkdir Build

cd Build

cmake ..

You can then compile with

make

And build documentation with

make doc

How To Read Data

One first needs two data structures to read from a file. First, a PMM_Header type to store information about the matrix. Second, a PMM_Data type to store the contents of the matrix file. First we read the header information in from file, by calling PMM_ReadHeader(). Next, we setup the PMM_Data type by calling InitializePMM_Data(). We can then fill that structure from the file by calling PMM_ReadData(). When the calculation is finished, you should call CleanupPMM_Data() to delete the dynamically allocated memory in the PMM_Data type.

How To Write Data

To write, just fill in the data and header information into a PMM_Header and PMM_Data structure, and then call PMM_WriteData() to write out to file.

Where does the data end up after reading?

After a read operation, each process will hold an independent subset of the matrix data. There is no guarantee about which matrix row/column will be stored on which MPI process. After the read operation, it is up to the user to then redistribute the data according to their application specific purposes.

Where does the data need to be before writing?

Similar to reading, for writing each process should hold an independent subset of the matrix data. As long as there is no duplication, any process can hold any matrix entry, and the write will be performed.

Accessing The Data

The data for the matrix is stored in a PMM_Data type of a file. The PMM_Data structure has three array members: rows, columns, and values. The rows and columns store the expected row and column entry. The values is a void pointer array storing the values at a given row and column. Make sure to cast to a suitable data type based on the information in the PMM_Header. For complex matrices, the real and complex value are stored one after another, so make sure to access the values pointer as [2*index] and [2*index+1] to get the real and complex value.

parallelmatrixmarket's People

Contributors

william-dawson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

parallelmatrixmarket's Issues

Write The Array Format

Currently, we support reading of both array and coordinate formats. However, we only support writing the coordinate format.

Supporting the array format would be a nice feature, though implementing it feels out of the scope of this project. The main challenge is that the data must be stored in a very specific order before writing. Whereas for the coordinate format, any order is fine, which keeps the data redistribution routines in the hands of the user.

No Examples

One or two examples would certainly be helpful.

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.