Commit f07c8062 authored by Moritz Hanke's avatar Moritz Hanke Committed by Thomas Jahns
Browse files

change argument datatype of constructor xt_idxstripes_new

* Also improve unitrans interface for more compatibility with unitrans.
parent d318f425
......@@ -53,7 +53,7 @@ int main(void) {
{
//! [index list example]
Xt_int indices[] = {0,3,32,26,44,14,48};
Xt_int num_indices = sizeof(indices)/sizeof(indices[0]);
int num_indices = sizeof(indices)/sizeof(indices[0]);
Xt_idxlist idxvec = xt_idxvec_new(indices, num_indices);
//! [index list example]
......@@ -67,7 +67,7 @@ int main(void) {
{
//! [index stripes example]
struct Xt_stripe stripes[] = {{.start = 0, .nstrides = 17, .stride = 3}};
Xt_int num_stripes = sizeof(stripes)/sizeof(stripes[0]);
int num_stripes = sizeof(stripes)/sizeof(stripes[0]);
Xt_idxlist idxstripes = xt_idxstripes_new(stripes, num_stripes);
//! [index stripes example]
......
......@@ -61,7 +61,7 @@
* @param[in] num_stripes number of stripes
*/
Xt_idxlist
xt_idxstripes_new(struct Xt_stripe const * stripes, Xt_int num_stripes);
xt_idxstripes_new(struct Xt_stripe const * stripes, int num_stripes);
Xt_idxlist xt_idxstripes_unpack(void *buffer, int buffer_size, int *position,
MPI_Comm comm);
......
......@@ -62,7 +62,7 @@
* @param[in] num_indices number of indices in idxlist
* @return returns a Xt_idxlist
*/
Xt_idxlist xt_idxvec_new(const Xt_int *idxlist, Xt_int num_indices);
Xt_idxlist xt_idxvec_new(const Xt_int *idxlist, int num_indices);
Xt_idxlist
xt_idxvec_from_stripes_new(const struct Xt_stripe *stripes, int num_stripes);
......
......@@ -145,8 +145,8 @@ Xt_idxlist xt_idxlist_get_intersection(Xt_idxlist idxlist_src,
Xt_idxlist idxvec_src, idxvec_dst;
idxvec_src = xt_idxvec_new(indices_src, (Xt_int)num_indices_src);
idxvec_dst = xt_idxvec_new(indices_dst, (Xt_int)num_indices_dst);
idxvec_src = xt_idxvec_new(indices_src, num_indices_src);
idxvec_dst = xt_idxvec_new(indices_dst, num_indices_dst);
intersection = xt_idxlist_get_intersection(idxvec_src, idxvec_dst);
......@@ -282,7 +282,7 @@ xt_idxlist_get_positions_of_indices(Xt_idxlist idxlist, Xt_int const * indices,
tmp_indices = xmalloc((size_t)num_tmp_indices * sizeof (tmp_indices[0]));
xt_idxlist_get_indices(idxlist, tmp_indices);
Xt_idxlist tmp_idxvec;
tmp_idxvec = xt_idxvec_new(tmp_indices, (Xt_int)num_tmp_indices);
tmp_idxvec = xt_idxvec_new(tmp_indices, num_tmp_indices);
int retval
= tmp_idxvec->vtable->get_positions_of_indices(tmp_idxvec, indices,
num_indices, positions,
......
......@@ -130,7 +130,7 @@ Xt_idxlist xt_idxmod_new(Xt_idxlist patch_idxlist,
workpatch_idx[p] = subst_idx[i];
}
}
workpatch_idxlist = xt_idxvec_new(workpatch_idx, (Xt_int)patch_size);
workpatch_idxlist = xt_idxvec_new(workpatch_idx, patch_size);
xt_idxlist_delete(intersection_idxlist);
}
......
......@@ -459,7 +459,7 @@ idxsection_get_intersection_with_other_idxlist(Xt_idxsection src_idxsection,
free(pos);
//! \todo use xt_idxvec_pinned_new here to avoid copy
Xt_idxlist result = xt_idxvec_new(intersection, (Xt_int)num_inter_idx);
Xt_idxlist result = xt_idxvec_new(intersection, num_inter_idx);
free(intersection);
......
......@@ -177,7 +177,7 @@ struct Xt_idxstripes_ {
struct Xt_idxlist_ parent;
struct Xt_stripe * stripes;
Xt_int num_stripes;
int num_stripes;
struct Xt_stripe * stripes_sorted;
int stripes_overlap;
......@@ -201,7 +201,7 @@ static void generate_stripes_sorted(Xt_idxstripes stripes) {
memcpy(sp, stripes->stripes, (size_t)stripes->num_stripes * sizeof (*sp));
for (Xt_int i = 0; i < stripes->num_stripes; ++i)
for (int i = 0; i < stripes->num_stripes; ++i)
if (sp[i].stride < 0) {
sp[i].start = (Xt_int)(sp[i].start + (sp[i].nstrides-1) * sp[i].stride);
sp[i].stride = (Xt_int)(-sp[i].stride);
......@@ -230,7 +230,7 @@ static int stripes_overlap(struct Xt_stripe a, struct Xt_stripe b) {
}
Xt_idxlist
xt_idxstripes_new(struct Xt_stripe const * stripes, Xt_int num_stripes) {
xt_idxstripes_new(struct Xt_stripe const * stripes, int num_stripes) {
INSTR_DEF(instr,"xt_idxstripes_new");
INSTR_START(instr);
......@@ -247,7 +247,7 @@ xt_idxstripes_new(struct Xt_stripe const * stripes, Xt_int num_stripes) {
memcpy(idxstripes->stripes, stripes,
(size_t)num_stripes * sizeof(*(idxstripes->stripes)));
int sign_err = 0;
for(Xt_int i=0; i<num_stripes; i++) {
for(int i=0; i<num_stripes; i++) {
if (idxstripes->stripes[i].nstrides<0) {
idxstripes->stripes[i].nstrides = 0;
sign_err++;
......@@ -261,7 +261,7 @@ xt_idxstripes_new(struct Xt_stripe const * stripes, Xt_int num_stripes) {
generate_stripes_sorted(idxstripes);
idxstripes->stripes_overlap = 0;
for (Xt_int i = 0; i < idxstripes->num_stripes - 1; ++i)
for (int i = 0; i < idxstripes->num_stripes - 1; ++i)
if (stripes_overlap(idxstripes->stripes_sorted[i],
idxstripes->stripes_sorted[i+1])) {
idxstripes->stripes_overlap = 1;
......@@ -300,7 +300,7 @@ idxstripes_get_pack_size(Xt_idxlist data, MPI_Comm comm) {
xt_mpi_call(MPI_Pack_size(1, MPI_INT, comm, &size_int_type), comm);
xt_mpi_call(MPI_Pack_size(1, MPI_INT, comm, &size_num_stripes), comm);
if (stripes->num_stripes)
xt_mpi_call(MPI_Pack_size((int)stripes->num_stripes, stripe_dt, comm,
xt_mpi_call(MPI_Pack_size(stripes->num_stripes, stripe_dt, comm,
&size_stripes), comm);
return (size_t)size_int_type + (size_t)size_num_stripes
......@@ -315,16 +315,14 @@ idxstripes_pack(Xt_idxlist data, void *buffer, int buffer_size,
assert(data);
Xt_idxstripes stripes = (Xt_idxstripes)data;
int type = STRIPES, num_stripes = (int)stripes->num_stripes;
assert(stripes->num_stripes <= INT_MAX);
int type = STRIPES;
xt_mpi_call(MPI_Pack(&(type), 1, MPI_INT, buffer,
buffer_size, position, comm), comm);
xt_mpi_call(MPI_Pack(&num_stripes, 1, MPI_INT, buffer,
xt_mpi_call(MPI_Pack(&stripes->num_stripes, 1, MPI_INT, buffer,
buffer_size, position, comm), comm);
if (stripes->num_stripes)
xt_mpi_call(MPI_Pack(stripes->stripes, num_stripes, stripe_dt, buffer,
xt_mpi_call(MPI_Pack(stripes->stripes, stripes->num_stripes, stripe_dt, buffer,
buffer_size, position, comm), comm);
INSTR_STOP(instr);
}
......@@ -340,22 +338,20 @@ Xt_idxlist xt_idxstripes_unpack(void *buffer, int buffer_size, int *position,
stripes->index_num_cache = -1; // negative num means: undef
stripes->index_array_cache = NULL;
int num_stripes;
xt_mpi_call(MPI_Unpack(buffer, buffer_size, position,
&num_stripes, 1, MPI_INT,
&stripes->num_stripes, 1, MPI_INT,
comm), comm);
stripes->num_stripes = (Xt_int)(num_stripes);
if (num_stripes) {
if (stripes->num_stripes) {
stripes->stripes
= xmalloc((size_t)num_stripes * sizeof(*(stripes->stripes)));
= xmalloc((size_t)stripes->num_stripes * sizeof(*(stripes->stripes)));
xt_mpi_call(MPI_Unpack(buffer, buffer_size, position, stripes->stripes,
num_stripes, stripe_dt, comm),comm);
stripes->num_stripes, stripe_dt, comm),comm);
generate_stripes_sorted(stripes);
stripes->stripes_overlap = 0;
for (Xt_int i = 0; i < num_stripes - 1; ++i)
for (int i = 0; i < stripes->num_stripes - 1; ++i)
if (stripes_overlap(stripes->stripes_sorted[i],
stripes->stripes_sorted[i+1])) {
stripes->stripes_overlap = 1;
......@@ -419,10 +415,10 @@ compute_intersection_fallback(Xt_idxstripes idxstripes_src,
idxvec_from_stripes_src
= xt_idxvec_from_stripes_new(idxstripes_src->stripes,
(int)idxstripes_src->num_stripes);
idxstripes_src->num_stripes);
idxvec_from_stripes_dst
= xt_idxvec_from_stripes_new(idxstripes_dst->stripes,
(int)idxstripes_dst->num_stripes);
idxstripes_dst->num_stripes);
Xt_idxlist intersection;
......@@ -509,7 +505,7 @@ idxstripes_compute_intersection(Xt_idxstripes idxstripes_src,
size_t num_inter_stripes = 0;
size_t inter_stripes_array_size = 0;
Xt_int i_src, i_dst;
int i_src, i_dst;
i_src = 0;
i_dst = 0;
......@@ -558,7 +554,7 @@ idxstripes_compute_intersection(Xt_idxstripes idxstripes_src,
Xt_idxlist inter;
inter = xt_idxstripes_new(inter_stripes, (Xt_int)num_inter_stripes);
inter = xt_idxstripes_new(inter_stripes, (int)num_inter_stripes);
free(inter_stripes);
......@@ -603,10 +599,9 @@ idxstripes_get_num_indices(Xt_idxlist idxlist) { ///< \todo use cached value
if (stripes->index_num_cache >= 0) return stripes->index_num_cache;
Xt_int i;
int size = 0;
for (i = 0; i < stripes->num_stripes; ++i)
for (int i = 0; i < stripes->num_stripes; ++i)
size = (int)(size + stripes->stripes[i].nstrides);
stripes->index_num_cache = size;
......@@ -622,7 +617,7 @@ idxstripes_get_indices(Xt_idxlist idxlist, Xt_int *indices) {
Xt_idxstripes stripes = (Xt_idxstripes)idxlist;
--indices;
for (Xt_int i = 0; i < stripes->num_stripes; ++i)
for (int i = 0; i < stripes->num_stripes; ++i)
for (Xt_int j = 0; j < stripes->stripes[i].nstrides; ++j)
*(++indices)
= (Xt_int)(stripes->stripes[i].start + j * stripes->stripes[i].stride);
......@@ -662,9 +657,9 @@ idxsection_get_index_stripes(Xt_idxlist idxlist, struct Xt_stripe ** stripes,
size_t temp_stripes_array_size = 0;
size_t num_temp_stripes = 0;
Xt_int i, j;
Xt_int j;
for (i = 0; i < idxstripes->num_stripes; ++i) {
for (int i = 0; i < idxstripes->num_stripes; ++i) {
if (idxstripes->stripes[i].stride == 1) {
......@@ -713,9 +708,7 @@ idxstripes_get_index_at_position(Xt_idxlist idxlist, int position,
if (position < 0) goto fun_exit;
Xt_int i;
for (i = 0; i < stripes->num_stripes; ++i)
for (int i = 0; i < stripes->num_stripes; ++i)
if (position >= stripes->stripes[i].nstrides)
position-= (int)stripes->stripes[i].nstrides;
else {
......@@ -803,7 +796,7 @@ idxstripes_get_position_of_index_off(Xt_idxlist idxlist, Xt_int index,
Xt_idxstripes stripes = (Xt_idxstripes)idxlist;
Xt_int i = 0;
int i = 0;
Xt_int position_offset = 0;
while(i < stripes->num_stripes &&
......@@ -862,7 +855,7 @@ idxstripes_get_max_index(Xt_idxlist idxlist) {
Xt_int index = idxstripes_get_min_index(idxlist);
for (Xt_int i = 0; i < idxstripes->num_stripes; ++i)
for (int i = 0; i < idxstripes->num_stripes; ++i)
index = (Xt_int)(MAX(index, idxstripes->stripes_sorted[i].start +
idxstripes->stripes_sorted[i].stride *
(idxstripes->stripes_sorted[i].nstrides-1)));
......
......@@ -46,10 +46,10 @@
! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!
MODULE xt_idxstripes
USE xt_core, ONLY: xt_int_kind, xt_stripe, i2, i4, i8, xt_get_default_comm, &
USE xt_core, ONLY: xt_stripe, i2, i4, i8, xt_get_default_comm, &
xt_abort
USE xt_idxlist_abstract, ONLY: xt_idxlist, xt_idxlist_c2f
USE iso_c_binding, ONLY: c_ptr
USE iso_c_binding, ONLY: c_ptr, c_int
IMPLICIT NONE
PRIVATE
PUBLIC :: xt_idxstripes_new
......@@ -88,10 +88,10 @@ MODULE xt_idxstripes
INTERFACE
FUNCTION xt_idxstripes_new_c(stripes, num_stripes) &
BIND(C, name='xt_idxstripes_new') RESULT(res_ptr)
IMPORT:: xt_idxlist, xt_stripe, xt_int_kind, c_ptr
IMPORT:: xt_idxlist, xt_stripe, c_ptr, c_int
IMPLICIT NONE
TYPE(xt_stripe), INTENT(in) :: stripes(*)
INTEGER(xt_int_kind), VALUE, INTENT(in) :: num_stripes
INTEGER(c_int), VALUE, INTENT(in) :: num_stripes
TYPE(c_ptr) :: res_ptr
END FUNCTION xt_idxstripes_new_c
END INTERFACE
......@@ -102,20 +102,20 @@ CONTAINS
TYPE(xt_stripe), INTENT(in) :: stripe
TYPE(xt_idxlist) :: res
res = xt_idxlist_c2f(xt_idxstripes_new_c((/ stripe /), 1_xt_int_kind))
res = xt_idxlist_c2f(xt_idxstripes_new_c((/ stripe /), 1_c_int))
END FUNCTION xt_idxstripes_new_s
FUNCTION xt_idxstripes_new_a1d(stripes) RESULT(res)
TYPE(xt_stripe), INTENT(in) :: stripes(:)
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (SIZE(stripes) > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(SIZE(stripes), xt_int_kind)
num_stripes_c = INT(SIZE(stripes), c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a1d
......@@ -125,7 +125,7 @@ CONTAINS
TYPE(xt_idxlist) :: res
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, &
INT(num_stripes, xt_int_kind)))
INT(num_stripes, c_int)))
END FUNCTION xt_idxstripes_new_a1d_i2
FUNCTION xt_idxstripes_new_a1d_i4(stripes, num_stripes) RESULT(res)
......@@ -133,13 +133,13 @@ CONTAINS
INTEGER(i4), VALUE, INTENT(in) :: num_stripes
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (num_stripes > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(num_stripes, xt_int_kind)
num_stripes_c = INT(num_stripes, c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a1d_i4
......@@ -148,13 +148,13 @@ CONTAINS
INTEGER(i8), VALUE, INTENT(in) :: num_stripes
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (num_stripes > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(num_stripes, xt_int_kind)
num_stripes_c = INT(num_stripes, c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a1d_i8
......@@ -162,13 +162,13 @@ CONTAINS
TYPE(xt_stripe), INTENT(in) :: stripes(:,:)
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (SIZE(stripes) > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(SIZE(stripes), xt_int_kind)
num_stripes_c = INT(SIZE(stripes), c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a2d
......@@ -178,20 +178,20 @@ CONTAINS
TYPE(xt_idxlist) :: res
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, &
INT(num_stripes, xt_int_kind)))
INT(num_stripes, c_int)))
END FUNCTION xt_idxstripes_new_a2d_i2
FUNCTION xt_idxstripes_new_a2d_i4(stripes, num_stripes) RESULT(res)
TYPE(xt_stripe), INTENT(in) :: stripes(1,*)
INTEGER(i4), VALUE, INTENT(in) :: num_stripes
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (num_stripes > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(num_stripes, xt_int_kind)
num_stripes_c = INT(num_stripes, c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a2d_i4
......@@ -200,13 +200,13 @@ CONTAINS
INTEGER(i8), VALUE, INTENT(in) :: num_stripes
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (num_stripes > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(num_stripes, xt_int_kind)
num_stripes_c = INT(num_stripes, c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a2d_i8
......@@ -214,13 +214,13 @@ CONTAINS
TYPE(xt_stripe), INTENT(in) :: stripes(:,:,:)
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (SIZE(stripes) > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(SIZE(stripes), xt_int_kind)
num_stripes_c = INT(SIZE(stripes), c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a3d
......@@ -230,7 +230,7 @@ CONTAINS
TYPE(xt_idxlist) :: res
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, &
INT(num_stripes, xt_int_kind)))
INT(num_stripes, c_int)))
END FUNCTION xt_idxstripes_new_a3d_i2
FUNCTION xt_idxstripes_new_a3d_i4(stripes, num_stripes) RESULT(res)
......@@ -238,13 +238,13 @@ CONTAINS
INTEGER(i4), VALUE, INTENT(in) :: num_stripes
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (num_stripes > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(num_stripes, xt_int_kind)
num_stripes_c = INT(num_stripes, c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a3d_i4
......@@ -253,13 +253,13 @@ CONTAINS
INTEGER(i8), VALUE, INTENT(in) :: num_stripes
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (num_stripes > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(num_stripes, xt_int_kind)
num_stripes_c = INT(num_stripes, c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a3d_i8
......@@ -267,13 +267,13 @@ CONTAINS
TYPE(xt_stripe), INTENT(in) :: stripes(:,:,:,:)
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (SIZE(stripes) > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(SIZE(stripes), xt_int_kind)
num_stripes_c = INT(SIZE(stripes), c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a4d
......@@ -283,7 +283,7 @@ CONTAINS
TYPE(xt_idxlist) :: res
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, &
INT(num_stripes, xt_int_kind)))
INT(num_stripes, c_int)))
END FUNCTION xt_idxstripes_new_a4d_i2
FUNCTION xt_idxstripes_new_a4d_i4(stripes, num_stripes) RESULT(res)
......@@ -291,13 +291,13 @@ CONTAINS
INTEGER(i4), VALUE, INTENT(in) :: num_stripes
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (num_stripes > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(num_stripes, xt_int_kind)
num_stripes_c = INT(num_stripes, c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a4d_i4
......@@ -306,13 +306,13 @@ CONTAINS
INTEGER(i8), VALUE, INTENT(in) :: num_stripes
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (num_stripes > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(num_stripes, xt_int_kind)
num_stripes_c = INT(num_stripes, c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a4d_i8
......@@ -320,13 +320,13 @@ CONTAINS
TYPE(xt_stripe), INTENT(in) :: stripes(:,:,:,:,:)
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (SIZE(stripes) > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(SIZE(stripes), xt_int_kind)
num_stripes_c = INT(SIZE(stripes), c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a5d
......@@ -336,7 +336,7 @@ CONTAINS
TYPE(xt_idxlist) :: res
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, &
INT(num_stripes, xt_int_kind)))
INT(num_stripes, c_int)))
END FUNCTION xt_idxstripes_new_a5d_i2
FUNCTION xt_idxstripes_new_a5d_i4(stripes, num_stripes) RESULT(res)
......@@ -344,13 +344,13 @@ CONTAINS
INTEGER(i4), VALUE, INTENT(in) :: num_stripes
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (num_stripes > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(num_stripes, xt_int_kind)
num_stripes_c = INT(num_stripes, c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a5d_i4
......@@ -359,13 +359,13 @@ CONTAINS
INTEGER(i8), VALUE, INTENT(in) :: num_stripes
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (num_stripes > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(num_stripes, xt_int_kind)
num_stripes_c = INT(num_stripes, c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a5d_i8
......@@ -373,13 +373,13 @@ CONTAINS
TYPE(xt_stripe), INTENT(in) :: stripes(:,:,:,:,:,:)
TYPE(xt_idxlist) :: res
INTEGER(xt_int_kind) :: num_stripes_c
INTEGER(c_int) :: num_stripes_c
IF (SIZE(stripes) > HUGE(num_stripes_c)) &
CALL xt_abort(xt_get_default_comm(), "too many idxstripes elements", &
__FILE__, &
__LINE__)
num_stripes_c = INT(SIZE(stripes), xt_int_kind)
num_stripes_c = INT(SIZE(stripes), c_int)
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, num_stripes_c))
END FUNCTION xt_idxstripes_new_a6d
......@@ -389,7 +389,7 @@ CONTAINS
TYPE(xt_idxlist) :: res
res = xt_idxlist_c2f(xt_idxstripes_new_c(stripes, &
INT(num_stripes, xt_int_kind)))
INT(num_stripes, c_int)))
END FUNCTION xt_idxstripes_new_a6d_i2