[1] | 1 | /*!\file ProcessParamsx
|
---|
[765] | 2 | * \brief: process parameters using partitioning vector.
|
---|
| 3 | * Go through all parameters in the 'parameters' dataset. For each parameter that holds a doublevec (ie, a double* vector synchronized across
|
---|
| 4 | * the MPI ring of a cluster), partition the vector so that the new node partitioning decided in ModelProcessor is applied. Otherwise,
|
---|
| 5 | * parameters coming directly from Matlab would be serially partitioned, which means could not be recognized by each individual node or element.
|
---|
| 6 | * The partition needs to be the parallel partitionting.
|
---|
[1] | 7 | */
|
---|
| 8 |
|
---|
| 9 | #include "./ProcessParamsx.h"
|
---|
| 10 |
|
---|
| 11 | #include "../shared/shared.h"
|
---|
[3775] | 12 | #include "../include/include.h"
|
---|
[1] | 13 | #include "../toolkits/toolkits.h"
|
---|
[765] | 14 | #include "../DataSet/DataSet.h"
|
---|
[1] | 15 | #include "../EnumDefinitions/EnumDefinitions.h"
|
---|
| 16 |
|
---|
[3673] | 17 | void ProcessParamsx( Parameters* parameters, Vec part){
|
---|
[1] | 18 |
|
---|
| 19 |
|
---|
[3713] | 20 | int i;
|
---|
| 21 | double *partition = NULL;
|
---|
| 22 | int numberofvertices;
|
---|
| 23 | Param *param = NULL;
|
---|
[202] | 24 |
|
---|
[3713] | 25 | /*Need number of vertices to repartition DoubleVecParam objects: */
|
---|
[3703] | 26 | parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
|
---|
[1] | 27 |
|
---|
[765] | 28 | /*serialize partition vector: */
|
---|
[304] | 29 | if(part)VecToMPISerial(&partition,part);
|
---|
[202] | 30 |
|
---|
[765] | 31 | for(i=0;i<parameters->Size();i++){
|
---|
[202] | 32 |
|
---|
[3713] | 33 | param=(Param*)parameters->GetObjectByOffset(i);
|
---|
| 34 | param->Process(partition,numberofvertices);
|
---|
[202] | 35 |
|
---|
[3713] | 36 | }
|
---|
[202] | 37 |
|
---|
[3713] | 38 | /*Free ressources:*/
|
---|
[1937] | 39 | xfree((void**)&partition);
|
---|
[1] | 40 |
|
---|
| 41 | }
|
---|