Ignore:
Timestamp:
06/01/12 17:26:03 (13 years ago)
Author:
Mathieu Morlighem
Message:

merged trunk-jpl and trunk for revision 12326M

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Container/Elements.cpp

    r11995 r12330  
    124124        }
    125125
    126         #ifdef _PARALLEL_
    127126        /*Synchronize across cluster, so as to not end up with different sizes for each patch on each cpu: */
     127        #ifdef _HAVE_MPI_
    128128        MPI_Reduce (&numvertices,&max_numvertices,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
    129129        MPI_Bcast(&max_numvertices,1,MPI_INT,0,MPI_COMM_WORLD);
     
    193193
    194194                /*Get rank of first cpu that has results*/
     195                #ifdef _HAVE_MPI_
    195196                if(this->Size()) rank=my_rank;
    196197                else rank=num_procs;
    197198                MPI_Allreduce (&rank,&minrank,1,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
     199                #else
     200                minrank=my_rank;
     201                #endif
    198202
    199203                /*see what the first element of this partition has in stock (this is common to all partitions)*/
     
    203207                        element->ListResultsInfo(&resultsenums,&resultssizes,&resultstimes,&resultssteps,&numberofresults);
    204208                }
     209                #ifdef _HAVE_MPI_
    205210                MPI_Bcast(&numberofresults,1,MPI_DOUBLE,minrank,MPI_COMM_WORLD);
     211                #endif
    206212
    207213                /*Get out if there is no results. Otherwise broadcast info*/
    208214                if(!numberofresults) return;
     215                #ifdef _HAVE_MPI_
    209216                if(my_rank!=minrank){
    210217                        resultsenums=(int*)xmalloc(numberofresults*sizeof(int));
     
    217224                MPI_Bcast(resultstimes,numberofresults,MPI_DOUBLE,minrank,MPI_COMM_WORLD);
    218225                MPI_Bcast(resultssteps,numberofresults,MPI_INT,minrank,MPI_COMM_WORLD);
     226                #endif
    219227
    220228                /*Loop over all results and get nodal vector*/
     
    250258
    251259                /*Gather onto master cpu 0, if needed: */
    252 #ifdef _PARALLEL_
    253260                if(io_gather)patch->Gather();
    254 #endif
    255261
    256262                /*create result object and add to results dataset:*/
     
    276282        int numberofelements;
    277283
    278         #ifdef _PARALLEL_
    279284        local_nelem=this->Size();
     285        #ifdef _HAVE_MPI_
    280286        MPI_Allreduce ( (void*)&local_nelem,(void*)&numberofelements,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
    281287        #else
    282         numberofelements=this->Size();
     288        numberofelements=local_nelem;
    283289        #endif
    284290
Note: See TracChangeset for help on using the changeset viewer.