Hi, I want to make my code run on 1 or multiple processors. The code, which can run on multiple processors is like the following,
MatCreate(PETSC_COMM_WORLD, &A); MatSetSizes(A, 3*numOfVerticesOfOneProcessor, 3*numOfVerticesOfOneProcessor, systemSize, systemSize); MatSetFromOptions(A); MatMPIAIJSetPreallocation(A, 50, PETSC_NULL, 50, PETSC_NULL); However if I want to run on 1 processor I have to change the last code to: MatSeqAIJSetPreallocation(A,1000,PETSC_NULL); How to avoid changing code? Thanks. Yixun
