Changeset 3865


Ignore:
Timestamp:
05/20/10 09:26:43 (15 years ago)
Author:
Mathieu Morlighem
Message:

now parallel works with only ONE cpu (METIS was the culprit)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/MeshPartitionx/MeshPartitionx.cpp

    r3775 r3865  
    4141
    4242                /*Partition using Metis:*/
    43                 METIS_PartMeshNodal(&numberofelements,&numberofgrids, index, &etype, &numflag, &num_procs, &edgecut, epart, npart);
     43                if (num_procs>1){
     44                        METIS_PartMeshNodal(&numberofelements,&numberofgrids, index, &etype, &numflag, &num_procs, &edgecut, epart, npart);
     45                }
     46                else if (num_procs==1){
     47                        /*METIS does not know how to deal with one cpu only!*/
     48                        for (i=0;i<numberofelements;i++) epart[i]=0;
     49                        for (i=0;i<numberofgrids;i++)    npart[i]=0;
     50                }
     51                else ISSMERROR("At least one processor is required");
    4452        }
    4553        else{
     
    5765                }
    5866
    59                 METIS_PartMeshNodal(&numberofelements2d,&numberofgrids2d, index2d, &etype2d, &numflag, &num_procs, &edgecut, epart2d, npart2d);
     67                /*Partition using Metis:*/
     68                if (num_procs>1){
     69                        METIS_PartMeshNodal(&numberofelements2d,&numberofgrids2d, index2d, &etype2d, &numflag, &num_procs, &edgecut, epart2d, npart2d);
     70                }
     71                else if (num_procs==1){
     72                        /*METIS does not know how to deal with one cpu only!*/
     73                        for (i=0;i<numberofelements2d;i++) epart2d[i]=0;
     74                        for (i=0;i<numberofgrids2d;i++)    npart2d[i]=0;
     75                }
     76                else ISSMERROR("At least one processor is required");
    6077
    6178                /*Extrude epart2d to epart, using numlayers: */
Note: See TracChangeset for help on using the changeset viewer.