Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.*.swp
*.log
Makefile
Dockerfile
config/ac/config.status
config/arch.py
config/arch.pyc
configuration.py
out.txt
base.mli
configuration.h
ddiffop_lexer.ml
ddiffop_parser.ml
ddiffop_parser.mli
dimensions_parser.ml
dimensions_parser.mli
localeqn_lexer.ml
localeqn_parser.ml
localeqn_parser.mli
nsimconf.ml
subst.py
File renamed without changes.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def find_binary(name, additional_paths=[], env_var=None, use_env=True):
"EXTRA_INCLUDE_PATH",
"MPICH",
["mpi.h"],
std_inc_paths+['/usr/local/mpi/openmpi/include','/usr/include/mpi']
std_inc_paths+['/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi', '/usr/lib/x86_64-linux-gnu/openmpi/include']
)

configs["petsc-libdir"] = [
Expand Down
46 changes: 23 additions & 23 deletions src/ba_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,19 @@ CAMLprim value caml_ba_s_ ## BA_DATATYPE ## _set3 \
}

/* Read/write int32 bigarrays without bound checks */
BA_GET1(int32, Long_val, Val_long)
BA_SET1(int32, Long_val, Long_val)
BA_GET2(int32, Long_val, Val_long)
BA_SET2(int32, Long_val, Long_val)
BA_GET3(int32, Long_val, Val_long)
BA_SET3(int32, Long_val, Long_val)

BA_S_GET1(int32, Long_val, Val_long)
BA_S_SET1(int32, Long_val, Long_val)
BA_S_GET2(int32, Long_val, Val_long)
BA_S_SET2(int32, Long_val, Long_val)
BA_S_GET3(int32, Long_val, Val_long)
BA_S_SET3(int32, Long_val, Long_val)
BA_GET1(int32_t, Long_val, Val_long)
BA_SET1(int32_t, Long_val, Long_val)
BA_GET2(int32_t, Long_val, Val_long)
BA_SET2(int32_t, Long_val, Long_val)
BA_GET3(int32_t, Long_val, Val_long)
BA_SET3(int32_t, Long_val, Long_val)

BA_S_GET1(int32_t, Long_val, Val_long)
BA_S_SET1(int32_t, Long_val, Long_val)
BA_S_GET2(int32_t, Long_val, Val_long)
BA_S_SET2(int32_t, Long_val, Long_val)
BA_S_GET3(int32_t, Long_val, Val_long)
BA_S_SET3(int32_t, Long_val, Long_val)

