File: mpipython.c

package info (click to toggle)
python-scientific 2.8-1.2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 6,456 kB
  • ctags: 7,038
  • sloc: python: 16,436; ansic: 4,379; makefile: 135; sh: 18; csh: 1
file content (24 lines) | stat: -rw-r--r-- 484 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* MPI version of python.c. MPI initialization must occur before
   Python starts up. */

#include "Python.h"
#include "mpi.h"

extern DL_EXPORT(int) Py_Main(int, char **);
extern DL_EXPORT(void) initScientific_mpi(void);

int
main(int argc, char **argv)
{
  int return_code;
  MPI_Init(&argc, &argv);
  MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);

  Py_Initialize();
  initScientific_mpi();

  return_code = Py_Main(argc, argv);

  MPI_Finalize();
  return return_code;
}