@@ -176,7 +176,7 @@ def monitor(
176176 )
177177 )
178178 elif log_format == "csv" :
179- f .write ("elapsed_time,cpu,mem_real,mem_virtual" )
179+ f .write ("elapsed_time,nproc, cpu,mem_real,mem_virtual" )
180180 if include_io :
181181 f .write (",read_count,write_count,read_bytes,write_bytes" )
182182 else :
@@ -236,6 +236,8 @@ def monitor(
236236 read_bytes = counters .read_bytes
237237 write_bytes = counters .write_bytes
238238
239+ n_proc = 1
240+
239241 # Get information for children
240242 if include_children :
241243 for child in all_children (pr ):
@@ -250,6 +252,7 @@ def monitor(
250252 write_count += counters .write_count
251253 read_bytes += counters .read_bytes
252254 write_bytes += counters .write_bytes
255+ n_proc += 1
253256 except Exception :
254257 continue
255258
@@ -266,10 +269,10 @@ def monitor(
266269 )
267270 elif log_format == "csv" :
268271 f .write (
269- f"{ elapsed_time } ,{ current_cpu } ,{ current_mem_real } ,{ current_mem_virtual } "
272+ f"{ elapsed_time } ,{ n_proc } , { current_cpu } ,{ current_mem_real } ,{ current_mem_virtual } "
270273 )
271274 if include_io :
272- f .write (f"{ read_count } ,{ write_count } ,{ read_bytes } ,{ write_bytes } " )
275+ f .write (f", { read_count } ,{ write_count } ,{ read_bytes } ,{ write_bytes } " )
273276 f .write ("\n " )
274277 f .flush ()
275278
0 commit comments