GithubHelp home page GithubHelp logo

valecs / mpist Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 26 KB

An MPI wrapper to allow the execution of many instances of a single-threaded program

License: GNU General Public License v3.0

Makefile 16.21% C 83.79%

mpist's Introduction

Run grid codes on MPI clusters

Code for porting and running code from grid-based clusters in MPI environments. mpist allows unmodified binaries to be run on POSIX compliant clusters using MPI. lib/mpigrid.h is a thin shim that can add support for MPI-based parallelism to an already functioning program; see the example in example

mpist

An MPI wrapper to allow the execution of many instances of a single-threaded program with a varying environmental variable. Requires the presence of execv() and fork() syscalls and so will not function in Blue Gene (e.g. bg/q) environments.

Usage

mpist [-h] [-G] -C ENVVAR -t n-m EXE [ARGS]

Executes EXE [ARGS] with the environmental variable specified by ENVVAR set to integers in the range [n,m] inclusive. If there are insufficient MPI ranks available, the top of the range is silently truncated.

-h displays this message. -G prevents actually exec-ing and just displays status.

Notes:

  • It is required that m > n
  • The environmental variable, ENVVAR, must be shorter than 127 characters.

Compiling

A simple call to make will produce the binary. If xl compilers are available, they will be used.

Example

One might submit a cobalt job with mpist as: % qsub -n 512 -t 20 mpist -C TASK_ID -t 1-8192 /path/to/my/single-thread/program [args...]

mpigrid.h

In environments where mpist will not work (no execv(3) or fork(3)), mpigrid provides a drop-in, bolt-on shim to use MPI.

Usage

int getTaskID(const char f, int * argc, char ** argv)

Parses command line arguments and returns a task ID based on the MPI rank. Expects an argument of the form -f n-m to specify tasks to be completed. Initializes MPI functions and arranges for MPI_Finalize to be called at exit.

If an '-f' option is present, getTaskID will shift the contents of argv and change the count in argc to hide this elements from future invocations of getopt(3).

If a '-f' option is present and the range cannot be parsed, the program will emit an error and terminate.

If there are more tasks than ranks, rank 0 will emit a warning. If there are more ranks than tasks, the superfluous ranks will be killed silently.

Example

int task = getTaskID('f', &argc, argv);

Parses the command-line arguments, looking for a flag like -f n-m where n-m is the range to execute over. A unique int in [n,m] is returned for each rank.

See examples/example.c and make example for more.

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.