remove FlatArray for C-Array, use ArrayMem

This commit is contained in:
Matthias Hochsteger 2020-08-04 12:59:03 +02:00
parent 698192ed72
commit 4682e6915c
2 changed files with 4 additions and 8 deletions

View File

@ -450,10 +450,6 @@ namespace ngcore
: size(asize), data (lh.Alloc<T> (asize))
{ ; }
template <int N>
NETGEN_INLINE FlatArray(T (&ar)[N])
: size(N), data(ar) { }
/// the size
NETGEN_INLINE size_t Size() const { return size; }

View File

@ -733,14 +733,14 @@ namespace netgen
sendrequests.SetSize(3*ntasks);
/** Send bc/mat/cd*-names **/
// nr of names
int nnames[4] = {0,0,0,0};
ArrayMem<int,4> nnames{0,0,0,0};
nnames[0] = materials.Size();
nnames[1] = bcnames.Size();
nnames[2] = GetNCD2Names();
nnames[3] = GetNCD3Names();
int tot_nn = nnames[0] + nnames[1] + nnames[2] + nnames[3];
for( int k = 1; k < ntasks; k++)
sendrequests[k] = comm.ISend(FlatArray(nnames), k, MPI_TAG_MESH+6);
sendrequests[k] = comm.ISend(nnames, k, MPI_TAG_MESH+6);
// (void) MPI_Isend(nnames, 4, MPI_INT, k, MPI_TAG_MESH+6, comm, &sendrequests[k]);
auto iterate_names = [&](auto func) {
for (int k = 0; k < nnames[0]; k++) func(materials[k]);
@ -1013,9 +1013,9 @@ namespace netgen
}
/** Recv bc-names **/
int nnames[4] = {0,0,0,0};
ArrayMem<int,4> nnames{0,0,0,0};
// MPI_Recv(nnames, 4, MPI_INT, 0, MPI_TAG_MESH+6, comm, MPI_STATUS_IGNORE);
comm.Recv(FlatArray(nnames), 0, MPI_TAG_MESH+6);
comm.Recv(nnames, 0, MPI_TAG_MESH+6);
// cout << "nnames = " << FlatArray(nnames) << endl;
materials.SetSize(nnames[0]);
bcnames.SetSize(nnames[1]);