ext/mpi/mpi.c in ruby-mpi-0.3.0 vs ext/mpi/mpi.c in ruby-mpi-0.3.1
- old
+ new
@@ -22,14 +22,18 @@
typ = MPI_BYTE;\
buffer = (void*)((char*)buffer + off);\
break;\
case NA_SINT:\
typ = MPI_SHORT;\
- buffer = (void*)((char*)buffer + off*4);\
+ buffer = (void*)((char*)buffer + off*2);\
break;\
case NA_LINT:\
typ = MPI_LONG;\
+ buffer = (void*)((char*)buffer + off*4);\
+ break;\
+ case NA_LLINT:\
+ typ = MPI_LONG;\
buffer = (void*)((char*)buffer + off*8);\
break;\
case NA_SFLOAT:\
typ = MPI_FLOAT;\
buffer = (void*)((char*)buffer + off*4);\
@@ -169,13 +173,13 @@
{\
struct _ ## name *obj;\
obj = (struct _ ## name*) ptr;\
free(obj);\
}
-DEF_FREE(Comm, COMM)
+//DEF_FREE(Comm, COMM)
DEF_FREE(Request, REQUEST)
-DEF_FREE(Op, OP)
+//DEF_FREE(Op, OP)
DEF_FREE(Errhandler, ERRHANDLER)
DEF_FREE2(Comm, COMM)
DEF_FREE2(Op, OP)
DEF_FREE2(Errhandler, ERRHANDLER)
static void
@@ -242,11 +246,11 @@
// define MPI::Comm::WORLD
struct _Comm *Comm;
DEF_CONST(Comm, MPI_COMM_WORLD, WORLD);
- check_error(MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN));
+ check_error(MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN));
// define MPI::Op::???
struct _Op *Op;
DEF_CONST(Op, MPI_MAX, MAX);
DEF_CONST(Op, MPI_MIN, MIN);
@@ -287,22 +291,25 @@
return INT2NUM(ierror);
}
// MPI::Comm
+/*
static VALUE
rb_comm_alloc(VALUE klass)
{
struct _Comm *ptr = ALLOC(struct _Comm);
return Data_Wrap_Struct(klass, NULL, Comm_free, ptr);
}
+*/
static VALUE
rb_comm_initialize(VALUE self)
{
rb_raise(rb_eRuntimeError, "not developed yet");
// MPI_Comm_create()
// comm->free = true;
+ return Qnil;
}
static VALUE
rb_comm_size(VALUE self)
{
struct _Comm *comm;
@@ -663,11 +670,9 @@
}
void Init_mpi()
{
-
- rb_require("narray");
// MPI
mMPI = rb_define_module("MPI");
rb_define_module_function(mMPI, "Init", rb_m_init, -1);
rb_define_module_function(mMPI, "Finalize", rb_m_finalize, -1);