#include #include #include "pvm3.h" #define EXE "memerror" int main(int argc, char *argv[]){ int ntask, dim; int *tids; int i,j; double* v; if ((argc != 3) || ((ntask = atoi(argv[1])) <= 0) || ((dim = atoi(argv[2])) <= 0)){ fprintf(stderr,"Usage: %s ntask dimension\n",argv[0]); exit(0); } //Am I the master? if(pvm_parent() == PvmNoParent){ int ns; tids = (int*)calloc(sizeof(int), dim); if(tids == NULL){ fprintf(stderr,"calloc failed: tids\n"); exit(1); } fprintf(stderr,"I'm the parent about to spawn\n"); //spawn // spawn(ntask,&argv[1],4); ns = pvm_spawn(EXE, &argv[1], PvmTaskDefault,// + PvmTaskDebug, "", ntask, tids); if(ns < ntask){ fprintf(stderr, "failed to spawn all tasks\n"); for(i=0;i