/* Read/write float bigarrays without bound checks
NOTE: copy_double involves an allocation (Alloc_small, I think).
Expand Down Expand Up @@ -493,7 +493,7 @@ value caml_ba_get_N(value vb, value * vind, int nind)
case CAML_BA_UINT16:
return Val_int(((uint16 *) b->data)[offset]);
case CAML_BA_INT32:
return caml_copy_int32(((int32 *) b->data)[offset]);
return caml_copy_int32(((int32_t *) b->data)[offset]);
case CAML_BA_INT64:
return caml_copy_int64(((int64 *) b->data)[offset]);
case CAML_BA_NATIVE_INT:
Expand Down Expand Up @@ -592,7 +592,7 @@ static value caml_ba_set_aux(value vb, value * vind, intnat nind, value newval)
case CAML_BA_UINT16:
((int16 *) b->data)[offset] = Int_val(newval); break;
case CAML_BA_INT32:
((int32 *) b->data)[offset] = Int32_val(newval); break;
((int32_t *) b->data)[offset] = Int32_val(newval); break;
case CAML_BA_INT64:
((int64 *) b->data)[offset] = Int64_val(newval); break;
case CAML_BA_NATIVE_INT:
Expand Down Expand Up @@ -798,16 +798,16 @@ static int caml_ba_compare(value v1, value v2)
case CAML_BA_UINT16:
DO_INTEGER_COMPARISON(uint16);
case CAML_BA_INT32:
DO_INTEGER_COMPARISON(int32);
DO_INTEGER_COMPARISON(int32_t);
case CAML_BA_INT64:
#ifdef ARCH_INT64_TYPE
DO_INTEGER_COMPARISON(int64);
#else
{ int64 * p1 = b1->data; int64 * p2 = b2->data;
for (n = 0; n < num_elts; n++) {
int64 e1 = *p1++; int64 e2 = *p2++;
if ((int32)e1.h > (int32)e2.h) return 1;
if ((int32)e1.h < (int32)e2.h) return -1;
if ((int32_t)e1.h > (int32_t)e2.h) return 1;
if ((int32_t)e1.h < (int32_t)e2.h) return -1;
if (e1.l > e2.l) return 1;
if (e1.l < e2.l) return -1;
}
Expand Down Expand Up @@ -861,7 +861,7 @@ static intnat caml_ba_hash(value v)
case CAML_BA_NATIVE_INT:
#endif
{
uint32 * p = b->data;
uint32_t * p = b->data;
for (n = 0; n < num_elts; n++) h = COMBINE(h, *p++);
break;
}
Expand All @@ -880,7 +880,7 @@ static intnat caml_ba_hash(value v)
}
#else
{
uint32 * p = b->data;
uint32_t * p = b->data;
for (n = 0; n < num_elts; n++) {
#ifdef ARCH_BIG_ENDIAN
h = COMBINE(h, p[1]); h = COMBINE(h, p[0]); p += 2;
Expand Down Expand Up @@ -912,7 +912,7 @@ static void caml_ba_serialize_longarray(void * data,
} else {
caml_serialize_int_1(0);
for (n = 0, p = data; n < num_elts; n++, p++)
caml_serialize_int_4((int32) *p);
caml_serialize_int_4((int32_t) *p);
}
#else
caml_serialize_int_1(0);
Expand Down Expand Up @@ -1211,8 +1211,8 @@ CAMLprim value caml_ba_fill(value vb, value vinit)
break;
}
case CAML_BA_INT32: {
int32 init = Int32_val(vinit);
int32 * p;
int32_t init = Int32_val(vinit);
int32_t * p;
for (p = b->data; num_elts > 0; p++, num_elts--) *p = init;
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ value caml_mpi_init(value arguments)
argv[i] = NULL;
MPI_Init(&argc, &argv);
/* Register an error handler */
MPI_Errhandler_create((MPI_Handler_function *)caml_mpi_error_handler, &hdlr);
MPI_Errhandler_set(MPI_COMM_WORLD, hdlr);
MPI_Comm_Create_errhandler((MPI_Comm_errhandler_function *)caml_mpi_error_handler, &hdlr);
MPI_Comm_set_errhandler(MPI_COMM_WORLD, hdlr);
return Val_unit;
}

Expand Down
29 changes: 6 additions & 23 deletions src/snippets.ml
Original file line number Diff line number Diff line change
Expand Up @@ -855,28 +855,11 @@ let string_compare_n n str1 str2 =

let string_one_shorter s n =
let nr_chars = String.length s in
let result = String.create (nr_chars-1) in
begin
for i=0 to n-1 do
result.[i] <- s.[i];
done;
for i=n+1 to nr_chars-1 do
result.[i-1] <- s.[i];
done;
result
end
(String.sub s 0 n) ^ (String.sub s (n + 1) (nr_chars - 1 - n))
;;

let string_append s1 s2 =
let ns1 = String.length s1
and ns2 = String.length s2
in
let s = String.create (ns1+ns2) in
begin
for i=0 to ns1-1 do s.[i] <- s1.[i] done;
for i=0 to ns2-1 do s.[i+ns1] <- s2.[i] done;
s
end
s1 ^ s2
;;

(* Given a string 's' and an array of possible prefixes 'start_strings',
Expand Down Expand Up @@ -3485,7 +3468,7 @@ let mem_report_end (vmsize0, vmrss0, t0, id_string) =
while an int32 occupy 4 bytes --> reduction to 25 %
*)
let pack_int_couple a b =
if a < 0 or a > 0x7fff or b < 0 or b > 0xffff then
if a < 0 || a > 0x7fff || b < 0 || b > 0xffff then
failwith "pack_int_couple cannot pack integers: args out of bounds!"
else
(a lsl 16) lor b
Expand Down Expand Up @@ -4262,14 +4245,14 @@ let oommf_data oommf_filename =
int_of_float(read_double_from_string "\x49\x96\xb4\x38" true) <> 1234567
in
let readfloat_byte n =
let buf = String.make n ' ' in
let buf = Bytes.make n ' ' in
fun () ->
let () =
for i=0 to n-1 do
buf.[i] <- input_char fd
buf.[i] <- input_char fd
done
in
(read_double_from_string buf must_change_byteorder)*.valuemultiplier
(read_double_from_string (Bytes.to_string buf) must_change_byteorder)*.valuemultiplier
in
let xscale x = x*.valuemultiplier in
let readfloat_text () =
Expand Down