Newsgroups: comp.parallel.mpi
From: ma_adlum@uxmail.ust.hk (Lum Wing Fung Adrian)
Subject: Can I use MPI_Pack?
Organization: The Hong Kong University of Science and Technology
Date: 14 Sep 1995 06:13:37 GMT
Message-ID: <438h6h$jab@news.ust.hk>

Dear all,
	Suppose I have want to send the following datum from process 0
to process 1 :

	int dlength = 10;
	double ddata [10];
	float fdata [10];
	int idata [10];

	When I use PVM, I can write 

Process 0 : 
	pvm_initsend (PvmDataDefault);
	pvm_pkint (&dlength, 1, 1);
	pvm_pkdouble (ddatat, dlength, 1);
	pvm_pkfloat (fdatat, dlength, 1);
	pvm_pkint (idatat, dlength, 1);
	pvm_send (1, 12345);

Process 1 :
	pvm_recv (0, 12345);
	pvm_upkint (&dlength, 1, 1);
	pvm_upkdouble (ddatat, dlength, 1);
	pvm_upkfloat (fdatat, dlength, 1);
	pvm_upkint (idatat, dlength, 1);
	

	So, can MPI_Pack () do the same things?  Or, may I know how
to use MPI_Pack?  Thanks in advance.

--
 ___       _ _             _      _     _           
/ __| __ _(_) |___ _ _    /_\  __| |_ _(_)__ _ _ _  
\__ \/ _` | | / _ \ '_|  / _ \/ _` | '_| / _` | ' \ 
|___/\__,_|_|_\___/_|   /_/ \_\__,_|_| |_\__,_|_||_| ճߦۤ
Oڭ̪޵P, L@Ϥ߸̥H ( 7:10)

